dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Bug] [dolphinscheduler-task-plugin] Built-in parameters replaced failed in sql task

Open izualzhy opened this issue 3 years ago • 1 comments

Search before asking

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

What happened

  1. create SQL task
  2. type in select '$[yyyyMMdd]', '$[yyyyMMdd-1]', '$[HH]', '$[HHmmss]' as SQL statement
  3. start the workflow
  4. as the task log just print literal self, not the replaced built-in parameters. logs example:
[INFO] 2022-09-20 10:11:16.293 +0800 [taskAppId=TASK-20220920-6932014227904_5-67-133] TaskLogLogger-class ... - [WorkflowInstance-67][TaskInstance-133] - display sql result 1 rows as follows:
[INFO] 2022-09-20 10:11:16.293 +0800 [taskAppId=TASK-20220920-6932014227904_5-67-133] TaskLogLogger-class ... - [WorkflowInstance-67][TaskInstance-133] - row 1 : {"_col0":"$[yyyyMMdd]","_col1":"$[yyyyMMdd-1]","_col2":"$[HH]","_col3":"$[HHmmss]"}

What you expected to happen

SqlTask's behavior should be consistent with ShellTask. As in ShellTask, script like echo '$[yyyyMMdd]', '$[yyyyMMdd-1]', '$[HH]', '$[HHmmss]' print the replaced parameters. logs example:

[INFO] 2022-09-20 10:11:13.816 +0800 [taskAppId=TASK-20220920-6932014227904_5-67-132] TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[139] - [WorkflowInstance-67][TaskInstance-132] - raw script : echo '20220920', '20220919', '10', '101113'

image

How to reproduce

follow the steps in "What happened"

Anything else

No response

Version

3.0.0

Are you willing to submit PR?

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

Code of Conduct

izualzhy avatar Sep 20 '22 02:09 izualzhy

Thank you for your feedback, we have received your issue, Please wait patiently for a reply.

  • In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
  • If you haven't received a reply for a long time, you can join our slack and send your question to channel #troubleshooting

github-actions[bot] avatar Sep 20 '22 02:09 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Oct 22 '22 00:10 github-actions[bot]

This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.

github-actions[bot] avatar Nov 06 '22 00:11 github-actions[bot]