Skip to content

Trino connector

Trino is reached over its REST client protocol: Dosi posts to /v1/statement and follows nextUri until the query finishes, with a 50 → 200 ms poll backoff. An HTTP 503 means "busy, ask again" in that protocol and is retried for about ten seconds before surfacing as a timeout.

There is no connection pool — one keep-alive HTTP agent, with a 10 s connect and 60 s request timeout. Gated by exec-http.

Connection profile

datasources:
  trino:
    type: trino
    host: trino.internal
    port: 8080
    username: dosi          # sent as X-Trino-User
    catalog: hive           # session catalog for compiled schema.table names
    schema: sales           # optional session schema

uri: http://trino.internal:8080 replaces host:/port:.

Parameters

Key Type Required Default Notes
type string yes trino
uri string yes* *Or host:. The coordinator endpoint including scheme.
host string yes* *Or uri:. Synthesized as http://<host>:<port> — always http, so an HTTPS coordinator needs an explicit uri:.
port int no 8080 Only used when the endpoint is synthesized from host:.
username string no osi Sent as X-Trino-User. The default is a fallback, not a recommendation — set it.
catalog string no Session catalog, sent as X-Trino-Catalog.
schema string no Session schema, sent as X-Trino-Schema.
database string no Alternative spelling: catalog or catalog.schema in one key. When both are given, database: wins.
default bool no false See connection profiles.

Parsed and ignored on this connector: passwordno authentication header is sent at all, so a coordinator that requires password or JWT auth is not reachable through this connector yet — plus sslmode, sslrootcert, arrow_flight_port, account, role, warehouse, compat_mode.

HTTPS needs a TLS-capable build

Like ClickHouse, the exec-http feature alone links an HTTP client without TLS. Published binaries ship exec-all and are fine; a hand-built binary needs --features exec-all.

Limitations

  • No 3-argument DATEDIFF. Trino spells it date_diff, so a metric written with the unit-first DATEDIFF form is refused at compile time for this dialect.
  • No authentication. See the ignored-keys note above.
  • No Arrow path. Trino's spooled protocol is JSON-based; its Arrow support is not upstream yet, so results arrive row-oriented.

Timestamps are normalized for you: Trino pads them to the declared precision and appends a zone name, which the decoder canonicalizes to the same zone-less form every other engine produces.

Verify the connection

$ dosi query --model model.yaml \
    --metrics revenue --group-by orders.status --execute --connection trino

Troubleshooting

Message Cause and fix
connection "x" (trino) is missing required field "uri" Give uri: or host:.
trino rejected SQL (<errorName>): <message> The coordinator refused the statement; a missing catalog or schema shows up here.
trino kept responding 503 (busy) for over 10s The cluster is saturated or still starting; retry when it has capacity.
bad trino response: <e> The endpoint is not a Trino coordinator, or a proxy rewrote the response.
HTTP 401: <body> The coordinator requires authentication, which this connector does not send.
cannot reach server: <e> Host, port or network.

Reference