All Products
Search
Document Center

DataWorks:View the code structure

Last Updated:Aug 15, 2023

DataWorks allows you to view the SQL code structure parsed from the code of a node. The code structure helps you troubleshoot issues and view and modify the code.

View the code structure of a node

  1. Go to the DataStudio page.

    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 configuration tab of a node.

    You can search for a node in the Scheduled Workflow or Manually Triggered Workflows pane. After that, double-click the node to go to the configuration tab of the node. Configuration tab of a node

  3. View the code structure of the node.

    In the right-side navigation pane, click Code Structure to view the code structure of the node in classic mode or outline mode. Code Structure tab

    • Classic mode: The SQL code is run based on the organized SQL operators to obtain the final result. The classic mode displays the SQL operators involved in the structure and the associations between the operators.

      You can view the type of an SQL operator by moving the pointer over this operator. The following list describes the common SQL operators used in the code structure.

      • Source table: the table to be queried. Source table

      • Filter: the condition for filtering the partitions in the table to be queried. Filter

      • Intermediate table (query view): the temporary table that stores the query results. Intermediate table (query view)

        In this example, three intermediate tables are involved. Two intermediate tables displayed in the first section are used to store the query results from the corresponding source tables. The intermediate table displayed in the second section is used to store the joined query results. This intermediate table can be stored for three days and is automatically deleted after three days.

      • Join: the operation for joining the query results. Join

    • Outline mode: The outline mode displays the directory of the main SQL statements of the code.

    You can view a specified code block by clicking the corresponding SQL operator in classic mode or the statement in outline mode. After that, you can modify the code as needed.