Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/docs/en/guide/parameter/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ The value of upstream parameter can be updated in downstream node in the same wa

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

> Note: If there are no dependencies between nodes, local parameters cannot be passed upstream.
> Note:
>
> 1. Parameter passing behavior has changed in version 3.3.x**
> 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.
> 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.
> See the Node_B and Node_mysql examples below for details.
>
> 2. If there are no dependencies between nodes, local parameters cannot be passed upstream.

### Example

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

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

In the custom parameters, add an IN type value parameter and an output parameter.

![context-parameter02](../../../../img/new_ui/dev/parameter/context_parameter02.png)

#### Create SQL tasks and use parameters

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.

In the custom parameters, add an `OUT` type `ID` parameter and an `IN` type `output` parameter.

![context-parameter03](../../../../img/new_ui/dev/parameter/context_parameter03.png)

> 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.
Expand Down
11 changes: 10 additions & 1 deletion docs/docs/zh/guide/parameter/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ DolphinScheduler 允许在任务间进行参数传递,目前传递方向仅支

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

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

### 任务样例

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

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

在自定义参数中,添加IN类型的 value 参数 和 output 参数

![context-parameter02](../../../../img/new_ui/dev/parameter/context_parameter02.png)

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

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

在自定义参数中,添加OUT类型的 ID 参数 和 IN类型的 output 参数

![context-parameter03](../../../../img/new_ui/dev/parameter/context_parameter03.png)

> 注:如果 SQL 节点的结果只有一行,一个或多个字段,参数的名字需要和字段名称一致。数据类型可选择为除 LIST 以外的其他类型。变量会选择 SQL 查询结果中的列名中与该变量名称相同的列对应的值。
Expand Down
Binary file modified docs/img/new_ui/dev/parameter/context_parameter02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/new_ui/dev/parameter/context_parameter03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading