Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 2.9.0
-
None
-
ghx-label-3
Description
http://impala.apache.org/docs/build/html/topics/impala_literals.html mentions being able to apply INTERVAL expressions to strings that will be able to be coerced as timestamps,
You can also use INTERVAL expressions to add or subtract from timestamp literal values, such as '1966-07-30' + INTERVAL 5 YEARS + INTERVAL 3 DAYS.
but a user pointed out on dev@ that this is wrong:
[localhost:21000] > SELECT '1966-07-30' + INTERVAL 1 YEAR; ERROR: AnalysisException: Operand ''1966-07-30'' of timestamp arithmetic expression ''1966-07-30' + INTERVAL 1 YEAR' returns type 'STRING'. Expected type 'TIMESTAMP'. [localhost:21000] >
Documentation should be altered to fix this.
It looks like John Russell pointed this out in IMPALA-2293, which was marked as a dupe of IMPALA-1503.