Creating a Script

DataArts Factory allows you to edit, debug, and run scripts online. You must create a script before developing it.

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

  • DLI SQL

  • Hive SQL

  • DWS SQL

  • Spark SQL

  • Flink SQL

  • RDS SQL

  • Presto SQL

  • Shell

  • Python

Prerequisites

You have completed operations in Creating a Data Connection and Creating a Database.

Procedure

Creating a Directory (If a directory already exists, you do not need to create one.)

  1. Log in to the DataArts Studio console. Locate an instance and click Access. On the displayed page, locate a workspace and click DataArts Factory.

    **Figure 1** DataArts Factory

    Figure 1 DataArts Factory

  2. In the left navigation pane of DataArts Factory, 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. The name must contain 1 to 64 characters, including only letters, numbers, 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

  1. In the left navigation pane of DataArts Factory, choose Data Development > Develop Script.

  2. Create a script using either of the following methods:

    Method 1: In the right pane, click a script type to start creating a script.

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

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

    Note

    A maximum of five temporary scripts of the same type can be created. If you close a temporary script without saving it and create a script of the same type, the closed temporary script will be opened again.