[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15699297#comment-15699297 ] Lefty Leverenz commented on HIVE-13557: --- Looks great, [~kgyrtkirk]. I added WEEKS to the list of aliases -- is that correct? Removed the TODOC2.2 label. > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15690222#comment-15690222 ] Zoltan Haindrich commented on HIVE-13557: - [~leftylev] I've added a section about intervals to the datatypes docs, can you please take a look? I tried to keep it brief ;) https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-Intervals > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Labels: TODOC2.2 > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15690050#comment-15690050 ] Zoltan Haindrich commented on HIVE-13557: - [~pxiong] thank you for the review, I've opened HIVE-15271 as a follow-up to this ticket. [~leftylev] okay...then I'll start with documenting HIVE-9792 and this ;) > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Labels: TODOC2.2 > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15689137#comment-15689137 ] Lefty Leverenz commented on HIVE-13557: --- Doc note: This needs to be documented in the wiki, but first INTERVAL needs to be documented (see HIVE-9792). In addition, the new keywords SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS, and YEARS need to be listed in the DDL doc. * [DDL -- Non-reserved Keywords | https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Non-reservedKeywords] * [Hive Data Types | https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types] Added a TODOC2.2 label. > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Labels: TODOC2.2 > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15689077#comment-15689077 ] Lefty Leverenz commented on HIVE-13557: --- [~pxiong], are you waiting to set the fix version after committing this to a branch? > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Labels: TODOC2.2 > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15678175#comment-15678175 ] Pengcheng Xiong commented on HIVE-13557: I have tried to improve the patch to address query like {code} select date '2012-01-01' + dt days from t; {code} but got no luck. Sounds like the parser looks from left to the right and it will take dt but forget the "days" after it. [~kgyrtkirk] ,could u open a follow-up jira for it? Thanks. > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15675661#comment-15675661 ] Pengcheng Xiong commented on HIVE-13557: +1 > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15670308#comment-15670308 ] Zoltan Haindrich commented on HIVE-13557: - failures are unrelated; HIVE-15201 HIVE-15116 HIVE-15115 [~pxiong] can you please take a look at the new changes? > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15670270#comment-15670270 ] Hive QA commented on HIVE-13557: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12839158/HIVE-13557.3.patch {color:green}SUCCESS:{color} +1 due to 3 test(s) being added or modified. {color:red}ERROR:{color} -1 due to 3 failed/errored test(s), 10710 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestMiniLlapCliDriver.testCliDriver[transform_ppr2] (batchId=133) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[join_acid_non_acid] (batchId=150) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[union_fast_stats] (batchId=145) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/2150/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/2150/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-2150/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 3 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12839158 - PreCommit-HIVE-Build > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch, HIVE-13557.3.patch, HIVE-13557.3.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15666127#comment-15666127 ] Hive QA commented on HIVE-13557: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12838875/HIVE-13557.2.patch {color:green}SUCCESS:{color} +1 due to 3 test(s) being added or modified. {color:red}ERROR:{color} -1 due to 7 failed/errored test(s), 10695 tests executed *Failed tests:* {noformat} TestSparkCliDriver - did not produce a TEST-*.xml file (likely timed out) (batchId=105) [auto_join30.q,timestamp_null.q,date_udf.q,join16.q,groupby_ppr.q,bucketmapjoin7.q,smb_mapjoin_18.q,join19.q,vector_varchar_4.q,union6.q,cbo_subq_in.q,vectorization_part.q,sample8.q,vectorized_timestamp_funcs.q,join_star.q] org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[show_functions] (batchId=66) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[join_acid_non_acid] (batchId=150) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[union_fast_stats] (batchId=145) org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainanalyze_4] (batchId=91) org.apache.hadoop.hive.cli.TestNegativeCliDriver.testCliDriver[interval_2] (batchId=83) org.apache.hadoop.hive.cli.TestNegativeCliDriver.testCliDriver[interval_3] (batchId=83) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/2121/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/2121/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-2121/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 7 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12838875 - PreCommit-HIVE-Build > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch, HIVE-13557.2.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15652495#comment-15652495 ] Pengcheng Xiong commented on HIVE-13557: I have left some comments on RB. the patch can be improved. > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15652345#comment-15652345 ] Ashutosh Chauhan commented on HIVE-13557: - Looks good to me. [~pxiong] do you also want to take a look? > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15613648#comment-15613648 ] Ashutosh Chauhan commented on HIVE-13557: - [~pxiong] Can you please help review this? > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15585001#comment-15585001 ] Hive QA commented on HIVE-13557: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12833889/HIVE-13557.1.patch {color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified. {color:red}ERROR:{color} -1 due to 9 failed/errored test(s), 10597 tests executed *Failed tests:* {noformat} TestBeelineWithHS2ConnectionFile - did not produce a TEST-*.xml file (likely timed out) (batchId=197) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[acid_globallimit] (batchId=27) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[order_null] (batchId=18) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[show_functions] (batchId=65) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[union_fast_stats] (batchId=46) org.apache.hive.beeline.TestBeelineArgParsing.testAddLocalJarWithoutAddDriverClazz[0] (batchId=155) org.apache.hive.beeline.TestBeelineArgParsing.testAddLocalJar[0] (batchId=155) org.apache.hive.beeline.TestBeelineArgParsing.testAddLocalJar[1] (batchId=155) org.apache.hive.jdbc.authorization.TestJdbcWithSQLAuthorization.testBlackListedUdfUsage (batchId=204) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/1616/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/1616/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-1616/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 9 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12833889 - PreCommit-HIVE-Build > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch, HIVE-13557.1.patch, > HIVE-13557.1.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15578800#comment-15578800 ] Zoltan Haindrich commented on HIVE-13557: - i've posted the first version. instead of trying to force the existing interval evaluation logic to do these too...i've added an interval evalution logic inside an udf; i think it would be good to use the same thing to evaluate the old {{intervalLiteral}}'s outputs - however that would need intervalLiteral to be removed from the 'constant' group...I think the only feature which would be missing after that: is the ability to specify skewed columns by intervalLiterals... using an udf enables that the interval argument can be possibly a column reference also - if I interpretted the sql2011 correctly: that's desired by the standard. note: currently the parentheses are mandatory..but in case we merge {{intervalExpression}} with {{intervalLiteral}}...it wont be needed anymore - I haven't found any references about these parentheses to be mandatory - its a large document...I lose my mind every time I open it ;) > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > Project: Hive > Issue Type: Sub-task > Components: Types >Reporter: Ashutosh Chauhan >Assignee: Zoltan Haindrich > Attachments: HIVE-13557.1.patch > > > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15468812#comment-15468812 ] Carter Shanklin commented on HIVE-13557: Hive supports interval but only with the singular forms, which is annoying. Hive: {code} hive> select date '2012-01-01' + interval '-30' day; OK 2011-12-02 00:00:00 Time taken: 0.506 seconds, Fetched: 1 row(s) hive> select date '2012-01-01' + interval '-30' days; NoViableAltException(146@[323:1: atomExpression : ( ( KW_NULL )=> KW_NULL -> TOK_NULL | ( constant )=> constant | castExpression | caseExpression | whenExpression | ( functionName LPAREN )=> function | tableOrColumn | LPAREN ! expression RPAREN !);]) long traceback truncated {code} Same is true of month and year. Hive doesn't support either "week" or "weeks" like other databases do. Compare Postgres: {code} vagrant=# select date '2012-01-01' + (-30) days; days 2011-12-02 (1 row) vagrant=# select date '2012-01-01' + interval '-30' day; ?column? - 2011-12-02 00:00:00 (1 row) vagrant=# select date '2012-01-01' + interval '-30' days; days - 2011-12-31 23:59:30 (1 row) {code} Cleaning this stuff up would be really great. > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15468723#comment-15468723 ] Zoltan Haindrich commented on HIVE-13557: - [~ashutoshc] [~cartershanklin] I've tried to run the above sample query...but it failed with: {code} Wrong arguments '30': No matching method for class org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPDTIPlus with (date, int) {code} 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 https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g#L294 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}} https://github.com/apache/hive/blob/master/hplsql/src/main/antlr4/org/apache/hive/hplsql/Hplsql.g4#L1046 note: while I was reading the standard...the {{}} caught my attention - it looks like a lot more sophisticated than I expected...I'm not sure it's required...so I think it might worth a look from someone else.. oracle has some docs about this which looks more readable: https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm#i38598 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: https://issues.apache.org/jira/browse/HIVE-13557 > 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 (v6.3.4#6332)
[jira] [Commented] (HIVE-13557) Make interval keyword optional while specifying DAY in interval arithmetic
[ https://issues.apache.org/jira/browse/HIVE-13557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15250074#comment-15250074 ] Ashutosh Chauhan commented on HIVE-13557: - [~cartershanklin] noted that we do allow {{select date '2012-01-01' + (-30) days;}} syntax. So, I think we are good here. Last point here is to allow {{DAY}} wherever {{DAYS}} if standard supports it. MySQL support {{DAY}} however postgres doesnt. > Make interval keyword optional while specifying DAY in interval arithmetic > -- > > Key: HIVE-13557 > URL: https://issues.apache.org/jira/browse/HIVE-13557 > 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 (v6.3.4#6332)