Trino Adapter

Generate Trino and Presto SQL from your model.

What the adapter emits

  • Identifiers in "double quotes"; bare column names in expressions are lowercased.
  • Date literals as DATE '2026-01-01'; grain truncation as DATE_TRUNC('month', x); parts with YEAR(x), DAY_OF_WEEK(x), WEEK(x).
  • CTEs for the per-fact subqueries and a FULL OUTER JOIN when a query blends measures from two facts.

Configuration

trino_cluster:
  adapter: trino
  name: Trino Cluster
  tier: warm
  host: trino.example.com
  port: 8080
  catalog: hive
  schema: default
  username: analyst
  # password: never here; zsql deploy strips it if present

Connection fields

0sql never connects to Trino. Host, catalog and schema are carried as metadata for your own application, which runs the SQL it gets back. 0sql never uses them. If a password does land in datasources.yml, zsql deploy strips it before building the archive.

Notes

  • Expressions are Trino SQL. approx_distinct, approx_percentile, array_agg and date_diff are fine in expression.sql.
  • Qualify tables in physical_name (hive.default.store_sales) when the application’s session does not set a default catalog and schema.

Next Steps