phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3746) NTH_VALUE returns 'null' when aggregating results of aggregate sub-query
Date Mon, 20 Mar 2017 19:06:41 GMT

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

Hadoop QA commented on PHOENIX-3746:
------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12859604/PHOENIX-3476.patch
  against master branch at commit 8093d10f1a481101d6c93fdf0744ff15ec48f4aa.
  ATTACHMENT ID: 12859604

    {color:green}+1 @author{color}.  The patch does not contain any @author tags.

    {color:red}-1 tests included{color}.  The patch doesn't appear to include any new or modified
tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    {color:green}+1 javac{color}.  The applied patch does not increase the total number of
javac compiler warnings.

    {color:red}-1 javadoc{color}.  The javadoc tool appears to have generated 45 warning messages.

    {color:green}+1 release audit{color}.  The applied patch does not increase the total number
of release audit warnings.

    {color:red}-1 lineLengths{color}.  The patch introduces the following lines longer than
100:
    +                "UPSERT INTO " + nth_test_table + " (id, page_id, \"DATE\", \"value\")
VALUES (2, 8, 1, 7)");
+                "UPSERT INTO " + nth_test_table + " (id, page_id, \"DATE\", \"value\") VALUES
(3, 9, 2, 9)");
+                "UPSERT INTO " + nth_test_table + " (id, page_id, \"DATE\", \"value\") VALUES
(4, 9, 3, 4)");
+                "UPSERT INTO " + nth_test_table + " (id, page_id, \"DATE\", \"value\") VALUES
(5, 10, 4, 2)");

     {color:red}-1 core tests{color}.  The patch failed these unit tests:
     ./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.end2end.RegexBulkLoadToolIT

Test results: https://builds.apache.org/job/PreCommit-PHOENIX-Build/808//testReport/
Javadoc warnings: https://builds.apache.org/job/PreCommit-PHOENIX-Build/808//artifact/patchprocess/patchJavadocWarnings.txt
Console output: https://builds.apache.org/job/PreCommit-PHOENIX-Build/808//console

This message is automatically generated.

> NTH_VALUE returns 'null' when aggregating results of aggregate sub-query
> ------------------------------------------------------------------------
>
>                 Key: PHOENIX-3746
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3746
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.9.0
>            Reporter: Matthew Silverman
>         Attachments: PHOENIX-3476.patch
>
>
> {code:sql}
> CREATE TABLE IF NOT EXISTS TEST_TABLE (id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG,
"DATE" INTEGER, "value" UNSIGNED_LONG);
>        
> UPSERT INTO TEST_TABLE (id, page_id, "DATE", "value") VALUES (1, 8, 0, 300);
> UPSERT INTO TEST_TABLE (id, page_id, "DATE", "value") VALUES (2, 8, 1, 7);
> UPSERT INTO TEST_TABLE (id, page_id, "DATE", "value") VALUES (3, 9, 2, 9);
> UPSERT INTO TEST_TABLE (id, page_id, "DATE", "value") VALUES (4, 9, 3, 4);
> UPSERT INTO TEST_TABLE (id, page_id, "DATE", "value") VALUES (5, 10, 4, 2);
> UPSERT INTO TEST_TABLE (id, page_id, "DATE", "value") VALUES (6, 10, 5, 150);
> SELECT NTH_VALUE(SUM_VALUE, 2) WITHIN GROUP (ORDER BY MIN_DATE DESC) FROM
>  (SELECT MIN("DATE") AS MIN_DATE, SUM("value") AS SUM_VALUE FROM TEST_TABLE GROUP BY
page_id) x;
> +--------------------------------------+
> | null(MIN_DATE, false, SUM_VALUE, 2)  |
> +--------------------------------------+
> | null                                 |
> +--------------------------------------+
> {code}
> I would have expected '13' to be returned, as it is equal to 4+9.
> It appears that the {{offset}} field of the server-side aggregator is being reset on
every call to {{reset()}}, when it should persist permanently on the aggregator once set.
 I have attached the above example as an integration test, together with a potential fix.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message