Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
This is a follow-up ticket from HIVE-13557
The following interval syntaxes are not yet supported:
1) interval keyword with expression without paraentheneses:
select date('2011-11-11') + INTERVAL dt SECONDS from table
2) the same without the INTERVAL keyword
select date('2011-11-11') + dt SECONDS from table
however, using paraentheneses it is supported
select date('2011-11-11') + INTERVAL (dt) SECONDS from table
and
select date('2011-11-11') + (dt) SECONDS from table
My notes about these:
1) I've bumped into parser troubles implementing it because antlr was not able to create a valid parser; because it "thinked" about usescases like this:
INTERVAL 1+INTERVAL 1 SECONDS SECONDS
which is of course invalid...but because andlr have seen an expression inside...it made it loose the track of the SECONDS (I think).
2) is not required to be compliant with the standard - and I it may also lead to confusion:
1 + dt SECONDS is 1+(1 SECONDS) or (1+1) SECONDS
however supporting <tableOrColReferences> SECONDS
might be possible - and "just enough" to be convinient to the user.
Attachments
Issue Links
- relates to
-
HIVE-13557 Make interval keyword optional while specifying DAY in interval arithmetic
- Closed