Skip to main content

Starburst/Trino setup

profiles.yml file is for dbt Core users only

If you're using dbt Cloud, you don't need to create a profiles.yml file. This file is only for dbt Core users. To connect your data platform to dbt Cloud, 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 Cloud 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:

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.

FieldExampleDescription
hostmycluster.mydomain.com

Format for Starburst Galaxy:
  • mygalaxyaccountname-myclustername.trino.galaxy.starburst.io
The hostname of your cluster.

Don't include the http:// or https:// prefix.
databasemy_postgres_catalogThe name of a catalog in your cluster.
schemamy_schemaThe name of a schema within your cluster's catalog.

It's not recommended to use schema names that have upper case or mixed case letters.
port443The port to connect to your cluster. By default, it's 443 for TLS enabled clusters.
userFormat for Starburst Enterprise or Trino:
  • user.name
  • user.name@mydomain.com

Format for Starburst Galaxy:
  • user.name@mydomain.com/role
The username (of the account) to log in to your cluster. When connecting to Starburst Galaxy clusters, you must include the role of the user as a suffix to the username.

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.

Profile fieldExampleDescription
threads8How many threads dbt should use (default is 1)
rolessystem: analystCatalog roles can be set under the optional roles parameter using the following format: catalog: role.
session_propertiesquery_max_run_time: 4hSets Trino session properties used in the connection. Execute SHOW SESSION to see available options
prepared_statements_enabledtrue or falseEnable usage of Trino prepared statements (used in dbt seed commands) (default: true)
retries10Configure how many times all database operation is retried when connection issues arise (default: 3)
timezoneEurope/BrusselsThe time zone for the Trino session (default: client-side local timezone)
http_headersX-Trino-Client-Info: dbt-trinoHTTP Headers to send alongside requests to Trino, specified as a YAML dictionary of (header, value) pairs.
http_schemehttps or httpThe HTTP scheme to use for requests to Trino (default: http, or https if kerberos, ldap or jwt)

Authentication parameters

The authentication methods that dbt Core supports are:

  • ldap — LDAP (username and password)
  • kerberos — Kerberos
  • jwt — JSON Web Token (JWT)
  • certificate — Certificate-based authentication
  • oauth — Open Authentication (OAuth)
  • oauth_console — Open Authentication (OAuth) with authentication URL printed to the console
  • none — 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.

The following table lists the authentication parameters to set for LDAP.

For more information, refer to LDAP authentication in the Trino docs.

Profile fieldExampleDescription
methodldapSet LDAP as the authentication method.
userFormat for Starburst Enterprise or Trino:
  • user.name
  • user.name@mydomain.com

Format for Starburst Galaxy:
  • user.name@mydomain.com/role
The username (of the account) to log in to your cluster. When connecting to Starburst Galaxy clusters, you must include the role of the user as a suffix to the username.
passwordabc123Password for authentication.
impersonation_user (optional)impersonated_tomOverride the provided username. This lets you impersonate another user.

Example profiles.yml for LDAP

~/.dbt/profiles.yml
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]
0