Help Center/ Data Lake Insight/ User Guide (ME-Abu Dhabi Region)/ Getting Started/ Developing and Submitting a Spark SQL Job Using the TPC-H Sample Template
Updated on 2022-12-07 GMT+08:00

Developing and Submitting a Spark SQL Job Using the TPC-H Sample Template

To facilitate SQL operations, DLI allows you to customize query templates or save the SQL statements in use as templates. After templates are saved, you do not need to write SQL statements. You can directly perform the SQL operations using the templates.

The current system provides various standard TPC-H query statement templates. You can select a template as needed. This example shows how to use a TPC-H template to develop and submit a Spark SQL job.

Step 1: Logging in to the Cloud

Step 2: Logging In to the DLI Management Console

Step 3: Execute the TPC-H Sample Template and View the Result

For details about the templates, see SQL Template Management.

Step 1: Logging in to the Cloud

  1. Open the DLI homepage.
  2. On the login page, enter the username and password, and click Log In.

Step 2: Logging In to the DLI Management Console

  1. .
  2. The DLI management console page is displayed.

    You need to perform authorization when accessing the DLI management console for the first time. For details, see Service Authorization.

Step 3: Execute the TPC-H Sample Template and View the Result

  1. On the DLI management console, choose Job Templates > SQL Templates, and click the Sample Templates tab. Locate the Q1_Price_summary_report_query template under tpchQuery, and click Execute in the Operation column. The SQL Editor page is displayed.

  2. In the upper part of the editing window, set Engine to spark, Queues to default, and Databases to default, and click Execute.

  3. View the query result in the View Result tab in the lower part of the SQL Editor page.

This example uses the default queue and database preset in the system as an example. You can also run query statements on a self-created queue and database.

For details about how to create a queue, see Creating a Queue. For details about how to create a database, see Creating a Database.