Trino SQL blocks

Credentials
Open the file named io_config.yaml
at the root of your Mage project and enter the following:
version: 0.1.1
default:
trino:
catalog: postgresql # Change this to the catalog of your choice
host: 127.0.0.1
http_headers:
X-Something: 'mage=power'
http_scheme: http
password: mage1337 # Optional
port: 8080
schema: core_data
session_properties: # Optional
acc01.optimize_locality_enabled: false
optimize_hash_generation: true
source: trino-cli # Optional
user: admin
verify: /path/to/your/ca.crt # Optional
data_type_properties:
timestamp_precision: 3 # Optional. Set TIMESTAMP(n) precision
How to use
-
Trino must be running on a remote server or on your local workstation. Read these instructions to run Trino locally.
-
Create a new pipeline or edit an existing pipeline.
-
Add a data loader or transformer SQL block.
-
In the block’s header, click the dropdown menu labeled Connection and select the option labeled Trino.
-
In the block’s header, click the dropdown menu labeled Profile and select the option labeled default.
If the name of your profile in the
io_config.yaml
file is different, then select the profile name that matches your settings. -
You can optionally check the box labeled Use raw SQL. If you do, read more about how to use SQL blocks with raw SQL.
-
Write your SQL statements in the SQL block.
-
Once you’re finished writing your SQL statements, click the play button in the top right corner of the block to execute the SQL block and preview the results.