【发布时间】:2016-04-12 15:45:55
【问题描述】:
我在表 1 中有类似 date_column = 20140228 的字段。当我对下面的数字进行硬编码时,它可以工作,但是当我指定列名时,它会失败。有错误 H110 无法提交声明。编译语句时出错:FAILED: ParseException line 2:1 cannot identify input near 'select' 'date_format' '(' in select Clause [ERROR_STATUS]
Working:
select date_format(from_unixtime(unix_timestamp(cast('2014022817' as string),'yyyyMMddHH')),'yyyy-MM-dd HH');
Failing:
select
select date_format(from_unixtime(unix_timestamp(cast(date_column as string),'yyyyMMddHH')),'yyyy-MM-dd HH')
from
table1
【问题讨论】: