Overview
Used to support parameter passing between upstream and downstream. For example: pass the calculation results of the current task as parameters to sub-tasks. Multiple results can be specified by column number to pass objects.
Supported Scopes: Hive SQL, JDBC SQL, Python, Shell, Spark SQL, DLC SQL, Impala, TCHouse-P.
Parameter Configuration Description
1. Output Current Task Parameters
If parameters need to be passed from the current task to downstream, check Output Current Task Parameters in parameter passing and configure the parameter information.
Fill in the output parameters produced by this task and their corresponding values (supporting variables and constants). For example: Parent Task A calculates 3 columns with results 123, 234, 1234. In this configuration, define an output parameter name mark_id, fill in mark_id = $[0], which means to take the value of the first column in the first row of the calculation result.
Example:As shown, define parameter name a to take the first variable in the code; define parameter name b to take the second variable in the code.
2. Refer to Parent Task Parameters
If the current task needs to refer to the parameters defined in the parent task, check Refer to Parent Task Parameters in parameter passing.
Fill in the introduced parameters defined, select the output parameters of the parent task from which the parameters are taken (if there is no parent node, there is no option). For example: Sub-task B, arbitrarily define a parameter name mark_id, select the value from node A.mark_id, and use ${mark_id} in the code, which will replace ${mark_id} with the string 123.
Example:As shown, define parameter name a to take the parameter a defined in the upstream parent task hivesql_1; define parameter name b to take the parameter b defined in the upstream parent task hivesql_1.
Usage Examples
Divided into three categories: SQL Class, Shell Class, Python Class. The following are usage examples of the three types (in the text below, constants are taken as examples, variable passing is also supported).
|
|
| Parameter configuration | Code | Parameter configuration | Code |
SQL Type | Hive SQL
JDBC SQL
Spark SQL
DLC SQL
Impala
TCHouse-P | | SELECT "This is a parameter" | | SELECT '${test_canshu}' AS parameter_value; |
Shell Type | Shell | | echo "This is a parameter" | | expr ${test_canshu} |
Python Type | Python | | print("This is a parameter") | | print("test_canshu") |
Was this page helpful?