druid SQL Parse SchemaStatVisitor getFunctions返回结果没有将表别名进行替换

oewdyzsn  于 4个月前  发布在  Druid
关注(0)|答案(2)|浏览(76)

如本地测试返回结果:
[from_unixtime(t.from_time, 'yyyyMMdd')]

pxiryf3j

pxiryf3j1#

输入SQL是什么?

ecr0jaav

ecr0jaav2#

select n.user_name,
n.user_passwd,
n.user_project,
n.start_date,
n.end_date
from (
select t.name as user_name,
t.passwd as user_passwd,
cast(from_unixtime(t.from_time, "yyyyMMdd") as int) as start_date,
cast(from_unixtime(t.to_time, "yyyyMMdd") as int) as end_date
from tableA as t
where t.user_id = 1
union all
select p.project as user_project
from tableB as p
where p.project_id = 10
) as n;

相关问题