- Install the
dbt-trino
adapter plugin, which allows you to use dbt together with Trino / Starburst Galaxy. You may want to do this inside a Python virtual environment. Below I list the steps I took to create my virtual environment.
python3 -m venv dbt-env
source dbt-env/bin/activate
pip install --upgrade pip wheel setuptools
pip install dbt-trino
Make sure you are up to date on your versions.
dbt --version
Other helpful links to getting started with setting up your virtual environment:
- Install with pip dbt instructions
- Starburst documentation which dives into more detail about the process described above
- Python download
-
Clone this GitHub repo to your local machine:
git clone https://github.com/monimiller/dbt-galaxy-covid-demo.git
-
Copy
sample.profiles.yml
to the root of your machine,~/dbt/profiles.yml
. (Why? This file will contain yourpassword
for connecting to Trino/Starburst, so you don't want it checked intogit
.)
cp ./sample.profiles.yml ~/.dbt/profiles.yml
-
Open the file, and update the fields denoted by
<>
with your own user, password, cluster, etc. Specify dbt_aws_tgt as your catalog if you want Iceberg tables. If not, use dbt_aws_source. You can keep the sample schema. -
Verify that you can connect to Trino / Starburst Galaxy. (If your Galaxy cluster is stopped, it may take a few moments for it to resume.)
dbt debug
- Install dbt packages (
dbt_utils
) for use in the project:
dbt deps
- Try running dbt:
dbt run
dbt test
dbt build
- Generate and view documentation:
dbt docs generate
dbt docs serve