Presto/Trino REST API v1 can be used as a data source with SQL-compatible database connector. In this way it is possible to use as a live data source PrestoDB, TrinoDB and Metriql.
Report queries are generated and executed in a real time; this means that your Presto/Trino engine should respond quick enough as execution time is limited by 2 minutes.
Connection String example (NReco.PrestoAdo .NET driver):
Host=hostName;Port=8080;UseSsl=false;Schema=defaultSchema;Catalog=catalog;User=user;Password=password;
TrinoHeaders |
Whether to use "X-Trino-" prefix in HTTP request headers (boolean; false by default - means that 'legacy' "X-Presto-" prefix is used).
|
---|---|
Host | The DNS host name or IP address of the presto/trino coordinator with REST API v1. |
Port | The web interface port of the presto/trino coordinator (8080 by default). |
UseSsl | Specifies that the connections made to the presto coordinator and possibly worker nodes should use SSL. |
Catalog | The catalog to use for interaction with presto/trino. |
Schema | The schema to connect to in presto/trino ('default' by default). |
User | The name of the user connecting to presto. |
Password | The password to use in HTTP basic auth with the presto server. |
CheckInterval | The amount of time in milliseconds that the client will wait in between checks for new data from presto. The minimum interval is 50ms and the maximum interval is 5000ms (800ms by default). |
IgnoreSslErrors | Whether to ignore SSL errors produced by connecting to presto over an SSL connection that may be using expired or untrusted certificates (boolean; false by default). |
ClientRequestTimeout | The timeout in seconds for how long to wait for a query to finish (no timeout by default). |
By default SeekTable Presto driver uses "X-Presto-" prefix in HTTP headers. It can be used to connect to Trino in one of these ways:
TrinoHeaders=1
in a connection string to use "X-Trino-" headers by SeekTable Presto driverprotocol.v1.alternate-header-name=Presto
SeekTable can connect to Metriql via Presto driver. Sample connection string for Metriql demo server:
Host=demo.metriql.com;Port=443;UseSsl=true;Schema=public;Catalog=metriql;
However, SeekTable's SQL connector does not aware about Metriql models specifics and "Infer dimensions and measures by dataset" option handles Metriql measures as usual table columns (which may cause syntax errors on Metriql side). How to fix that: