All Products
Search
Document Center

DataWorks:Debug code snippet

Last Updated:Mar 27, 2026

When iterating on SQL code, running the full node each time slows down debugging. The quick run feature lets you test a selected code snippet directly in the node editor without triggering a full scheduled run, so you can verify that a specific statement produces the expected result.

Prerequisites

Before you begin, ensure that you have:

Limitations

  • Only ODPS SQL and EMR Hive nodes support the quick run feature.

  • Quick run is only available when the node is not currently running. If the node is already executing, the quick run icon Run icon does not appear next to the code line.

Billing

Quick run does not consume scheduling resources. You are charged only for the compute engine instances used. For billing details, see the billing documentation for the Alibaba Cloud service that your compute engine belongs to.

Run a code snippet

  1. Go to the DataStudio page. Log on to the DataWorks console. In the top navigation bar, select a region. In the left-side navigation pane, choose Data Development and O&M > Data Development. Select a workspace and click Go to Data Development.

  2. Open the node. In the left-side navigation pane, click Scheduled Workflow, Manually Triggered Workflows, or Ad Hoc Query. Find the ODPS SQL or EMR Hive node and double-click it to open the configuration tab.

  3. Select the code snippet to run. In the SQL code section, hover over any line of code. DataStudio automatically highlights the complete code snippet that the line belongs to.

    Run a code snippet

  4. Run the highlighted snippet.

    Use one of the following methods:

    Method Windows macOS
    Keyboard shortcut Ctrl+Enter Cmd+Enter
    Click Click the quick run icon Run icon to the left of the code line Click the quick run icon Run icon to the left of the code line

    Resource group: Quick run uses the resource group from the most recent execution of the node. The first time you run the node, select a resource group based on your business requirements. To create a new resource group, see Use exclusive resource groups for scheduling. To change the resource group, click the advanced run icon Run with Parameters icon in the top toolbar. You can also set the resource group for subsequent quick runs by using the run icon Run icon or advanced run icon Run with Parameters icon in the top toolbar.

    Variables: If the code snippet contains variables, specify their values the first time you run it. DataStudio saves the values for subsequent runs. To change variable values, click the advanced run icon Run with Parameters icon. For supported variable formats, see Supported formats for scheduling parameters.

  5. View the execution result. After the run completes, you can view the execution result. If the result is unexpected, modify the code snippet and run it again.