6.6. Querying Presto

The Presto Coordinator pod is reachable via the Kubernetes Service. By default, the service is only available within the Kubernetes Cluster at http://presto-coordinator-service-CLUSTER_NAME_UUID.NAMESPACE.svc.cluster.local:8080, where NAMESPACE is the Kubernetes namespace where the given Presto cluster is deployed and CLUSTER_NAME_UUID is the unique service name.

You can adjust the endpoint name using service.name parameter. Please refer to Service properties for more information.


1. Launch Presto CLI pod in interactive mode
In your console, type the following command to launch Presto CLI pod. Your cursor will skip to the next line, prefixed with a Presto prompt: presto >.
kubectl run presto-cli --rm -i --tty --image IMAGE_REPOSITORY/starburstdata/presto -- presto-cli \
 --server http://presto-coordinator-service-CLUSTER_NAME_UUID.NAMESPACE.svc.cluster.local:8080

where IMAGE_REPOSITORY is your Docker registry address (if present).

2. Show Catalogs and Schemas
View your catalogs and schemas by running the following commands. Note: replace tpch with your desired catalog.
show catalogs;
show schemas in tpch;
3. Write a Query
Type your SQL query into the Presto CLI. For reference, view the SQL SELECT statement below.
select * from tpch.sf1.nation;
4. Run Query
Press <Enter> to execute your query. Query progress is displayed live in the Presto CLI console.
5. View Query Results
When Presto finishes processing the query, you will be presented with the results of your query within the Presto CLI console.

ODBC & JDBC Drivers

The open source Presto JDBC driver can be used with Presto on AWS. It can be downloaded from Starburst’s download page. Additionally, Starburst provides Enterprise ODBC and JDBC drivers, available for Windows, Mac, and Linux platforms for its Enterprise customers. Please refer to the following link for both.