airflow.providers.vertica.hooks.vertica¶
Classes¶
Interact with Vertica. |
Functions¶
|
Replace the default DbApiHook fetch_all_handler in order to fix this issue https://github.com/apache/airflow/issues/32993. |
Module Contents¶
- airflow.providers.vertica.hooks.vertica.vertica_fetch_all_handler(cursor)[source]¶
Replace the default DbApiHook fetch_all_handler in order to fix this issue https://github.com/apache/airflow/issues/32993.
Returned value will not change after the initial call of fetch_all_handler, all the remaining code is here only to make vertica client throws error. With Vertica, if you run the following sql (with split_statements set to false):
INSERT INTO MyTable (Key, Label) values (1, ‘test 1’); INSERT INTO MyTable (Key, Label) values (1, ‘test 2’); INSERT INTO MyTable (Key, Label) values (3, ‘test 3’);
each insert will have its own result set and if you don’t try to fetch data of those result sets you won’t detect error on the second insert.
- class airflow.providers.vertica.hooks.vertica.VerticaHook(*args, schema=None, log_sql=True, **kwargs)[source]¶
Bases:
airflow.providers.common.sql.hooks.sql.DbApiHook
Interact with Vertica.
This hook use a customized version of default fetch_all_handler named vertica_fetch_all_handler.
- run(sql: str | collections.abc.Iterable[str], autocommit: bool = ..., parameters: collections.abc.Iterable | collections.abc.Mapping[str, Any] | None = ..., handler: None = ..., split_statements: bool = ..., return_last: bool = ...) None [source]¶
- run(sql: str | collections.abc.Iterable[str], autocommit: bool = ..., parameters: collections.abc.Iterable | collections.abc.Mapping[str, Any] | None = ..., handler: Callable[[Any], Any] = ..., split_statements: bool = ..., return_last: bool = ...) Any | list[Any]
Overwrite the common sql run.
Will automatically replace fetch_all_handler by vertica_fetch_all_handler.