| :py:mod:`airflow.providers.apache.drill.hooks.drill` |
| ==================================================== |
| |
| .. py:module:: airflow.providers.apache.drill.hooks.drill |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.apache.drill.hooks.drill.DrillHook |
| |
| |
| |
| |
| .. py:class:: DrillHook(*args, schema = None, **kwargs) |
| |
| Bases: :py:obj:`airflow.hooks.dbapi.DbApiHook` |
| |
| Interact with Apache Drill via sqlalchemy-drill. |
| |
| You can specify the SQLAlchemy dialect and driver that sqlalchemy-drill |
| will employ to communicate with Drill in the extras field of your |
| connection, e.g. ``{"dialect_driver": "drill+sadrill"}`` for communication |
| over Drill's REST API. See the sqlalchemy-drill documentation for |
| descriptions of the supported dialects and drivers. |
| |
| You can specify the default storage_plugin for the sqlalchemy-drill |
| connection using the extras field e.g. ``{"storage_plugin": "dfs"}``. |
| |
| .. py:attribute:: conn_name_attr |
| :annotation: = drill_conn_id |
| |
| |
| |
| .. py:attribute:: default_conn_name |
| :annotation: = drill_default |
| |
| |
| |
| .. py:attribute:: conn_type |
| :annotation: = drill |
| |
| |
| |
| .. py:attribute:: hook_name |
| :annotation: = Drill |
| |
| |
| |
| .. py:attribute:: supports_autocommit |
| :annotation: = False |
| |
| |
| |
| .. py:method:: get_conn(self) |
| |
| Establish a connection to Drillbit. |
| |
| |
| .. py:method:: get_uri(self) |
| |
| Returns the connection URI |
| |
| e.g: ``drill://localhost:8047/dfs`` |
| |
| |
| .. py:method:: set_autocommit(self, conn, autocommit) |
| :abstractmethod: |
| |
| Sets the autocommit flag on the connection |
| |
| |
| .. py:method:: insert_rows(self, table, rows, target_fields = None, commit_every = 1000, replace = False, **kwargs) |
| :abstractmethod: |
| |
| A generic way to insert a set of tuples into a table, |
| a new transaction is created every commit_every rows |
| |
| :param table: Name of the target table |
| :param rows: The rows to insert into the table |
| :param target_fields: The names of the columns to fill in the table |
| :param commit_every: The maximum number of rows to insert in one |
| transaction. Set to 0 to insert all rows in one transaction. |
| :param replace: Whether to replace instead of insert |
| |
| |
| |