dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Bug] The Bug of Parameter passing feature is unavailable in SQL Task still exists in 3.3.2

Open yaowanli opened this issue 2 months ago • 8 comments

Search before asking

  • [x] I had searched in the issues and found no similar issues.

What happened

Parameter passing feature is unavailable.

ALL task and stream Image

task1-output the value 'order_no' as Parameter Image

task2-use the Parameter 'order_no',produce the Parameter 'output' Image

task3-use the Parameter 'output' Image

task1-result Image

task2-result Image

task3-result

Image

What you expected to happen

After upstream tasks complete execution, parameters are not merged into global parameters, causing the parameter passing functionality to be unavailable. This feature needs to be restored.

How to reproduce

Parameter passing missing

Anything else

No response

Version

3.3.2

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

yaowanli avatar Nov 03 '25 03:11 yaowanli

You can try adding a variable of type in in your task3, and try it again.

I just ran the following workflow and saw the Task 2 SQL task pick up the upstream shell task output and return the expected results.

Image Image Image

Mrhs121 avatar Nov 03 '25 17:11 Mrhs121

Oh, i get you!in this way ,i can get the variable from the upstream node,but i have to explicitly add IN type variables every time,it seems a bit trouble. Why can't I declare the OUT type variable first and then add it to the local variables so that downstream nodes can use it directly?That's how it's demonstrated in the official documentation. Or could it be optimized by allowing selection of an existing local variable from a dropdown menu?

yaowanli avatar Nov 04 '25 02:11 yaowanli

Oh, i get you!in this way ,i can get the variable from the upstream node,but i have to explicitly add IN type variables every time,it seems a bit trouble. Why can't I declare the OUT type variable first and then add it to the local variables so that downstream nodes can use it directly?That's how it's demonstrated in the official documentation. Or could it be optimized by allowing selection of an existing local variable from a dropdown menu?

I found that the behavior of Parameter passing has changed in version 3.3.x. In old version 3.2.x, as shown in the above example, task2 can obtain the upstream output without configuring a variable of type in. On the contrary, when a variable of type in is set, the upstream output cannot be obtained.

In version 3.3.x, the following processing logic has been added. For example, in the above example, only when local var task_type is configured in task2 will the upstream varPools value(internal_table_creation_task) be used to override the value of local var task_type

https://github.com/apache/dolphinscheduler/blob/797014807f774ff17f617db13b9e6acd64164f6b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/expand/CuringParamsServiceImpl.java#L226-L235

Mrhs121 avatar Nov 04 '25 03:11 Mrhs121

Thanks for your reply. If the parameter passing logic has indeed been modified, then I have no objection. I suggest updating the description and images regarding "parameter passing" in the official documentation: When downstream nodes use local variables, the variables need to be explicitly configured.

yaowanli avatar Nov 04 '25 06:11 yaowanli

Thanks for your reply. If the parameter passing logic has indeed been modified, then I have no objection. I suggest updating the description and images regarding "parameter passing" in the official documentation: When downstream nodes use local variables, the variables need to be explicitly configured.

You are right. Would you like to update the docs?

SbloodyS avatar Nov 04 '25 06:11 SbloodyS

Oh, it's my pleasure. I'll try to revise the document in the next few days.

yaowanli avatar Nov 04 '25 07:11 yaowanli

Oh, it's my pleasure. I'll try to revise the document in the next few days.

I've assigned to you. Looking forward to your contribution.

SbloodyS avatar Nov 04 '25 07:11 SbloodyS

Oh, i get you!in this way ,i can get the variable from the upstream node,but i have to explicitly add IN type variables every time,it seems a bit trouble. Why can't I declare the OUT type variable first and then add it to the local variables so that downstream nodes can use it directly?That's how it's demonstrated in the official documentation. Or could it be optimized by allowing selection of an existing local variable from a dropdown menu?

I found that the behavior of Parameter passing has changed in version 3.3.x. In old version 3.2.x, as shown in the above example, task2 can obtain the upstream output without configuring a variable of type in. On the contrary, when a variable of type in is set, the upstream output cannot be obtained.

In version 3.3.x, the following processing logic has been added. For example, in the above example, only when local var task_type is configured in task2 will the upstream varPools value(internal_table_creation_task) be used to override the value of local var task_type

dolphinscheduler/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/expand/CuringParamsServiceImpl.java

Lines 226 to 235 in 7970148

if (CollectionUtils.isNotEmpty(varPools)) { // overwrite the in parameter by varPool for (Property varPool : varPools) { Property property = prepareParamsMap.get(varPool.getProp()); if (property == null || property.getDirect() != Direct.IN) { continue; } property.setValue(varPool.getValue()); } } 3.3.1需要添加以下修复的代码 Image

abangv avatar Dec 11 '25 09:12 abangv