{"id":4426,"library":"apache-airflow-providers-trino","title":"Trino Provider for Apache Airflow","description":"The `apache-airflow-providers-trino` package provides Apache Airflow users with hooks, operators, and transfers to interact with Trino (formerly PrestoSQL). It enables programmatic orchestration of Trino SQL queries within Airflow DAGs, facilitating ETL and data pipeline workflows. The current version is 6.5.1, and the provider follows a strict Semantic Versioning policy with frequent releases independent of Airflow core.","status":"active","version":"6.5.1","language":"en","source_language":"en","source_url":"https://github.com/apache/airflow/tree/main/airflow/providers/trino","tags":["airflow","provider","trino","sql","etl","data orchestration","data warehouse"],"install":[{"cmd":"pip install apache-airflow-providers-trino","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core Apache Airflow installation is required; version 6.5.1 requires `>=2.11.0`.","package":"apache-airflow","optional":false},{"reason":"Python client for Trino, version `>=0.319.0` required.","package":"trino","optional":false},{"reason":"Required for data handling, specific version depends on Python version (e.g., `>=2.3.3` for Python >= 3.14).","package":"pandas","optional":false},{"reason":"Common SQL provider, version `>=1.32.0` required.","package":"apache-airflow-providers-common-sql","optional":false},{"reason":"Common compatibility provider, version `>=1.12.0` required.","package":"apache-airflow-providers-common-compat","optional":false},{"reason":"Enables integration with Google Cloud services (e.g., for GCSToTrinoOperator). Install with `pip install apache-airflow-providers-trino[google]`.","package":"apache-airflow-providers-google","optional":true},{"reason":"Enables OpenLineage integration. Install with `pip install apache-airflow-providers-trino[openlineage]`.","package":"apache-airflow-providers-openlineage","optional":true}],"imports":[{"symbol":"TrinoHook","correct":"from airflow.providers.trino.hooks.trino import TrinoHook"},{"note":"The operator is part of the Airflow provider package, not a top-level module.","wrong":"from trino_operator import TrinoOperator","symbol":"TrinoOperator","correct":"from airflow.providers.trino.operators.trino import TrinoOperator"},{"symbol":"TrinoToS3Operator","correct":"from airflow.providers.trino.transfers.trino_to_s3 import TrinoToS3Operator"}],"quickstart":{"code":"import os\nimport pendulum\n\nfrom airflow.models.dag import DAG\nfrom airflow.providers.trino.operators.trino import TrinoOperator\n\n# Configure Trino Connection in Airflow UI:\n# Conn Id: 'trino_default'\n# Conn Type: Trino\n# Host: <your_trino_host>\n# Port: <your_trino_port>\n# Schema: <your_trino_schema>\n# User: <your_trino_user>\n# Password: <your_trino_password> (optional)\n# Extra: {'protocol': 'https', 'verify': 'false'} (example for HTTPS/self-signed)\n\nwith DAG(\n    dag_id='trino_example_dag',\n    start_date=pendulum.datetime(2023, 1, 1, tz='UTC'),\n    catchup=False,\n    schedule=None,\n    tags=['trino', 'example'],\n) as dag:\n    create_test_table = TrinoOperator(\n        task_id='create_test_table',\n        trino_conn_id='trino_default',\n        sql=\"\"\"\n            CREATE TABLE IF NOT EXISTS memory.default.airflow_test (\n                id INT,\n                name VARCHAR\n            )\n        \"\"\",\n        handler=lambda _: None, # For DDL, handler is often not needed or can be a no-op\n    )\n\n    insert_data = TrinoOperator(\n        task_id='insert_data',\n        trino_conn_id='trino_default',\n        sql=\"\"\"\n            INSERT INTO memory.default.airflow_test (id, name)\n            VALUES (1, 'Airflow'), (2, 'Trino')\n        \"\"\",\n        handler=lambda _: None,\n    )\n\n    select_data = TrinoOperator(\n        task_id='select_data',\n        trino_conn_id='trino_default',\n        sql=\"SELECT * FROM memory.default.airflow_test\",\n    )\n\n    create_test_table >> insert_data >> select_data\n","lang":"python","description":"This quickstart demonstrates a basic Airflow DAG that uses the `TrinoOperator` to interact with a Trino cluster. It includes tasks for creating a table, inserting data, and selecting data. Ensure you configure a 'Trino' connection in the Airflow UI with the ID `trino_default` before running this DAG."},"warnings":[{"fix":"Always check the provider's documentation or PyPI page for the exact `apache-airflow` version requirement before upgrading or installing. Upgrade Airflow core if necessary and run `airflow upgrade db`.","message":"The minimum required Apache Airflow version for `apache-airflow-providers-trino` frequently increases with new provider releases. For version 6.5.1, Airflow 2.11.0 or newer is required. Installing this provider on an older Airflow version (e.g., <2.11.0) may automatically upgrade your Airflow core, potentially requiring `airflow upgrade db` manually.","severity":"breaking","affected_versions":"All versions, specifically 6.4.0+ requires Airflow 2.11+, 6.2.0+ requires Airflow 2.10+, 5.1.0+ requires Airflow 2.4+, 3.0.0+ requires Airflow 2.2+, 2.1.0+ requires Airflow 2.1+."},{"fix":"Review your Airflow Trino connection configuration and specify only one authentication method in the 'Extra' field or dedicated fields.","message":"When configuring a Trino connection in Airflow, ensure that only one authentication method (e.g., password, JWT, Kerberos) is set in the connection details. Attempting to use multiple authentication methods simultaneously can lead to task failures.","severity":"gotcha","affected_versions":">=6.3.3"},{"fix":"Migrate any usage of `delegate_to` in `GCSToTrinoOperator` to `impersonation_chain`. For older versions, consider `impersonation_chain` as best practice.","message":"In provider version 5.0.0, the deprecated `delegate_to` parameter was removed from `GCSToTrinoOperator` (and related Google Cloud operators/hooks). Impersonation should now be achieved using the `impersonation_chain` parameter.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Ensure your Airflow core version is at least 2.1.0 or higher, as required by the specific provider version you are using.","message":"The `apply_default` decorator was removed, which is why older versions of this provider required Airflow 2.1.0+. While fixed, it highlights the need to stay updated with both provider and Airflow core versions.","severity":"deprecated","affected_versions":"<2.1.0 of Airflow if using Trino provider versions affected by this change."}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}