The quick run feature in DataWorks lets you instantly run selected code snippets from the node editor to test your code.
Prerequisites
You must have an ODPS SQL or EMR Hive node with its task code written.
-
To create an ODPS SQL node, see Develop an ODPS SQL task.
-
To create an EMR Hive node, see Create an EMR Hive node.
Limitations
-
Only ODPS SQL and EMR Hive nodes support the quick run feature.
-
The quick run feature is available only for nodes that are not running. The quick run (
) icon does not appear if the node's task code is already executing.
Usage notes
The quick run feature executes your code. While scheduling resources are free, you are charged for the compute engine resources used. For billing details, refer to the documentation for the specific engine.
Procedure
-
Go to DataStudio
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Data Development.
-
Open the node editor
In the directory tree of the DataStudio or Manual business process module, or by using the Ad Hoc Query feature, find and double-click the target node to open the editor page.
-
For more information about the directory structure of DataStudio and Manual business process, see DataStudio feature guide.
-
To learn how to use ad hoc queries, see Create an ad hoc query.
-
-
Quick run code and view the result
This section uses an ODPS SQL node as an example.
SELECT uid , MAX(region) , MAX(device) , COUNT(0) AS pv , MAX(gender) , MAX(age_range) , MAX(zodiac) FROM xc_dw_user_info_d_dqc WHERE dt = '${bizdate}' GROUP BY uid;Click Run. The run log shows the following output:
TableSink1: 0 (min: 0, max: 0, avg: 0) MaxInstance: 0 Values1: 0 (min: 0, max: 0, avg: 0) MaxInstance: 0 OK 2022-03-30 10:15:55 INFO ============================================================ 2022-03-30 10:15:55 INFO Exit code of the Shell command 0 2022-03-30 10:15:55 INFO --- Invocation of Shell completed --- 2022-03-30 10:15:55 INFO Shell run successfully! 2022-03-30 10:15:55 INFO Current task status: FINISH 2022-03-30 10:15:55 INFO Cost time is: 6.401s /home/admin/alisatasknode/taskinfo//20220330/datastudio/10/15/47/x1cz602xtu7caznvzybnxfri/T3_0039927779.log-END-EOF-
Select code
In the SQL code editor, place your cursor on a line of code. The system automatically identifies the complete code snippet that contains that line.
-
Run the code
Note-
This feature is available only for nodes that are not running. If the task code of a node is running, the quick run (
) icon is not displayed to the left of the code line. -
Resource group for quick run
-
The quick run feature executes your code. While scheduling resources are free, you are charged for the compute engine resources used. For billing details, refer to the documentation for the specific engine.
-
A quick run uses the resource group from the node's last execution, regardless of whether it was triggered by a quick run
, Run
, or advanced run
. -
If you are running the node for the first time, you must select a scheduling resource group. If no suitable resource group is available, you can purchase and use a Serverless resource group. For more information, see Use a Serverless resource group .
-
If you need to change the resource group used by the node, use the advanced run
feature.
-
-
If your code snippet contains variables, you must assign values during the first quick run. The system saves these values for future runs. To change the variable values later, use the advanced run
feature. For more information about assigning values to variables, see Supported formats of scheduling parameters.
You can run the code in one of the following ways:
-
Click the quick run (
) icon to the left of the code line. -
Use a keyboard shortcut.
-
On Windows:
Ctrl + Enter. -
On macOS:
Cmd + Enter.
-
After the run finishes, check the execution result to verify the code and fix any errors.
-
-