Run Presto on your local machine
$ docker pull kos59125/local-presto
Create your own properties file. See Connectors on Presto Documentation for your help.
For example, if you would like to connect MySQL hosted on db.example.com, you create mysql.properties
as the following:
connector.name=mysql
connection-url=jdbc:mysql://db.example.com:3306
connection-user=dbuser
connection-password=dbpassword
You must mount your properties file onto /opt/presto/etc/catalog
at startup.
Example:
$ docker run -v /path/to/mysql.properties:/opt/presto/etc/catalog/mysql.properties:ro -it kos59125/local-presto
The entrypoint shell script of Presto is same as the Presto CLI.
You can specify options of Presto CLI like --catalog
and --output-format
.
Examples:
$ docker run -v ... -it kos59125/local-presto --catalog mysql --schema mydb
$ docker run -v ... kos59125/local-presto --execute "SELECT * FROM mysql.mydb.table LIMIT 100" --output-format CSV_HEADER >out.csv