Configuring YARN queue for SQL jobs

You can configure the YARN application queue with a custom value for a SQL job using the Streaming SQL Console.

With YARN queues, you can deploy applications to a specific subset of nodes with separate or limited resources, according to configuration. This enables you to have a separate execution environment with limited resources to experiment with new applications without impacting any production operation.

You can customize the YARN application queue only for SQL jobs that run in production mode. In production mode, the job runs in an isolated cluster. The default YARN queue configured in Cloudera Manager is not changed; only the job that you run in production mode uses the queue you specify in the SQL editor.

The default value of the YARN application queue can be configured in Cloudera Manager. After accessing the SQL Stream Builder service on your cluster, open the service configurations and search for YARN application queue to change the default value. When you run a job in production mode, the queue you set with a SET statement in the SQL editor overrides that default for that job only.

Configure the YARN queue for a production SQL job

To set the YARN application queue for a SQL job, use the following steps:

  1. In the SQL Editor, click Job Settings.
  2. Under Execution Mode, select PROD - Job runs in isolated Cluster.
  3. In the SQL Editor, remove any set 'execution.target' = 'yarn-per-job'; line from the script. Do not add that statement when production mode is set in Job Settings.
  4. In the same script, add a SET statement for the queue and your SQL statement, then click Execute. For example:
    set 'yarn.application.queue' = 'my-queue';
    select * from datagen_table_1648801198

For more information about production mode, see the Executing SQL jobs in production mode documentation.