我使用以下查询查找给定时间戳约束的数据:
query = 'select my_id, my_ts from my_table limit 100 where my_ts > "2016-05-13 00:00:00"'
cursor = impala_con.cursor()
cursor.execute('USE my_database')
cursor.execute(query)
但出现以下错误:
HiveServer2Error: AnalysisException: Syntax error in line 1:
...my_ts from my_table limit 100 where my_ts > "201...
^
Encountered: WHERE
Expected: AND, BETWEEN, DIV, ILIKE, IN, IREGEXP, IS, LIKE, LIMIT, NOT, OFFSET, OR, ORDER, REGEXP, RLIKE, UNION
CAUSED BY: Exception: Syntax error
有人知道我做错了什么吗?谢谢!
1条答案
按热度按时间oewdyzsn1#
根据您需要指定的文档
limit 100
在where子句之后。