Skip to content

The sql task reports an error, and the sql parsing is incorrect. #15787

@xiamud

Description

@xiamud

Search before asking

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

What happened

SQL作业使用oracle数据源类型,sql中使用union all时任务出错。
执行以下sql:
select a,b,c,b-c as d
from
(select 1 as a,2 as b,3 as c from dual)

union all
select 1 as a,2 as b,3 as c,4 as d from dual
通过查询日志,可以看到以上sql被解析为:
SELECT a, b, c, b - c AS d
FROM (
SELECT 1 AS a, 2 AS b, 3 AS c
FROM dual
UNION ALL
SELECT 1 AS a, 2 AS b, 3 AS c, 4 AS d
FROM dual
)

What you expected to happen

正常显示合并结果集

How to reproduce

在SQL任务中执行以下sql:
select a,b,c,b-c as d
from
(select 1 as a,2 as b,3 as c from dual)

union all
select 1 as a,2 as b,3 as c,4 as d from dual

Anything else

No response

Version

3.2.x

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

backendbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions