Scenario | Upstream | Downstream | Reference Method |
Notebook → Notebook | Notebook | Notebook | dlcutils.jobs.taskValues.set/get |
Notebook → SQL | Notebook | SQL | {{tasks.<name>.values.<key>}} referenced in task parameters |
SQL → Notebook | SQL | Notebook | {{tasks.<name>.output.rows / first_row / first_row.<col>}} referenced in task parameters |
my_value = "example_value"dlcutils.jobs.taskValues.set(key='my_value', value=my_value)
value = dlcutils.jobs.taskValues.get(taskKey='upstream_task_name',key='my_value',debugValue='debugValue')print(value)# Output debugValue when debugging in Studio# Output example_value when the Workflow is scheduled to run
dlcutils.jobs.taskValues.get can retrieve the value set by the upstream task only during Workflow scheduling. During Studio debugging, debugValue is returned instead.dlcutils.jobs.taskValues.set(key='favorite_food', value='apple')
task_param = {{tasks.<upstream Notebook task name>.values.favorite_food}}
SELECT '${task_param}' AS food;-- Result: apple
SELECT 1 AS col_a, 2 AS col_b, 3 AS col_cUNIONSELECT 4, 5, 6UNIONSELECT 7, 8, 9;
Blockquote | Description | Sample Return |
{{tasks.<name>.output.rows}} | All rows (JSON array) | [{"col_a":1,"col_b":2,"col_c":3}, ...] |
{{tasks.<name>.output.first_row}} | First row (JSON object) | {"col_a":1,"col_b":2,"col_c":3} |
{{tasks.<name>.output.first_row.<col>}} | Specified column in the first row | 1 |
param_value = dlcutils.widgets.get('task_param')print(param_value)# [{"col_a":1,"col_b":2,"col_c":3}, ...]
{{tasks.<upstream SQL>.output.rows}}{{tasks.<upstream Notebook>.values.<key>}}
Phase | Action |
Scheduling Decision | Fails directly. |
Error Message | Execution failed. Failure cause: Unable to resolve the reference: The output of task "upstream_name" cannot be accessed because the task is not in the running scope. |
Error Code | Failed to obtain parameters passed from upstream. |
Rerun Scope | Action |
Downstream Only | Use the parameters from the last successful run. |
Include Upstream | After the upstream is rerun, the downstream uses the latest results. |
dlcutils.jobs.taskValues is used only in Notebook tasks. SQL tasks output data through output.rows.output.rows of an SQL task can contain up to 1,000 rows / 48 KB. Data beyond this limit is truncated.dlcutils.jobs.taskValues.set, but the downstream task reports an error and cannot obtain it?dlcutils.jobs.taskValues.set matches the case of the key referenced by the downstream task.{{tasks.<upstream SQL>.output.rows}}. Each row output by the SQL task is used as one iteration. For more information, see For Each loop task.Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários