Runtime parameters assign values to variables in offline tasks. When a node is scheduled, parameter variables are automatically replaced with their assigned values. A MaxCompute SQL node is used as an example.
Procedure
-
In the top navigation bar of the Dataphin homepage, choose Develop > Data Development.
-
On the Development page, select a Project from the top navigation bar (In Dev-Prod mode, you need to select an Environment).
-
In the navigation pane on the left, choose Data Processing > Script Task.
-
In the computing task list, click the target computing task to open the corresponding computing task tab.
-
Click Property in the right sidebar to open the Property panel, and configure the following parameters in the Runtime Parameter section.
-
Input parameters
Parameters defined in the script task with the
${variable_name}expression appear in the Runtime Parameter section, where you can modify the parameter type and assign values.Parameter
Description
Parameter Name
The parameter name defined in the code editor. Variable names can contain only digits, letters, and underscores (_), with a maximum length of 32 characters.
Parameter Type
The parameter types include Global Variable, Namespace Variable, Local Variable, Cross-node Variable, and Fixed Value. For more information, see Variable categorization.
After selecting multiple parameters or clicking Select All, click Modify Parameter Type at the bottom of the parameter list to batch modify parameter types.
Parameter Value
-
Global variable: Defaults to the variable value defined by the global variable and cannot be set. For more information, see Create a global variable.
-
Space name variable: The parameter value is the space name.
-
Local variable: The value can be up to 258 characters in length or can be empty. To enter a date and time, select or refer to an expression in the list. For more information, see Variable assignment.
-
Cross-node variable: After setting upstream dependencies, you can select cross-node output parameters from upstream as parameter values.
-
Non-variable: Definition is not supported.
NoteIf you reference a global variable with permission control enabled, the system will automatically verify whether the current user has permission. Global variables without permission will be marked with an
icon. You can click Request Permission to jump to the Permission Management > Variable permission management page to request permission. -
-
Cross-node output parameters
Important-
Only Python, SQL, and Shell computing tasks support defining cross-node output parameters.
-
Integration tasks, computing tasks, normal/hierarchical dimension logical tables, and fact logical tables support cross-node variable parameters as input parameters.
Variable parameters passed to direct downstream nodes must be pre-declared in this list. Undeclared output variables are ignored. Variables declared but not assigned in code use the configured default values. To assign values, right-click in the code editor and select Set cross-node parameters.
Note-
To add multiple cross-node output parameters, you can click + Add Parameter.
-
The cross-node output parameter list supports batch operations. Select one or more parameters, then click
to delete them in bulk.
Parameter
Description
Parameter name
Cannot exceed 32 characters in length and only supports digits, letters, and underscores (_).
Parameter description
A brief description of the parameter, within 128 characters.
Default value
-
The default value used when the variable is not assigned a value. To assign a value to a cross-node output parameter, see Assign values to cross-node output parameters.
-
If you run a data backfill on a downstream node without including the upstream node in the same backfill instance, the cross-node input parameter takes its value from the upstream node's most recent N days of run records. If no records exist within that window, the default value is used. N defaults to 15 days.
-
During data backfill, select both upstream and downstream nodes. If the upstream node does not assign a value to the cross-node parameter, the downstream node uses the default value.
-
-
-
Click OK to complete the Runtime Parameter configuration for the computing task.