Skip to content

Commit fd4154e

Browse files
authored
[Doc-17639] Parameter passing docs improvement (#17841)
1 parent 80d8439 commit fd4154e

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

docs/docs/en/guide/parameter/context.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ The value of upstream parameter can be updated in downstream node in the same wa
2323

2424
Upstream parameter will be override when defining parameter with the same name in downstream node.
2525

26-
> Note: If there are no dependencies between nodes, local parameters cannot be passed upstream.
26+
> Note:
27+
>
28+
> 1. Parameter passing behavior has changed in version 3.3.x**
29+
> In older version before 3.2.2, downstream node B could obtain the out type output X of upstream node A without configuring an IN type local variable X.
30+
> In the new version after 3.3.0, the logic for obtaining local variables has been modified: downstream node B can only use the out type output X of upstream node A if it has configured an IN type local variable X.
31+
> See the Node_B and Node_mysql examples below for details.
32+
>
33+
> 2. If there are no dependencies between nodes, local parameters cannot be passed upstream.
2734
2835
### Example
2936

@@ -46,12 +53,16 @@ When the SHELL node is defined, the log detects the format of `${setValue(output
4653

4754
Create the Node_B task, which is mainly used to test and output the parameters passed by the upstream task Node_A.
4855

56+
In the custom parameters, add an IN type value parameter and an output parameter.
57+
4958
![context-parameter02](../../../../img/new_ui/dev/parameter/context_parameter02.png)
5059

5160
#### Create SQL tasks and use parameters
5261

5362
When the SHELL task is completed, we can use the output passed upstream as the query object for the SQL. The id of the query is renamed to ID and is output as a parameter.
5463

64+
In the custom parameters, add an `OUT` type `ID` parameter and an `IN` type `output` parameter.
65+
5566
![context-parameter03](../../../../img/new_ui/dev/parameter/context_parameter03.png)
5667

5768
> Note: If the result of the SQL node has only one row, one or multiple fields, the name of the `prop` needs to be the same as the field name. The data type can choose structure except `LIST`. The parameter assigns the value according to the same column name in the SQL query result.

docs/docs/zh/guide/parameter/context.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ DolphinScheduler 允许在任务间进行参数传递,目前传递方向仅支
2323

2424
如果定义了同名的传递参数,上游节点的参数将被覆盖。
2525

26-
> 注:若节点之间没有依赖关系,则局部参数无法通过上游传递。
26+
> 1. 参数传递的行为在3.3.x版本中发生了变化**
27+
> 在旧版本低于3.2.2中,下游节点B无需配置IN类型局部变量X即可获取上游节点A的out类型输出X;
28+
> 在版本高于3.3.0中修改领了局部变量的获取逻辑:只有下游节点B配置了IN类型的局部变量X,才可使用上游节点A的out类型输出X。
29+
> 详情参考下文的Node_B 和 Node_mysql 样例
30+
>
31+
> 2. 若节点之间没有依赖关系,则局部参数无法通过上游传递。
2732
2833
### 任务样例
2934

@@ -46,12 +51,16 @@ SHELL 节点定义时当日志检测到 ${setValue(output=1)} 的格式时,会
4651

4752
创建 Node_B 任务,主要用于测试输出上游任务 Node_A 传递的参数。
4853

54+
在自定义参数中,添加IN类型的 value 参数 和 output 参数
55+
4956
![context-parameter02](../../../../img/new_ui/dev/parameter/context_parameter02.png)
5057

5158
#### 创建 SQL 任务并使用参数
5259

5360
完成上述的 SHELL 任务之后,我们可以使用上游所传递的 output 作为 SQL 的查询对象。其中将所查询的 id 重命名为 ID,作为参数输出。
5461

62+
在自定义参数中,添加OUT类型的 ID 参数 和 IN类型的 output 参数
63+
5564
![context-parameter03](../../../../img/new_ui/dev/parameter/context_parameter03.png)
5665

5766
> 注:如果 SQL 节点的结果只有一行,一个或多个字段,参数的名字需要和字段名称一致。数据类型可选择为除 LIST 以外的其他类型。变量会选择 SQL 查询结果中的列名中与该变量名称相同的列对应的值。
-22.9 KB
Loading
-12.2 KB
Loading

0 commit comments

Comments
 (0)