All Products
Search
Document Center

DataWorks:Improve the efficiency of code development in the code editor

Last Updated:Aug 15, 2023

DataWorks provides features such as permission verification, automatic code completion, and built-in code templates. These features quickly check whether you have the required permissions on a table, allow you to apply for the required permissions with a few clicks, and auto-complete code based on the keyword, table fields, or built-in code template that you select. This way, you can develop code for a node in an efficient manner. This topic describes how these features help improve the efficiency of code development in the code editor.

Limits

These features can help improve the efficiency of code development only for ODPS-based nodes, including ODPS SQL nodes and ODPS Script nodes.

Go to the code editor of a node

  1. Log on to the DataWorks console. In the left-side navigation pane, choose Data Modeling and Development > DataStudio. On the page that appears, select the desired workspace from the drop-down list and click Go to DataStudio.

  2. Go to the code editor of a node.

    In the Scheduled Workflow pane of the DataStudio page, double-click the desired node to go to the code editor of the node. You can develop code for the node in the code editor.

Features that improve the efficiency of code development

In the code editor, DataWorks provides features such as permission verification, automatic code completion, and built-in code templates to help you develop code for a node in an efficient manner. The following table describes the features.

Feature

Description

Permission verification

When you move the pointer over the name of the table that you want to query in the SELECT statement and you do not have the permissions to query the table or the fields in the table, DataWorks displays a message and provides you with the link to go to Security Center to request the permissions on the table.

Note
  • The feature checks whether you have the permissions to query tables only in the production environment. You are prompted to request permissions only when you do not have the permissions to query the current table.

  • For more information about how to request permissions on a table, see Manage permissions on MaxCompute.

Permission verification

Automatic code completion

  • Complete code based on a keyword

    DataWorks recommends keywords that contain the letters you entered. After you select a recommended keyword, DataWorks auto-completes the code. Automatic code completion

  • Complete code used to query fields

    When you move the pointer over the name of a table in the code, DataWorks displays the fields that you can query in the table. After you select the fields that you want to query, DataWorks auto-completes the code used to query the fields in the original code. You can move the pointer over the name of a field in the table to view the information about the field. Complete code used to query fields

Built-in code templates

DataWorks provides built-in code templates for common statements, such as CREATE_TABLE, SELECT_CASE, SELECT_ALL, and INSERT_OVERWRITE_TABLE. You can select a built-in code template to generate relevant statements for a node.

Note

By default, TABLENAME is selected in the generated statement. You can replace TABLENAME with the name of the table that you want to query.

Built-in code templates