Trino Docker#

Trino is a high performance, distributed SQL query engine for big data.

Docker#

docker run --name trino -d -p 8080:8080 trinodb/trino

http://localhost:8080/

Executing queries#

docker exec -it trino trino
trino> select count(*) from tpch.sf1.nation;

Once you are done with your exploration, enter the quit command.

Configuring Trino#

docker run --name trino -d -p 8080:8080 --volume $PWD/etc:/etc/trino trinodb/trino

To avoid having to create catalog files and mount them in the container, you can enable dynamic catalog management by setting the CATALOG_MANAGEMENT environmental variable to dynamic.

docker run --name trino -d -p 8080:8080 -e CATALOG_MANAGEMENT=dynamic trinodb/trino

Connectors#

MySQL#

Configuration#

vi /etc/trino/catalog/example.properties

connector.name=mysql
connection-url=jdbc:mysql://example.net:3306
connection-user=root
connection-password=secret

Querying MySQL#

SHOW SCHEMAS FROM example;
SHOW TABLES FROM example.web;
DESCRIBE example.web.clicks;
SHOW COLUMNS FROM example.web.clicks;
SELECT * FROM example.web.clicks;

Runtime Environment#

References#