If you want to use Presto SQL during data development, you can configure a Presto SQL job in the E-MapReduce (EMR) console. This topic describes how to configure a Presto SQL job in the EMR console.
Procedure
- Go to the Data Platform tab.
- Log on to the Alibaba Cloud EMR console by using your Alibaba Cloud account.
- In the top navigation bar, select the region where your cluster resides and select a resource group based on your business requirements.
- Click the Data Platform tab.
- In the Projects section of the page that appears, find the project that you want to edit and click Edit Job in the Actions column.
- Create a Presto SQL job.
- Edit job content.
Configure Presto CLI parameters
By default, Presto queries data tables under the hive catalog and default schema.
You can configure Presto command-line interface (CLI) parameters to specify catalogs
and schemas. You can use one of the following methods to configure Presto CLI parameters
in a Presto SQL job:
- Use environment variables
- Password: If password authentication is enabled for the Presto service, add the
PRESTO_PASSWORD
environment variable to specify a password. - Other parameters: Configure the parameters in the
PRESTO_CLI_PARAMS
environment variable. Example:PRESTO_CLI_PARAMS="--catalog mysql --schema db1 "
.
- Password: If password authentication is enabled for the Presto service, add the
- Use custom variables
- Password: Add a custom variable named
presto.password
to the job to specify a password for Presto authentication. - Other parameters: Add custom variables in the format of
_presto.xxx
to the job. The custom variables are added to the list of Presto CLI parameters. The corresponding option is in the format of--xxx
.The following custom variables are supported:## Basic parameters * _presto.schema <schema> * _presto.catalog <catalog> ## Control and debugging parameters * _presto.trace-token <trace token> * _presto.session <session>... * _presto.source <source> * _presto.resource-estimate <resource-estimate>... * _presto.log-levels-file <log levels file> ## Connection parameters * _presto.server <server> * _presto.http-proxy <http-proxy> * ignore-errors * _presto.socks-proxy <socks-proxy> ## Authentication parameters * _presto.user <user> * _presto.password <password> * _presto.client-info <client-info> * _presto.client-request-timeout <client request timeout> * _presto.client-tags <client tags> * _presto.access-token <access token> * _presto.truststore-password <truststore password> * _presto.truststore-path <truststore path> * _presto.keystore-password <keystore password> * _presto.keystore-path <keystore path> * _presto.extra-credential <extra-credential>... ## High-security parameters * _presto.krb5-config-path <krb5 config path> * _presto.krb5-credential-cache-path <krb5 credential cache path> * _presto.krb5-disable-remote-service-hostname-canonicalization * _presto.krb5-keytab-path <krb5 keytab path> * _presto.krb5-principal <krb5 principal> * _presto.krb5-remote-service-name <krb5 remote service name> * _presto.krb5-service-principal-pattern <krb5 remote service principal pattern>
- Password: Add a custom variable named