A union of curiosity and data science

Knowledgebase and brain dump of a database engineer


Presto Cheat Sheet

Presto : https://prestodb.io/overview.html

 

Quick "Presto" docker setup from FB 2019 Demo: 
https://github.com/prestodb/f8-2019-demo

git clone https://github.com/prestodb/f8-2019-demo
cd f8-2019-demo
docker-compose up
open localhost:8888

 

Presto is a distributed system that runs on a cluster of machines. 
A full installation includes a coordinator and multiple workers.
Queries are submitted from a client such 
as the Presto CLI, to the coordinator. 
The coordinator parses, analyzes and plans the 
query execution, then distributes the 
processing to the workers.



installing presto : 
https://prestodb.io/docs/current/installation/deployment.html

installing the client (cli):
https://prestodb.io/docs/current/installation/cli.html

High level commands for the server:

bin/launcher run   # runs the server in the foreground. 
bin/launcher start # runs the server in the background
bin/launcher status #gives you the current spid and status
bin/launcher restart #restarts the service. 

When connecting to a JDBC SQL Server Database. 

Your connection URL should contain the database name you'd like to connect to. 

connector.name=sqlserver
connection-url=jdbc:sqlserver://localhost:port;databaseName=AdventureWorks;
connection-user=<username>
connection-password=<pass>

Presto schemas do not include sql databases only sql owners/schemas. 

 Launching the presto client:
https://prestodb.io/docs/current/installation/cli.html

bin/presto --server <IP>:<port> --catalog <name of config file catalog> --schema <default schema>

 

Obtain a damn good starter "etc" directory from sundog because presto doesn't come with one but it's needed:

wget http://media.sundog-soft.com/hadoop/presto-hdp-config.tgz

prerequisites:

Unix/Linux/Mac
python >2.4
java 8 "yum install java-1.8.0-openjdk" 


good SQL Server reference for Presto: https://docs.starburstdata.com/latest/connector/sqlserver.html

 

Web Interface info:
https://prestodb.io/docs/current/admin/web-interface.html

 

 Presto Configs from Sundog Media:
http://media.sundog-soft.com/hadoop/presto-hdp-config.tgz

 

presto-hdp-config (1).tgz (734.00 bytes)

#rename the presto jar and make it executable. 
don@Edge:~$ mv presto-cli-0.237.1-executable.jar presto_cli
don@Edge:~$ chmod +x presto_cli

 

 

 

Add comment