Presto SQL job configuration
Updated at:
You can configure a Presto SQL job in Alibaba Cloud E-MapReduce to use Presto SQL in your data workflow.
Procedure
-
Go to the Projects page in Data Platform.
-
Log in to the E-MapReduce console with your Alibaba Cloud account.
-
In the top navigation bar, select the region and resource group.
-
Click the Data Development tab.
-
-
In the row of the project you want to edit, click Edit Job.
- Create a Presto SQL job.
- On the left side of the page, right-click the target folder and select Create Job.
- In the Create Job dialog box, enter a Name and Description. From the Job Type drop-down list, select Presto SQL.
This will create a Presto SQL job. Jobs of this type are submitted using the following command:
presto <options> -f {SQL_SCRIPT}Note TheSQL_SCRIPTfile stores the SQL statements you enter in the job editor. - Click OK.
- Edit the job content.
- In the Content section, enter the SQL statements for the job.
Example:
SELECT * from table1; - Click Save.
- In the Content section, enter the SQL statements for the job.
Presto CLI parameters
By default, Presto queries tables in catalog=hive and schema=default. To query tables in a different catalog and schema, set Presto CLI parameters. You can set Presto CLI parameters for a Presto SQL job in two ways:
- Use an environment variable
- Set the password: If password authentication is enabled for the Presto service, add an environment variable named
PRESTO_PASSWORDto provide the password. - Set other parameters: Add parameters to an environment variable named
PRESTO_CLI_PARAMS, for example,PRESTO_CLI_PARAMS="--catalog mysql --schema db1 ".
- Set the password: If password authentication is enabled for the Presto service, add an environment variable named
- Use a custom variable
- Set password: To set the password for Presto authentication, add a custom variable named
presto.passwordto the job. - Set other parameters: The system appends any custom variable in the format
_presto.xxxto the Presto CLI parameter list as the--xxxoption.The following custom variables are supported.## Basic parameters * _presto.schema <schema> * _presto.catalog <catalog> ## Control/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>
- Set password: To set the password for Presto authentication, add a custom variable named
Is this page helpful?