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

The server never connects to Trino: it has no database driver in it, and the only keys the deployed model keeps are adapter, tier and the name. Your application runs the statement it gets back, with its own credentials.

zsql on this machine does connect, read-only, for zsql catalog, zsql sample and zsql run. It connects over HTTP: username and a password, or a url. Trino declares no foreign keys, so join inference there is name matching alone. Secrets go in .zsql or ZSQL_DS_<KEY>_<FIELD>, never in datasources.yml; zsql deploy strips password from the file if present. See Connecting to a warehouse.

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