{"id":7932,"library":"apache-airflow-providers-vertica","title":"Apache Airflow Vertica Provider","description":"The `apache-airflow-providers-vertica` package is an Apache Airflow provider that enables seamless integration with Vertica databases. It offers hooks and operators to connect to Vertica and execute SQL queries within Airflow DAGs. The current version is 4.3.2 and it follows an independent semantic versioning scheme, with frequent updates that may introduce new features, bug fixes, or compatibility changes with Airflow core.","status":"active","version":"4.3.2","language":"en","source_language":"en","source_url":"https://github.com/apache/airflow/tree/main/airflow/providers/vertica","tags":["airflow","database","vertica","provider","etl","sql"],"install":[{"cmd":"pip install apache-airflow-providers-vertica","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core Airflow functionality","package":"apache-airflow","version":">=2.11.0"},{"reason":"Python client for Vertica database interaction","package":"vertica-python","version":">=1.3.0"},{"reason":"Common compatibility layer for providers","package":"apache-airflow-providers-common-compat","version":">=1.12.0"},{"reason":"Common SQL functionality for providers","package":"apache-airflow-providers-common-sql","version":">=1.32.0"},{"reason":"SQLAlchemy support (optional extra)","package":"sqlalchemy","version":">=1.4.54","optional":true}],"imports":[{"symbol":"VerticaHook","correct":"from airflow.providers.vertica.hooks.vertica import VerticaHook"},{"note":"The dedicated `VerticaOperator` was removed in `apache-airflow-providers-vertica` version 4.0.0 and superseded by the generic `SQLExecuteQueryOperator` from `common.sql`.","wrong":"from airflow.providers.vertica.operators.vertica import VerticaOperator","symbol":"SQLExecuteQueryOperator","correct":"from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator"}],"quickstart":{"code":"import pendulum\n\nfrom airflow.models.dag import DAG\nfrom airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator\n\n# Ensure a Vertica connection named 'vertica_default' is configured in Airflow UI\n# with host, port, schema, login, and password.\n\nwith DAG(\n    dag_id=\"vertica_quickstart_dag\",\n    start_date=pendulum.datetime(2023, 1, 1, tz=\"UTC\"),\n    catchup=False,\n    schedule=None,\n    tags=[\"vertica\", \"example\"],\n) as dag:\n    create_table_task = SQLExecuteQueryOperator(\n        task_id=\"create_vertica_table\",\n        conn_id=\"vertica_default\",\n        sql=\"\"\"CREATE TABLE IF NOT EXISTS public.test_airflow (id INT, name VARCHAR(50));\"\"\",\n    )\n\n    insert_data_task = SQLExecuteQueryOperator(\n        task_id=\"insert_vertica_data\",\n        conn_id=\"vertica_default\",\n        sql=\"\"\"INSERT INTO public.test_airflow (id, name) VALUES (1, 'Airflow Test');\"\"\",\n    )\n\n    select_data_task = SQLExecuteQueryOperator(\n        task_id=\"select_vertica_data\",\n        conn_id=\"vertica_default\",\n        sql=\"\"\"SELECT * FROM public.test_airflow;\"\"\",\n        handler=lambda cursor: print(cursor.fetchall()), # Print results to task logs\n    )\n\n    create_table_task >> insert_data_task >> select_data_task\n","lang":"python","description":"This quickstart demonstrates how to define a simple Airflow DAG to interact with Vertica. It creates a table, inserts data, and then selects it, printing the results to the task logs. An Airflow connection with `Conn Id` set to `vertica_default` must be configured in the Airflow UI, providing the necessary host, port, schema, login, and password for your Vertica instance."},"warnings":[{"fix":"Migrate to `SQLExecuteQueryOperator` from `airflow.providers.common.sql.operators.sql`. This operator provides equivalent functionality and is the recommended approach for SQL execution across many database providers.","message":"The dedicated `VerticaOperator` (`airflow.providers.vertica.operators.vertica.VerticaOperator`) was removed in version 4.0.0 of this provider.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Ensure your Airflow core installation meets or exceeds the minimum version required by the provider. If your Airflow version is older, upgrade Airflow first before installing the latest provider.","message":"Minimum Airflow core version requirements increase with provider updates. For provider version 4.3.x, Airflow 2.11.0+ is required.","severity":"breaking","affected_versions":">=4.2.0 (requires Airflow >= 2.11.0), >=4.1.0 (requires Airflow >= 2.10.0), >=4.0.0 (requires Airflow >= 2.9.0)"},{"fix":"This issue was addressed in provider versions >= 4.2.1 by a customized `fetch_all_handler` within `VerticaHook`. If on an older provider version, consider upgrading or setting `split_statements=True` for SQL operators to ensure each statement is executed and validated independently. Alternatively, explicit transaction management may be needed.","message":"When running multi-statement SQL queries with `split_statements=False` (default for `SQLExecuteQueryOperator`), errors after the first statement might not be detected by older versions of the `VerticaHook`, leading to partial commits without raising an exception.","severity":"gotcha","affected_versions":"<4.2.1"},{"fix":"The provider package must be installed into the Docker image used by *all* Airflow components. Modify your `Dockerfile` or `requirements.txt` included in your image build process to ensure the provider is universally available.","message":"In containerized Airflow deployments (e.g., Docker, Kubernetes), simply `pip install`ing the provider in one component (like the scheduler) does not make it available to all other components (webserver, workers, etc.).","severity":"gotcha","affected_versions":"All versions in containerized environments"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install apache-airflow-providers-vertica` in the correct virtual environment or ensure it's included in your Airflow Docker image build process. Verify the installation by running `pip show apache-airflow-providers-vertica`.","cause":"The `apache-airflow-providers-vertica` package is not installed or not available in the Python environment where Airflow components (scheduler, worker, webserver) are running.","error":"ModuleNotFoundError: No module named 'airflow.providers.vertica'"},{"fix":"Update your import statements to the correct path: `from airflow.providers.vertica.hooks.vertica import VerticaHook`. For operators, use `SQLExecuteQueryOperator` from `airflow.providers.common.sql.operators.sql`.","cause":"This import path is from an older version of Airflow (1.x or early 2.x) and is no longer valid in modern Airflow 2+ provider packages.","error":"AttributeError: module 'airflow.contrib.hooks.vertica_hook' has no attribute 'VerticaHook'"},{"fix":"Upgrade your Apache Airflow core installation to at least the version specified in the error message (e.g., `pip install 'apache-airflow>=2.11.0'`). Alternatively, install an older version of the Vertica provider that is compatible with your current Airflow core version.","cause":"You are trying to install or use a version of `apache-airflow-providers-vertica` that requires a newer minimum version of Apache Airflow core than currently installed.","error":"This release of provider is only available for Airflow X.Y.Z+"}]}