This topic describes how to use the CLI to submit a Presto job.
Prerequisites
A Presto cluster is created on the EMR on ACK page of the new E-MapReduce (EMR) console. For more information, see Getting Started.
The AliyunOSSFullAccess and AliyunDLFFullAccess policies are attached to your account. For more information, see Grant permissions to a role.
The password of the admin user of your Presto cluster is configured. For more information, see Configure the administrator password of a Presto cluster.
Procedure
Download trino to a directory of your on-premises machine.
Run the following command on your on-premises machine to modify the permissions on trino:
sudo chmod +x trino
Start Trino.
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 the desired cluster.
On the page that appears, click the Access Links and Ports tab.
On the Access Links and Ports tab, view the URL of Trino.
Run the following command to start Trino:
./trino --server https://trino-cli.c-b95f82c36ee646c5.c1e36180fdf3745c9b7bbc8d3e682****.cn-hangzhou.alicontainer.com --user admin --password --insecure
ImportantReplace
trino
in the URL that you obtained withtrino-cli
. In this example, the URL ishttps://trino.c-b95f82c36ee646c5.c1e36180fdf3745c9b7bbc8d3e682****.cn-hangzhou.alicontainer.com
.Enter the password of the admin user. After you log on to Trino, run the following command to query catalogs:
show catalogs;
For information about SQL statements, see SQL statement syntax.
View the details of a Presto job.
On the Access Links and Ports tab, click the URL of Trino in the Access URL column.
Enter the admin user and its password, and click Log In.
After you log on to Trino, you can view the details of a Presto job.