我有蜂箱表:
CREATE TABLE FOO (
a string,
b double,
enumerator bigint
) PARTITIONED BY (
asof_date date
)当我尝试使用hive-jdbc查询它时,生成的select是:
select * from FOO where asof_date = {ts '2015-05-15 00:00:00'}配置单元失败,出现错误:
ParseException line 1:36 cannot recognize input near '{' 'ts' ''2015-05-15 00:00:00'' in expression我该怎么解决这个问题呢?
发布于 2018-12-07 02:21:20
在较早版本的配置单元中,没有适当的DATE或TIMESTAMP类型,或者,它们总是以ODBC格式存储为字符串。
换句话说,where asof_date = '2015-05-15'应该工作得很好。
或者使用正式的SQL语法= date'2015-05-15'。
或者更冗长的= cast('2015-05-15' as DATE)
https://stackoverflow.com/questions/53650073
复制相似问题