| :mod:`airflow.contrib.hooks.pinot_hook` |
| ======================================= |
| |
| .. py:module:: airflow.contrib.hooks.pinot_hook |
| |
| |
| Module Contents |
| --------------- |
| |
| .. py:class:: PinotDbApiHook(*args, **kwargs) |
| |
| Bases: :class:`airflow.hooks.dbapi_hook.DbApiHook` |
| |
| Connect to pinot db(https://github.com/linkedin/pinot) to issue pql |
| |
| .. attribute:: conn_name_attr |
| :annotation: = pinot_broker_conn_id |
| |
| |
| |
| .. attribute:: default_conn_name |
| :annotation: = pinot_broker_default |
| |
| |
| |
| .. attribute:: supports_autocommit |
| :annotation: = False |
| |
| |
| |
| |
| .. method:: get_conn(self) |
| |
| Establish a connection to pinot broker through pinot dbqpi. |
| |
| |
| |
| |
| .. method:: get_uri(self) |
| |
| Get the connection uri for pinot broker. |
| |
| e.g: http://localhost:9000/pql |
| |
| |
| |
| |
| .. method:: get_records(self, sql) |
| |
| Executes the sql and returns a set of records. |
| |
| :param sql: the sql statement to be executed (str) or a list of |
| sql statements to execute |
| :type sql: str |
| |
| |
| |
| |
| .. method:: get_first(self, sql) |
| |
| Executes the sql and returns the first resulting row. |
| |
| :param sql: the sql statement to be executed (str) or a list of |
| sql statements to execute |
| :type sql: str or list |
| |
| |
| |
| |
| .. method:: set_autocommit(self, conn, autocommit) |
| |
| |
| |
| |
| .. method:: insert_rows(self, table, rows, target_fields=None, commit_every=1000) |
| |
| |
| |
| |