DB API¶
tdclient¶
-
tdclient.
connect
(*args, **kwargs)[source]¶ Returns a DBAPI compatible connection object
- Parameters
type (str) – query engine type. “hive” by default.
db (str) – the name of database on Treasure Data
result_url (str) – result output URL
priority (str) – job priority
retry_limit (int) – job retry limit
wait_interval (int) – job wait interval to check status
wait_callback (callable) – a callback to be called on every ticks of job wait
- Returns
tdclient.connection¶
tdclient.cursor¶
-
class
tdclient.cursor.
Cursor
(api, wait_interval=5, wait_callback=None, **kwargs)[source]¶ Bases:
object
-
fetchall
()[source]¶ Fetch all (remaining) rows of a query result, returning them as a sequence of sequences (e.g. a list of tuples). Note that the cursor’s arraysize attribute can affect the performance of this operation.
-
fetchmany
(size=None)[source]¶ Fetch the next set of rows of a query result, returning a sequence of sequences (e.g. a list of tuples). An empty sequence is returned when no more rows are available.
-
fetchone
()[source]¶ Fetch the next row of a query result set, returning a single sequence, or None when no more data is available.
-
job_status
()[source]¶ Show job status
- Returns
The status information of the given job id at last execution.
-
show_job
()[source]¶ Returns detailed information of a Job
- Returns
Detailed information of a job
- Return type
dict
-
property
api
¶
-
property
description
¶
-
property
rowcount
¶
-