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

SELECT count(1) after joins on text keys causes wrong plans

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0, 0.9.0
    • Component/s: Planner/Optimizer
    • Labels:
      None

      Description

      select count(1) from table1 join table2 on table1.name = table2.name;
      

      When there are constant values in select list and equi-join keys are text columns, it causes some errors due to schema mismatch.

      Its cause of this bug is as follows:

      • the number 1 results in a generated column name '?literal'.
      • This name is used in both table1 and table2. Output schemas of table1 and table2 include ?literal
      • The input schema of join has only three columns because ?literal is duplicated name.

      So, its essential bug may be one of following:

      • The constant value is evaluated twice. In other words, literal? occurs in both table1 and table2.
      • Schema class does not allow the same column name.
      1. TAJO-619.patch
        16 kB
        Hyunsik Choi

        Activity

        Hide
        hyunsik Hyunsik Choi added a comment -

        Created a review request against branch master in reviewboard
        https://reviews.apache.org/r/18396/

        Show
        hyunsik Hyunsik Choi added a comment - Created a review request against branch master in reviewboard https://reviews.apache.org/r/18396/
        Hide
        hyunsik Hyunsik Choi added a comment -

        This issue got +1 on RB. committed it to branch-0.8.0 and master branch.

        Show
        hyunsik Hyunsik Choi added a comment - This issue got +1 on RB. committed it to branch-0.8.0 and master branch.
        Hide
        hudson Hudson added a comment -

        ABORTED: Integrated in Tajo-master-build #84 (See https://builds.apache.org/job/Tajo-master-build/84/)
        TAJO-619: SELECT count(1) after joins on text keys causes wrong plans. (hyunsik: https://git-wip-us.apache.org/repos/asf/?p=incubator-tajo.git&a=commit&h=9cce80cfe585e8b93f86542e38ec5b07972d05d6)

        • tajo-core/tajo-core-backend/src/test/resources/results/TestCaseByCases/testTAJO619Case.result
        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestCaseByCases.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java
        • CHANGES.txt
        • tajo-algebra/src/main/java/org/apache/tajo/algebra/FunctionExpr.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestCaseByCases/testTAJO619Case.sql
        • tajo-algebra/src/main/java/org/apache/tajo/algebra/GeneralSetFunctionExpr.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/LocalTajoTestingUtility.java
        • tajo-algebra/src/main/java/org/apache/tajo/algebra/CountRowsFunctionExpr.java
        • tajo-algebra/src/main/java/org/apache/tajo/algebra/OpType.java
        Show
        hudson Hudson added a comment - ABORTED: Integrated in Tajo-master-build #84 (See https://builds.apache.org/job/Tajo-master-build/84/ ) TAJO-619 : SELECT count(1) after joins on text keys causes wrong plans. (hyunsik: https://git-wip-us.apache.org/repos/asf/?p=incubator-tajo.git&a=commit&h=9cce80cfe585e8b93f86542e38ec5b07972d05d6 ) tajo-core/tajo-core-backend/src/test/resources/results/TestCaseByCases/testTAJO619Case.result tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestCaseByCases.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java CHANGES.txt tajo-algebra/src/main/java/org/apache/tajo/algebra/FunctionExpr.java tajo-core/tajo-core-backend/src/test/resources/queries/TestCaseByCases/testTAJO619Case.sql tajo-algebra/src/main/java/org/apache/tajo/algebra/GeneralSetFunctionExpr.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/LocalTajoTestingUtility.java tajo-algebra/src/main/java/org/apache/tajo/algebra/CountRowsFunctionExpr.java tajo-algebra/src/main/java/org/apache/tajo/algebra/OpType.java

          People

          • Assignee:
            hyunsik Hyunsik Choi
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development