impala查询:异常:由cast函数引起的语法错误

2w3kk1z5  于 2021-06-28  发布在  Hive
关注(0)|答案(1)|浏览(489)

我有下面的 Impala 问题

select session_id, max(cast(milli_ts) as integer), min(cast(milli_ts) as integer)from my_table group by session_id

但出现以下错误:

HiveServer2Error: AnalysisException: Syntax error in line 10:
...sion_id, max(cast(milli_ts) as integer), min(cast(mill...
                             ^
Encountered: )
Expected: AND, AS, BETWEEN, DIV, ILIKE, IN, IREGEXP, IS, LIKE, NOT, OR, REGEXP, RLIKE

CAUSED BY: Exception: Syntax error

你知道我错过了什么吗?谢谢!

kmpatx3s

kmpatx3s1#

cast的正确语法如下:

cast(milli_ts as integer)

相关问题