Starburst/Trino setup
profiles.yml file is for dbt Core and dbt fusion onlyIf you're using dbt platform, you don't need to create a profiles.yml file. This file is only necessary when you use dbt Core or dbt Fusion locally. To learn more about Fusion prerequisites, refer to Supported features. To connect your data platform to dbt, refer to About data platforms.
- Maintained by: Starburst Data, Inc.
- Authors: Marius Grama, Przemek Denkiewicz, Michiel de Smet, Damian Owsianny
- GitHub repo: starburstdata/dbt-trino
- PyPI package:
dbt-trino - Slack channel: #db-starburst-and-trino
- Supported dbt Core version: v0.20.0 and newer
- dbt support: Supported
- Minimum data platform version: n/a
Installing dbt-trino
Use pip to install the adapter. Before 1.8, installing the adapter would automatically install dbt-core and any additional dependencies. Beginning in 1.8, installing an adapter does not automatically install dbt-core. This is because adapters and dbt Core versions have been decoupled from each other so we no longer want to overwrite existing dbt-core installations.
Use the following command for installation:
python -m pip install dbt-core dbt-trino
Configuring dbt-trino
For Starburst/Trino-specific configuration, please refer to Starburst/Trino configs.
Connecting to Starburst/Trino
To connect to a data platform with dbt Core, create appropriate profile and target YAML keys/values in the profiles.yml configuration file for your Starburst/Trino clusters. This dbt YAML file lives in the .dbt/ directory of your user/home directory. For more information, refer to Connection profiles and profiles.yml.
The parameters for setting up a connection are for Starburst Enterprise, Starburst Galaxy, and Trino clusters. Unless specified, "cluster" will mean any of these products' clusters.
Host parameters
The following profile fields are always required except for user, which is also required unless you're using the oauth, oauth_console, cert, or jwt authentication methods.
| Loading table... |
Roles in Starburst Enterprise
If connecting to a Starburst Enterprise cluster with built-in access controls enabled, you must specify a role using the format detailed in Additional parameters. If a role is not specified, the default role for the provided username is used.
Schemas and databases
When selecting the catalog and the schema, make sure the user has read and write access to both. This selection does not limit your ability to query the catalog. Instead, they serve as the default location for where tables and views are materialized. In addition, the Trino connector used in the catalog must support creating tables. This default can be changed later from within your dbt project.
Additional parameters
The following profile fields are optional to set up. They let you configure your cluster's session and dbt for your connection.
| Loading table... |
Authentication parameters
The authentication methods that dbt Core supports are:
ldap— LDAP (username and password)kerberos— Kerberosjwt— JSON Web Token (JWT)certificate— Certificate-based authenticationoauth— Open Authentication (OAuth)oauth_console— Open Authentication (OAuth) with authentication URL printed to the consolenone— None, no authentication
Set the method field to the authentication method you intend to use for the connection. For a high-level introduction to authentication in Trino, see Trino Security: Authentication types.
Click on one of these authentication methods for further details on how to configure your connection profile. Each tab also includes an example profiles.yml configuration file for you to review.
- LDAP
- Kerberos
- JWT
- Certificate
- OAuth
- OAuth (console)
- None
The following table lists the authentication parameters to set for LDAP.
For more information, refer to LDAP authentication in the Trino docs.
| Loading table... |
Example profiles.yml for LDAP
trino:
target: dev
outputs:
dev:
type: trino
method: ldap
user: [user]
password: [password]
host: [hostname]
database: [database name]
schema: [your dbt schema]
port: [port number]
threads: [1 or more]
The following table lists the authentication parameters to set for Kerberos.
For more information, refer to Kerberos authentication in the Trino docs.
| Loading table... |
Example profiles.yml for Kerberos
trino:
target: dev
outputs:
dev:
type: trino
method: kerberos
user: commander
keytab: /tmp/trino.keytab
krb5_config: /tmp/krb5.conf
principal: trino@EXAMPLE.COM
host: trino.example.com
port: 443
database: analytics
schema: public
The following table lists the authentication parameters to set for JSON Web Token.
For more information, refer to JWT authentication in the Trino docs.
| Loading table... |
Example profiles.yml for JWT
trino:
target: dev
outputs:
dev:
type: trino
method: jwt
jwt_token: [my_long_jwt_token_string]
host: [hostname]
database: [database name]
schema: [your dbt schema]
port: [port number]
threads: [1 or more]
The following table lists the authentication parameters to set for certificates.
For more information, refer to Certificate authentication in the Trino docs.
| Loading table... |
Example profiles.yml for certificate
trino:
target: dev
outputs:
dev:
type: trino
method: certificate
cert: [path/to/cert_file]
client_certificate: [path/to/client/cert]
client_private_key: [path to client key]
database: [database name]
schema: [your dbt schema]
port: [port number]
threads: [1 or more]
The only authentication parameter to set for OAuth 2.0 is method: oauth. If you're using Starburst Enterprise or Starburst Galaxy, you must enable OAuth 2.0 in Starburst before you can use this authentication method.
For more information, refer to both OAuth 2.0 authentication in the Trino docs and the README for the Trino Python client.
It's recommended that you install keyring to cache the OAuth 2.0 token over multiple dbt invocations by running python -m pip install 'trino[external-authentication-token-cache]'. The keyring package is not installed by default.
Example profiles.yml for OAuth
sandbox-galaxy:
target: oauth
outputs:
oauth:
type: trino
method: oauth
host: bunbundersders.trino.galaxy-dev.io
catalog: dbt_target
schema: dataders
port: 443
The only authentication parameter to set for OAuth 2.0 is method: oauth_console. If you're using Starburst Enterprise or Starburst Galaxy, you must enable OAuth 2.0 in Starburst before you can use this authentication method.
For more information, refer to both OAuth 2.0 authentication in the Trino docs and the README for the Trino Python client.
The only difference between oauth_console and oauth is:
oauth— An authentication URL automatically opens in a browser.oauth_console— A URL is printed to the console.
It's recommended that you install keyring to cache the OAuth 2.0 token over multiple dbt invocations by running python -m pip install 'trino[external-authentication-token-cache]'. The keyring package is not installed by default.
Example profiles.yml for OAuth
sandbox-galaxy:
target: oauth_console
outputs:
oauth:
type: trino
method: oauth_console
host: bunbundersders.trino.galaxy-dev.io
catalog: dbt_target
schema: dataders
port: 443
You don't need to set up authentication (method: none), however, dbt Labs strongly discourages people from using it in any real application. Its use case is only for toy purposes (as in to play around with it), like local examples such as running Trino and dbt entirely within a single Docker container.
Example profiles.yml for no authentication
trino:
target: dev
outputs:
dev:
type: trino
method: none
user: commander
host: trino.example.com
port: 443
database: analytics
schema: public
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.