Trino

On this page:

Quick Start

Run a single node Trino cluster with a Tabular credential:

docker run \
  --name tabular-trino \
  -p 8080:8080 \
  -e TABULAR_CREDENTIAL=<credential> \
  tabulario/trino:latest

In a separate shell, drop into a SQL command line:

docker exec -i -t $(docker ps -a | grep tabular-trino |  awk '{print $1}') trino --catalog sandbox
trino> show schemas;
Schema
--------------------
 default
 examples
 information_schema
 system
(4 rows)
    
trino> use default;

trino:default> create table events(name varchar, type varchar, ts timestamp(6));    

Standalone Deployment

A standalone deployment requires downloading Trino artifacts and setting up a cluster manually with the following steps.

Server packages and Installation

Download the server packages and follow the deployment instructions to configure a Trino cluster.

Connector Properties

Trino connector configuration can be used if you’re deploying from a standalone tarball.

Note: if you are using docker images, this configuration is already included.

# etc/catalog/tabular.properties 
connector.name=iceberg
iceberg.catalog.type=REST
hive.s3.endpoint=https://s3.${ENV:AWS_REGION}.amazonaws.com

iceberg.file-format=PARQUET

# REST Configs
iceberg.rest-catalog.uri=https://api.tabular.io/ws
iceberg.rest-catalog.warehouse=sandbox  # Name of your Tabular warehouse
iceberg.rest-catalog.security=OAUTH2
iceberg.rest-catalog.oauth2.credential=${ENV:TABULAR_CREDENTIAL}

# Set Tabular signer
hive.s3.signer-class=io.tabular.client.aws.s3.TabularS3V4SdkV1RestSigner

Environment Variables

The following environment variables need to be set on both the coordinator and worker nodes:

export AWS_REGION=<region_id>
export TABULAR_CREDENTIAL=<credential>
# AWS Credentials are not required, but need to be set
export AWS_ACCESS_KEY_ID=anonymous
export AWS_SECRET_ACCESS_KEY=anonymous

Tabular Runtime for Trino

Copy the Tabular Trino runtime jar from the Download Resources page into the plugins/iceberg directory in your Trino deployment directory.

Docker

The easiest way to get up and running with Trino is to use our provided docker image which bundles Trino and the Tabular connector.

Requirements

Run the docker image

The following command starts up a docker container running trino with your warehouse catalog available as tabular.

docker run \
--name tabular-trino \
-p 8080:8080 \
-e TABULAR_CREDENTIAL=<your-tabular-credential> \
tabulario/trino:latest

To connect to Trino, you can use either the JDBC driver or the CLI. You can find instructions on using either in the Clients section of the Trino documentation.

You can verify that Trino has access to your warehouse by connecting to the trino server and running SHOW CATALOGS.

Kubernetes (via Helm)

Requirements

Details

You can use the following values.yaml configuration to deploy the Trino helm chart.

The example below configures 1 coordinator node and 2 worker nodes. You will need to add your Tabular Access Credential to the example below before running helm install.

Additional Trino helm chart configuration can be found here.

# values.yaml
image:
  repository: tabulario/trino
  pullPolicy: Always
  tag: latest

env:
  - name: TABULAR_CREDENTIAL
    value: <credential>
  - name: AWS_REGION
    value: us-east-1

additionalCatalogs:
  'sandbox': |  # name of the catalog in Trino
    connector.name=iceberg
    iceberg.catalog.type=REST
    hive.s3.endpoint=https://s3.${ENV:AWS_REGION}.amazonaws.com

    iceberg.file-format=PARQUET

    # REST Configs
    iceberg.rest-catalog.uri=https://api.tabular.io/ws
    iceberg.rest-catalog.warehouse=sandbox  # Name of your Tabular warehouse
    iceberg.rest-catalog.security=OAUTH2
    iceberg.rest-catalog.session=USER
    iceberg.rest-catalog.oauth2.credential=${ENV:TABULAR_CREDENTIAL}

    # Set Tabular signer
    hive.s3.signer-class=io.tabular.client.aws.s3.TabularS3V4SdkV1RestSigner

To install the chart, simply use the following:

helm repo add trino https://trinodb.github.io/charts
helm install tabular-trino-cluster trino/trino -f values.yaml