Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1232

Implicit groupby queries with LIMIT lead to wrong results.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.0
    • Component/s: Planner/Optimizer
    • Labels:
      None

      Description

      See the title. The following query will reproduce the problem.

      SELECT sum(x) FROM T1 LIMIT 1;
      > 0
      

      Regardless of the actual summation result, the query result always is 0.

      1. TAJO-1232_2.patch
        5 kB
        Jihoon Son
      2. TAJO-1232.patch
        5 kB
        Jihoon Son

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #512 (See https://builds.apache.org/job/Tajo-master-build/512/)
        TAJO-1232: Implicit groupby queries with LIMIT lead to wrong results. (jihoon) (jihoonson: rev af4083bfd337bfd6fe8278b0363c987d19088e50)

        • tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit1.sql
        • tajo-core/src/main/java/org/apache/tajo/master/GlobalEngine.java
        • tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit2.result
        • tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit3.result
        • tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit1.result
        • CHANGES
        • tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java
        • tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit3.sql
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
        • tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit2.sql
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #512 (See https://builds.apache.org/job/Tajo-master-build/512/ ) TAJO-1232 : Implicit groupby queries with LIMIT lead to wrong results. (jihoon) (jihoonson: rev af4083bfd337bfd6fe8278b0363c987d19088e50) tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit1.sql tajo-core/src/main/java/org/apache/tajo/master/GlobalEngine.java tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit2.result tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit3.result tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit1.result CHANGES tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit3.sql tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit2.sql
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Tajo-master-CODEGEN-build #152 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/152/)
        TAJO-1232: Implicit groupby queries with LIMIT lead to wrong results. (jihoon) (jihoonson: rev af4083bfd337bfd6fe8278b0363c987d19088e50)

        • tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit1.sql
        • tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit2.sql
        • tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit3.result
        • tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit1.result
        • CHANGES
        • tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit2.result
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
        • tajo-core/src/main/java/org/apache/tajo/master/GlobalEngine.java
        • tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java
        • tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit3.sql
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-CODEGEN-build #152 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/152/ ) TAJO-1232 : Implicit groupby queries with LIMIT lead to wrong results. (jihoon) (jihoonson: rev af4083bfd337bfd6fe8278b0363c987d19088e50) tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit1.sql tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit2.sql tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit3.result tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit1.result CHANGES tajo-core/src/test/resources/results/TestGroupByQuery/testGroupbyWithLimit2.result tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java tajo-core/src/main/java/org/apache/tajo/master/GlobalEngine.java tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupbyWithLimit3.sql
        Hide
        jihoonson Jihoon Son added a comment -

        Committed to the master branch

        Show
        jihoonson Jihoon Son added a comment - Committed to the master branch
        Hide
        jihoonson Jihoon Son added a comment -

        I have added comments on changes.

        Show
        jihoonson Jihoon Son added a comment - I have added comments on changes.
        Hide
        jihoonson Jihoon Son added a comment -

        Thanks for your comment.
        I will happily add comments before commit.

        Show
        jihoonson Jihoon Son added a comment - Thanks for your comment. I will happily add comments before commit.
        Hide
        hyunsik Hyunsik Choi added a comment -

        +1
        The patch looks good to me. Could you add some comments on the changes before committing it?

        Show
        hyunsik Hyunsik Choi added a comment - +1 The patch looks good to me. Could you add some comments on the changes before committing it?
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12687962/TAJO-1232.patch
        against master revision release-0.9.0-rc0-100-g5c852b7.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 7 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

        +1 checkstyle. The patch generated 0 code style errors.

        -1 findbugs. The patch appears to cause Findbugs (version 2.0.3) to fail.

        -1 release audit. The applied patch generated 541 release audit warnings.

        +1 core tests. The patch passed unit tests in tajo-core tajo-plan.

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/548//testReport/
        Release audit warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/548//artifact/incubator-tajo/patchprocess/patchReleaseAuditProblems.txt
        Findbugs results: https://builds.apache.org/job/PreCommit-TAJO-Build/548//findbugsResult
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/548//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12687962/TAJO-1232.patch against master revision release-0.9.0-rc0-100-g5c852b7. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 7 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. -1 findbugs. The patch appears to cause Findbugs (version 2.0.3) to fail. -1 release audit. The applied patch generated 541 release audit warnings. +1 core tests. The patch passed unit tests in tajo-core tajo-plan. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/548//testReport/ Release audit warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/548//artifact/incubator-tajo/patchprocess/patchReleaseAuditProblems.txt Findbugs results: https://builds.apache.org/job/PreCommit-TAJO-Build/548//findbugsResult Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/548//console This message is automatically generated.
        Hide
        jihoonson Jihoon Son added a comment -

        I have simply pushed the GroupbyNode down below the LimitNode.

        Show
        jihoonson Jihoon Son added a comment - I have simply pushed the GroupbyNode down below the LimitNode.

          People

          • Assignee:
            jihoonson Jihoon Son
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development