Registry / data / dbt-trino

dbt-trino

JSON →
library1.10.2pypypiunverified

The dbt-trino adapter allows dbt (data build tool) to connect to Trino, a distributed SQL query engine. It enables analytics engineers to transform data across various data sources that Trino can access, leveraging dbt's capabilities for modularity, testing, and documentation. The current version is 1.10.1, and it typically releases new versions in alignment with `dbt-core` major and minor releases.

pip install dbt-core dbt-trino
INSTALL
IMPORT
SIG · DBT-TRINO
D
dbt-trino
datapythonv1.10.2
Install
9.3s avg
Import
Disk
208MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.10.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.960 runs
build_error
glibc
py 3.103.960 runs
installs and imports cleanly · install 9.3s · import 0.000s · 208MB
208MB installed
● package 208MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dbt-trino
N/A (Adapter is configured via profiles.yml)
dbt adapters like dbt-trino are typically not imported directly in Python code for end-user functionality. Interaction is primarily through the dbt CLI and YAML configuration files like `profiles.yml`.

To quickly get started with dbt-trino, first ensure both `dbt-core` and `dbt-trino` are installed. Then, initialize a dbt project using `dbt init` and configure your `profiles.yml` file to define the connection to your Trino cluster. The example shows a basic configuration with no authentication, which can be extended for LDAP, JWT, or OAuth2. After configuration, you can create a simple SQL model and run it using `dbt run`.

import os # 1. Install dbt-trino (already covered in install instructions) # pip install dbt-core dbt-trino # 2. Initialize a dbt project (if you don't have one) # dbt init my_trino_project # 3. Configure your profiles.yml (usually in ~/.dbt/profiles.yml) # Example profiles.yml content for a basic Trino connection: # my_trino_project: # target: dev # outputs: # dev: # type: trino # method: none # Or 'ldap', 'jwt', 'oauth', etc. # user: admin # password: "" # Required if method is ldap/kerberos, otherwise optional # catalog: hive_catalog # Your Trino catalog (e.g., hive, iceberg) # host: localhost # port: 8080 # schema: default_schema # Your Trino schema (database) # threads: 4 # http_scheme: http # or https # For OAuth2, ensure 'trino[external-authentication-token-cache]' and 'keyring' are installed # and set method: oauth in profiles.yml # 4. Create a simple dbt model (e.g., models/my_model.sql) # -- models/my_model.sql # {{ config(materialized='view') }} # SELECT # 1 as id, # 'hello' as message # # 5. Run your dbt models (execute in your terminal in the dbt project directory) # dbt debug --target dev # dbt run --target dev # dbt test --target dev
dbt --version
Debug
Known issues
breakingStarting with dbt-core v1.8, users must explicitly install both `dbt-core` and `dbt-trino` (e.g., `pip install dbt-core dbt-trino`). Prior to v1.8, installing the adapter implicitly installed `dbt-core`, but this behavior changed to decouple core and adapter versions.
fix
Ensure your installation command is `pip install dbt-core dbt-trino`. If upgrading, verify both packages are installed to compatible versions.
affects: dbt-core >= 1.8
gotchaTrino's SQL dialect can differ from other data warehouses, requiring query modifications. Common differences include function names (e.g., `IFF()` in Snowflake is `IF()` in Trino, `NVL()` is `COALESCE()`, `DATEADD()` is `DATE_ADD()`) and behavior of implicit type coercion. Direct `PIVOT` functionality is also generally not available in Trino SQL.
fix
Consult Trino documentation for SQL function equivalents. Use `dbt_utils.pivot` macro or manual aggregation for pivoting. Be mindful of explicit casting for type comparisons.
affects: All
gotchaThe `merge` incremental strategy (used for upserts) relies on underlying Trino connector support for `MERGE` statements. Some Trino connectors have limited or no `MERGE` support, which can lead to errors.
fix
If `merge` fails, consider using the `delete+insert` incremental strategy instead, or verify your specific Trino connector's `MERGE` capabilities.
affects: All
gotchaWhen using AWS Glue as a metastore with Trino, the `on_table_exists='rename'` configuration for table materialization is not supported and will result in a `NOT_SUPPORTED` error. Glue does not support table renames.
fix
Set `on_table_exists='drop'` in your model configuration or `dbt_project.yml` when working with AWS Glue.
affects: All (when using AWS Glue with `on_table_exists='rename'`)
gotchaWhen using OAuth2 authentication, users have reported `Error: header info didn't have x_token_server` after tokens expire. This indicates that automatic token refresh or re-prompting might not occur as expected, requiring manual intervention.
fix
Manually delete the expired token from your `keyring` storage. Ensure `keyring` and the `trino[external-authentication-token-cache]` extra are correctly installed and configured. Monitor for upstream fixes in `dbt-trino` or `trino-python-client`.
affects: dbt-trino >= 1.8.1 (reported for 1.8.*)
deprecateddbt-core v1.10 introduces new deprecation warnings for custom inputs such as unrecognized resource properties, configurations, top-level keys in YAML files, duplicate YAML keys, and unexpected Jinja blocks. Projects migrating to v1.10 or later may encounter these warnings.
fix
Review your `dbt_project.yml` and model configurations for adherence to dbt's expected YAML schema. Use the `--warn-error-options '{"warn": ["Deprecations"]}'` flag to explicitly treat new deprecation warnings as warnings, rather than errors if `--warn-error` is enabled.
affects: dbt-core >= 1.10
Upgrade
Version history
1.10.2latest on PyPI · released May 22, 2026
Audit
Dependencies
dbt-corerequiredRequired for dbt functionality; explicitly install alongside adapter since dbt-core v1.8.
trinorequiredPython client for Trino connectivity; `[external-authentication-token-cache]` extra is useful for OAuth2.
keyringoptionalRecommended for caching OAuth2 tokens over multiple dbt invocations.
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
dbt-trino — pip install dbt-trino · libregistry