Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Trino Compatibility

SQE includes a Trino-compatible HTTP endpoint that allows existing Trino clients (JDBC drivers, DBeaver, CLI tools) to connect without modification.

Enabling

The Trino HTTP endpoint is enabled by default on port 8080. Set port to 0 to disable:

[coordinator]
trino_http_port = 8080    # 0 to disable

Endpoints

EndpointMethodDescription
/v1/infoGETNode info (version, uptime, coordinator status)
/v1/info/stateGETPlain text: ACTIVE or STARTING
/v1/statementPOSTSubmit a SQL query
/v1/statement/{id}/{token}GETFetch paginated results
/v1/statement/{id}DELETECancel a running query

Authentication

The Trino endpoint supports two authentication methods:

Bearer Token

Pass an existing access token directly:

curl -H "Authorization: Bearer eyJhbG..." \
     -H "X-Trino-User: alice" \
     -d "SELECT 1" \
     http://localhost:8080/v1/statement

Basic Auth

Username and password are exchanged for a token via the configured OIDC/OAuth2 backend:

curl -u alice:password \
     -d "SELECT 1" \
     http://localhost:8080/v1/statement

Client Headers

SQE respects standard Trino client headers:

HeaderPurpose
X-Trino-UserOverride username (used with Bearer auth)
X-Trino-CatalogSet default catalog for the session
X-Trino-SchemaSet default schema for the session
X-Trino-SourceClient identifier (logged for audit)

Result Pagination

Query results are paginated. The initial response includes a nextUri field. Follow nextUri links to retrieve subsequent pages:

{
  "id": "query-uuid",
  "stats": { "state": "FINISHED" },
  "columns": [{"name": "result", "type": "integer"}],
  "data": [[1]],
  "nextUri": "http://localhost:8080/v1/statement/query-uuid/1"
}

When nextUri is absent, all results have been consumed.

Using with the CLI

sqe-cli --protocol http --host localhost --port 8080 --user alice

Connecting External Tools

DBeaver

  1. Create a new Trino connection
  2. Host: localhost, Port: 8080
  3. Authentication: Username/Password
  4. Driver properties: no special settings needed

JDBC (Java)

String url = "jdbc:trino://localhost:8080";
Properties props = new Properties();
props.setProperty("user", "alice");
props.setProperty("password", "secret");
Connection conn = DriverManager.getConnection(url, props);

Limitations

  • The Trino endpoint returns results as JSON (Trino wire format), not Arrow. For maximum performance, use Flight SQL.
  • Prepared statements are not supported via the Trino protocol.
  • Transaction control (START TRANSACTION, COMMIT) is not supported — queries execute in auto-commit mode.
  • Type mapping covers common types; complex nested types may differ from native Trino behavior.

Flight SQL vs Trino HTTP

AspectFlight SQL (default)Trino HTTP
Port500518080
Wire formatArrow IPC (binary, columnar)JSON
PerformanceHigh (zero-copy)Lower (serialization overhead)
Client supportADBC, JDBC (Flight SQL), dbtTrino JDBC, DBeaver, Tableau
PaginationArrow Flight streamingnextUri polling

Use Flight SQL for performance-sensitive workloads. Use Trino HTTP for compatibility with existing tools.