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. Go to the DataStudio page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region in which the workspace in which you want to create a MySQL node resides. Find the workspace and click DataStudio in the Actions column.
  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 Data access control.
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