Sign inSign up

vastdataorg/trino-vast

By vastdataorg

•Updated about 1 month ago

Vast Trino Server & Connector images with default configuration to query VastDB / Vast-S3 DataStore.

Image
2

10K+

vastdataorg/trino-vast repository overview

⁠VAST DATA - Trino Docker Image with VastDB connector

⁠Introduction

VAST DATA provides Docker image that includes the Trino server and the VAST Connector, with a default configuration, in order to query VastDB / Vast-S3 DataStore

The Docker image is published to Docker-Hub and can be used with the Docker runtime, among several others.

⁠Running Trino Vast docker
  • To run Trino in Docker, you must have the Docker engine installed on your machine. You can download Docker from the Docker website, or use the packaging system of your operating systems.

  • Use the docker command to create a container from the vastdataorg/trino-vast:TAG image.

  • Run it in the background, and map the default Trino port, which is 8080, from inside the container to expose 8080 on your workstation.

Without specifying the container image tag, it defaults to latest, but a number of any released Trino image by VAST can be used, by specifying a TAG.

vastdataorg/trino-vast:TAG
  • To make Trino connect and query the VAST cluster through the vast catalog, the user needs to pass a few parameters:
    • endpoint : VAST single VIP or VIP-pool DNS name → Network Access through Virtual IPs⁠
    • access_key_id : S3 Access → Managing S3 User Access⁠
    • secret_access_key : S3 Secret
    • data_endpoints : List of all desired VIP's within the same VIP-pool, in order to distribute the query acceleration to multiple CNODES. (Specify multiple IP's with commas; e.g: http://vast-vip1,http://vast-vip2 ..)

To run the container, make sure you have vast.properties file configured with the above parameters and mounted under /etc/trino/catalog/vast.properties inside the container.

Starting the container with simple Docker run command

docker run -d \
-p 8080:8080 \
-v ./vast.properties:/etc/trino/catalog/vast.properties \
--name trino-vast \
vastdataorg/trino-vast

NOTE :

  • The image already contains a default configuration to get started with, and TPC-DS catalog to allow you to explore Trino with VAST DATA. You can mount use your custom configuration files under /etc/trino/ directory, inside the container.

If you mount your custom configuration files under /etc/trino/ directory, inside the container, your configuration will be used instead of the default in the image.

  • This is the default structure of the configuration files inisde the image:
etc
└── trino
    ├── catalog
    │   ├── tpcds.properties
    │   └── vast.properties
    ├── config.properties
    ├── jvm.config
    ├── log.properties
    └── node.properties

⁠Checking health

Run docker ps to see all the containers running in the background.

% docker ps
CONTAINER ID   IMAGE      COMMAND                  CREATED          STATUS                    PORTS                                       NAMES
58431ae48c18   trino-vast   "/bin/sh -c '    ech…"   40 seconds ago   Up 39 seconds (healthy)   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp   trino-vast

  • When Trino is still starting, it shows (health: starting), and (healthy) when it’s ready.
⁠Starting the Session and Executing queries on VastDB / Vast-S3 DataStore

The image includes the Trino command-line interface (CLI) client, trino. Execute it in the existing container to connect to the Trino server running inside it. After starting the client, type and execute a query on a VAST catalog:

⁠Access trino-cli in a container
$ docker exec -it trino-vast trino
⁠Check you have the vast catalog schema
trino> show catalogs;
 Catalog
---------
 system
 tpcds
 vast
(3 rows)

Query 20240321_090110_00000_pkbe8, FINISHED, 1 node
Splits: 35 total, 35 done (100.00%)
1.01 [0 rows, 0B] [0 rows/s, 0B/s]
⁠List existing Databases & schemas
trino> show schemas in vast;
Schema
------------------------------------------------------

 information_schema
 system_schema
 example-vastdb-table1/schema1
 example-vastdb-table1/schema2
 example-vastdb-table2/schema1
 vast-big-catalog-bucket/vast_big_catalog_schema
(15 rows)

Query 20240321_090125_00002_pkbe8, FINISHED, 1 node
Splits: 35 total, 35 done (100.00%)
0.92 [15 rows, 664B] [16 rows/s, 721B/s]
⁠Show existing tables in a specific Database & schema
trino> show tables in vast."example-vastdb-table1/schema1";
         Table
------------------------
 call_center
 catalog_page
 catalog_returns
 catalog_sales
 customer
 customer_address
 ...
(25 rows)

Query 20240321_102306_00006_t5kec, FINISHED, 1 node
Splits: 35 total, 35 done (100.00%)
0.47 [25 rows, 1.43KB] [53 rows/s, 3.07KB/s]
⁠Query a specific table
trino> select * from vast."example-vastdb-table1/schema1".customer limit 1;
 c_customer_sk |  c_customer_id   | c_current_cdemo_sk | c_current_hdemo_sk | c_current_addr_sk | c_first_shipto_date_sk | c_first_sales_date_sk |
---------------+------------------+--------------------+--------------------+-------------------+------------------------+-----------------------+--------------+--------------->
       4720528 | AAAAAAAAAJHAIEAA |             422090 |               3182 |            229074 |                2452620 |               2452590 |

Alternatively, you can use the Trino CLI installed directly on your workstation.

You can also connect with any other client application using the JDBC driver. https://trino.io/docs/current/client/jdbc.html⁠

⁠vast.properties Configuration File
  • VAST DATA provides a built-in connector to connect and query VastDB.
    • The connector is based on /etc/trino/catalog/vast.properties file which is already included inside the image.
    • If you wish to change it's default parameter values, here is an example of vast.properties file:
connector.name=vast
endpoint={VAST_ENDPOINT}
region=us-east-1
access_key_id={VAST_ACCESS_KEY_ID}
secret_access_key={VAST_SECRET_ACCESS_KEY}

# Preliminary tuning parameters
num_of_splits=64
num_of_subsplits=10
vast.http-client.request-timeout=60m
vast.http-client.idle-timeout=60m

data_endpoints={VAST_DATA_ENDPOINTS}

vast.http-client.request-timeout=100h
vast.http-client.idle-timeout=290s
vast.http-client.max-connections=100
vast.http-client.max-connections-per-server=50
⁠Configuring Trino with Hive Catalog & interracting with Vast S3 data-store
⁠hive.properties file example
connector.name=hive
hive.metastore.uri=thrift://localhost:9083
hive.s3.path-style-access=true
hive.s3.endpoint=http://172.30.189.1
hive.s3.aws-access-key=O786I9Q2T....
hive.s3.aws-secret-key=PfFF/ndiuptO09l2JL....
hive.s3.ssl.enabled=false
hive.s3.streaming.enabled=True
hive.max-partitions-per-writers=1000
#hive.s3select-pushdown.enabled=true
hive.s3.socket-timeout=2m
hive.s3.streaming.part-size=16MB
hive.parquet.use-column-names=true
hive.orc.use-column-names=true
hive.allow-drop-table=true
hive.allow-rename-table=true
hive.allow-register-partition-procedure=true
hive.allow-add-column=true
hive.allow-drop-column=true
hive.allow-rename-column=true
hive.allow-drop-table=true
hive.non-managed-table-writes-enabled=true
hive.non-managed-table-creates-enabled=true
hive.temporary-staging-directory-path=/var/tmp/
hive.recursive-directories = true
hive.compression-codec=SNAPPY
⁠Running the docker and passing hive.properties file to query VAST S3:
  • In order to pass hive.properties in the docker run, mount it under /etc/trino/catalog/ inside the container, and start the container.
etc
└── trino
    ├── catalog
    │   ├── hive.properties
    │   ├── tpcds.properties
    │   └── vast.properties
    ├── config.properties
    ├── jvm.config
    ├── log.properties
    └── node.properties
⁠Query Trino Hive catalog & interract with Vast S3 data-store
trino> show schemas in hive;
       Schema
--------------------
 default
 information_schema
⁠Create schema/table & map to external location using Vast S3-bucket path
CREATE SCHEMA IF NOT EXISTS hive.customer_table WITH (
   location = 's3a://customer-parquet/'
);
⁠Cleaning up

You can stop and start the container, using the docker stop trino-vast and docker start trino-vast commands. To fully remove the stopped container, run docker rm tino-vast.

Tag summary

Content type

Image

Digest

sha256:dcf8c2934…

Size

3.4 GB

Last updated

over 2 years ago

docker pull vastdataorg/trino-vast