4.8. Querying Presto#
Any query has to be submitted to the coordinator for processing on the cluster. Typically you need the following parameters to connect:
- coordinator host name such as
presto.example.com, or IP address
- protocol HTTP, defaults to port 80, or HTTPS, defaults to port 443
- port, if non-default port is configured and exposed, commonly 8080 or 8443
Locate the IP address, protocol, and port of your coordinator, for your connection string, with following the steps:
- Navigate to the CloudFormation console under Management Tools within the Services menu.
- Select your Stack Name and click the associated tab labeled Outputs.
- Note the value for the PrestoCoordinatorURL.
- Using the URL within the VPC, exposes the :doc:</admin/web-interface>.
The coordinator IP address is private and therefore only accessible within the same VPC as the SEP cluster stack. You need to ensure run your client tool from within the VPC or allow connectivity to the VPC.
Now you can use any client or driver supported by Presto to connect and query.
Example: Presto CLI#
You can use the Presto CLI from your local workstation:
- Install the Presto CLI.
- Use the parameters determined in the preceding section.
- Run the CLI with URL and username supplied and activate the password dialog:
presto --server https://presto.example.com --user admin --password
- Once connected you can check for available catalogs with
SHOW CATALOGS, or run any other query.