hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Haindrich (JIRA)" <>
Subject [jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
Date Tue, 06 Sep 2016 21:45:21 GMT


Zoltan Haindrich commented on HIVE-13557:

[~ashutoshc] [~cartershanklin]
I've tried to run the above sample query...but it failed with:
Wrong arguments '30': No matching method for class org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPDTIPlus
with (date, int)

anyway...I think if it should work...then {{intervalQualifiers}} should appear at at least
one other place than this...because this rule requires the interval keyword to work; this
one is ruled out - however I haven't found any other occurences

of course I might be wrong...or I've missed something...

{{DAYS}}: I think that's optional...the standard (which I was able to access - some draft)
only requires {{DAY}} ...but supporting {{DAYS}} may make the sql statements more readable
(at the cost of reserving {{DAYS}} to be a keyword )

note: I think hplsql's interval misses a few interval keywords like {{month}} and {{day}}

note: while I was reading the standard...the {{<interval qualifier>}} caught my attention
- it looks like a lot more sophisticated than I expected...I'm not sure it's
I think it might worth a look from someone else..
oracle has some docs about this which looks more readable:

making the interval keyword optional:
* supporting {{select date '2012-01-01' + '-30' days}} and/or {{select date '2012-01-01' -
30 days}} would be ok I think
* but supporting {{select date '2012-01-01' + (-30) days}} would be a bit more trickier...but
not impossible

> Make interval keyword optional while specifying DAY in interval arithmetic
> --------------------------------------------------------------------------
>                 Key: HIVE-13557
>                 URL:
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Types
>            Reporter: Ashutosh Chauhan
> Currently we support expressions like: {code}
> WHERE SOLD_DATE BETWEEN ((DATE('2000-01-31'))  - INTERVAL '30' DAY) AND DATE('2000-01-31')
> {code}
> We should support:
> {code}
> WHERE SOLD_DATE BETWEEN ((DATE('2000-01-31')) + (-30) DAY) AND DATE('2000-01-31')
> {code}

This message was sent by Atlassian JIRA

View raw message