Use the Trino command-line interface (CLI) to connect to a Presto cluster on E-MapReduce (EMR) on ACK, run SQL queries, and view job details.
Prerequisites
Before you begin, ensure that you have:
A Presto cluster created on the EMR on ACK page of the EMR console. See Getting Started.
The AliyunOSSFullAccess and AliyunDLFFullAccess policies attached to your account. See Grant permissions to a role.
The administrator password configured for your Presto cluster. See Configure the administrator password of a Presto cluster.
Set up the Trino CLI
Download trino to a directory on your on-premises machine.
Make the binary executable:
sudo chmod +x trino
Connect to your Presto cluster
Log on to the EMR console. In the left-side navigation pane, click EMR on ACK.
On the EMR on ACK page, click the name of your cluster.
Click the Access Links and Ports tab, then locate the URL for Trino.
Replace
trinoin the URL withtrino-cli. For example, if the URL shown is:https://trino.c-b95f82c36ee646c5.c1e36180fdf3745c9b7bbc8d3e682****.cn-hangzhou.alicontainer.comUse the following as your server URL:
https://trino-cli.c-b95f82c36ee646c5.c1e36180fdf3745c9b7bbc8d3e682****.cn-hangzhou.alicontainer.comStart the CLI with the modified URL:
./trino --server https://trino-cli.c-b95f82c36ee646c5.c1e36180fdf3745c9b7bbc8d3e682****.cn-hangzhou.alicontainer.com --user admin --password --insecureEnter the admin user password when prompted.
After logging on, run the following command to list available catalogs:
show catalogs;For supported SQL statements, see SQL statement syntax.

View Presto job details
On the Access Links and Ports tab, click the Trino URL in the Access URL column to open the Trino web UI.
Enter the admin user credentials and click Log In. After you log on to Trino, you can view the details of a Presto job.
