airflow.providers.trino.hooks.trino¶
Module Contents¶
Functions¶
Return json string with dag_id, task_id, execution_date and try_number |
Attributes¶
- airflow.providers.trino.hooks.trino.generate_trino_client_info()[source]¶
Return json string with dag_id, task_id, execution_date and try_number
- exception airflow.providers.trino.hooks.trino.TrinoException[source]¶
Bases:
ExceptionTrino exception
- class airflow.providers.trino.hooks.trino.TrinoHook(*args, schema=None, **kwargs)[source]¶
Bases:
airflow.hooks.dbapi.DbApiHookInteract with Trino through trino package.
>>> ph = TrinoHook() >>> sql = "SELECT count(1) AS num FROM airflow.static_babynames" >>> ph.get_records(sql) [[340698]]
- insert_rows(self, table, rows, target_fields=None, commit_every=0, replace=False, **kwargs)[source]¶
A generic way to insert a set of tuples into a table.
- Parameters
table (str) – Name of the target table
rows (Iterable[tuple]) – The rows to insert into the table
target_fields (Optional[Iterable[str]]) – The names of the columns to fill in the table
commit_every (int) – The maximum number of rows to insert in one transaction. Set to 0 to insert all rows in one transaction.
replace (bool) – Whether to replace instead of insert