Updated on 2022-02-22 GMT+08:00

Creating a Script

DLF allows you to edit, debug, and run scripts online. You must add a script before developing it.

(Optional) Creating a Directory

If a directory exists, you do not need to create one.

  1. Log in to the DLF console.
  2. In the navigation tree of the Data Development console, choose Data Development > Develop Script.
  3. In the directory list, right-click a directory and choose Create Directory from the shortcut menu.
  4. In the displayed dialog box, configure directory parameters. Table 1 describes the directory parameters.

    Table 1 Script directory parameters

    Parameter

    Description

    Directory Name

    Name of the script directory. Must consist of 1 to 32 characters and contain only letters, digits, underscores (_), and hyphens (-).

    Select Directory

    Parent directory of the script directory. The parent directory is the root directory by default.

  5. Click OK.

Creating a Script

Currently, you can create the following types of scripts in DLF:

  • DLI SQL
  • Hive SQL
  • DWS SQL
  • Spark SQL
  • Flink SQL
  • RDS SQL
  • PRESTO SQL script, which is supported only in the AP-Singapore region. After you use the PRESTO SQL script to run the select query statement, the query result is automatically dumped to the s3a://dlf-log-{project_id}/temp directory of the OBS bucket.
  • Shell

Prerequisites

The quantity of scripts is less than the maximum quota (1,000).

Procedure

  1. In the navigation tree of the Data Development console, choose Data Development > Develop Script.
  2. Create a script using either of the following methods:

    Method 1: In the area on the right, click Create SQL Script/Create Shell Script.

    Figure 1 Creating an SQL script (method 1)
    Figure 2 Creating a shell script (method 1)

    Method 2: In the directory list, right-click a directory and choose Create Script from the shortcut menu.

    Figure 3 Creating a script (method 2)

  3. Go to the script development page. For details, see Developing an SQL Script and Developing a Shell Script.