This topic describes how to submit a Presto job using the command-line interface (CLI).
Prerequisites
-
You have created a Presto cluster in the E-MapReduce on ACK console. For more information, see Quick start.
-
You have the
AliyunOSSFullAccessandAliyunDLFFullAccesspermissions. For more information, see Role authorization. -
You have configured the password for the admin user of the Presto cluster. For more information, see Configure the cluster management password.
Procedure
-
Download the trino executable file to a local directory.
-
Run this command to modify the file permissions:
sudo chmod +x trino -
Start the Trino CLI.
-
Log on to the EMR on ACK console.
-
On the EMR on ACK page, click the name of the target cluster.
-
Click the Access Links and Ports tab.
-
On the Access Links and Ports page, obtain the link for the Trino web UI.
-
On your local machine, run the following command to start the Trino CLI:
./trino --server https://trino-cli.c-b95f82c36ee646c5.c1e36180fdf3745c9b7bbc8d3e682****.cn-hangzhou.alicontainer.com --user admin --password --insecureImportantThe Trino web UI link from the previous step is
https://trino.c-b95f82c36ee646c5.c1e36180fdf3745c9b7bbc8d3e682****.cn-hangzhou.alicontainer.com. Replacetrinoin the link withtrino-cli.When prompted, enter the password configured for the admin user. After you log on, you can run the following command to query catalogs.
show catalogs;Georges-MacBook-Pro:taihaoJobs georgechen$ ./trino --server https://trino-cli.c-b95f82c36ee646c5.c1e36180fdf3745c9b7bxxx.cn-hangzhou.alicontainer.com --user admin --password --insecure Password: trino> show catalogs; Catalog --------- hive system tpcds (3 rows) Query 20210805_082129_00031_bufux, FINISHED, 2 nodes Splits: 36 total, 36 done (100.00%) 0.24 [0 rows, 0B] [0 rows/s, 0B/s] trino>For more information about SQL statement syntax, see SQL statement syntax.
-
-
View job details.
-
On the Access Links and Ports page, click the link for the Trino web UI.
-
Enter the username
adminand its password, and then click Log In.After you log on, you are redirected to the Trino web UI, where you can view job execution details and monitor queries. The top of the page displays cluster metrics, such as QUEUED QUERIES, RUNNABLE DRIVERS, and RESERVED MEMORY. In the QUERY DETAILS section, you can search for and filter query records by user, source, query ID, or query status. This section also displays detailed information for each query, including the SQL statement, execution status, and duration.
-