You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Hive QA (JIRA)" <ji...@apache.org> on 2017/09/10 21:53:02 UTC

[jira] [Commented] (HIVE-17031) HPL/SQL Addition/Subtraction only supported on integers, datetimes and intervals

    [ https://issues.apache.org/jira/browse/HIVE-17031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16160488#comment-16160488 ] 

Hive QA commented on HIVE-17031:
--------------------------------



Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12886317/HIVE-17031.1.patch

{color:green}SUCCESS:{color} +1 due to 1 test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 4 failed/errored test(s), 11034 tests executed
*Failed tests:*
{noformat}
TestAccumuloCliDriver - did not produce a TEST-*.xml file (likely timed out) (batchId=230)
TestDummy - did not produce a TEST-*.xml file (likely timed out) (batchId=230)
org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[insert_values_orig_table_use_metadata] (batchId=61)
org.apache.hadoop.hive.cli.TestPerfCliDriver.testCliDriver[query14] (batchId=234)
{noformat}

Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/6757/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/6757/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-6757/

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: 4 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12886317 - PreCommit-HIVE-Build

> HPL/SQL Addition/Subtraction only supported on integers, datetimes and intervals
> --------------------------------------------------------------------------------
>
>                 Key: HIVE-17031
>                 URL: https://issues.apache.org/jira/browse/HIVE-17031
>             Project: Hive
>          Issue Type: Bug
>          Components: hpl/sql
>            Reporter: Carter Shanklin
>            Assignee: Dmitry Tolpeko
>            Priority: Critical
>         Attachments: HIVE-17031.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered writing a reporting script that would aggregate values and give rows different classifications based on an the aggregate. Addressing some or all of these issues would make HPL/SQL more accessible to newcomers.
> In Expression.java:
> {code}
>   public void operatorSub(HplsqlParser.ExprContext ctx) {
>     Var v1 = evalPop(ctx.expr(0));
>     Var v2 = evalPop(ctx.expr(1));
>     if (v1.value == null || v2.value == null) {
>       evalNull();
>     }
>     else if (v1.type == Type.BIGINT && v2.type == Type.BIGINT) {
>       exec.stackPush(new Var((Long)v1.value - (Long)v2.value));
>     }
>     else if (v1.type == Type.DATE && v2.type == Type.BIGINT) {
>       exec.stackPush(changeDateByInt((Date)v1.value, (Long)v2.value, false /*subtract*/));
>     }
>     else if (v1.type == Type.DATE && v2.type == Type.INTERVAL) {
>       exec.stackPush(new Var(((Interval)v2.value).dateChange((Date)v1.value, false /*subtract*/)));
>     }
>     else if (v1.type == Type.TIMESTAMP && v2.type == Type.INTERVAL) {
>       exec.stackPush(new Var(((Interval)v2.value).timestampChange((Timestamp)v1.value, false /*subtract*/), v1.scale));
>     }
>     else {
>       evalNull();
>     }
>   }
> {code}
> So decimals and floating points are not considered. To be fair the docs don't mention this as supported, but it is surprising.
> Need: Test case for comparisons and equality, including nulls
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)