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

The same expressions without different alias are not allowed.

    Details

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

      Description

      Currently, LogicalPlanner and ProjectionPushDownRule do not allow the same expressions with different alias names. The following query is an example of this restriction.

      select l_orderkey + 1 as total1, orderkey + 1 as total2 from ..
      

      The main cause of this bug is that NamedExprManager and TargetListManager only keep 1:1 mapping relationship between alias and expression. This patch changes them to keep 1:N mapping relationship.

      1. TAJO-595_140217_172537.patch
        125 kB
        Hyunsik Choi
      2. TAJO-595_20140217_14:04:25.patch
        125 kB
        Hyunsik Choi
      3. TAJO-595_20140217_14:33:31.patch
        126 kB
        Hyunsik Choi
      4. TAJO-595_20140217_14:56:20.patch
        126 kB
        Hyunsik Choi
      5. TAJO-595.patch
        102 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/18075/

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

        This patch also includes the verification code for the aforementioned error case. Those verification routines prevent the execution of the wrong plan to cause error in distributed execution phase.

        Show
        hyunsik Hyunsik Choi added a comment - This patch also includes the verification code for the aforementioned error case. Those verification routines prevent the execution of the wrong plan to cause error in distributed execution phase.
        Hide
        hyunsik Hyunsik Choi added a comment -

        Updated the review request against branch master in reviewboard
        https://reviews.apache.org/r/18075/

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

        Updated the review request against branch master in reviewboard

        Show
        hyunsik Hyunsik Choi added a comment - Updated the review request against branch master in reviewboard
        Hide
        hyunsik Hyunsik Choi added a comment -

        Updated the review request against branch master in reviewboard

        Show
        hyunsik Hyunsik Choi added a comment - Updated the review request against branch master in reviewboard
        Hide
        hyunsik Hyunsik Choi added a comment -

        Removed ExprVerifierContext and changed ExprsVerifier to use VerificationState like before.

        Updated the review request against branch master in reviewboard
        https://reviews.apache.org/r/18075/

        Show
        hyunsik Hyunsik Choi added a comment - Removed ExprVerifierContext and changed ExprsVerifier to use VerificationState like before. Updated the review request against branch master in reviewboard https://reviews.apache.org/r/18075/
        Hide
        hyunsik Hyunsik Choi added a comment -

        This issue got +1 on RB. committed it to the master branch.

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

        SUCCESS: Integrated in Tajo-master-build #66 (See https://builds.apache.org/job/Tajo-master-build/66/)
        TAJO-595: The same expressions without different alias are not allowed. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=fbc358c2030e78f6616b286cf0736afaa8a583f8)

        • tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testJoinRefEval.result
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/SelectionNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/Projectable.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestSelectQuery/testSelectSameExprsWithDifferentAliases.sql
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/PersistentStoreNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java
        • tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testJoinCoReferredEvalsWithSameExprs2.result
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/PreLogicalPlanVerifier.java
        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestSelectQuery/testSelectAsterisk5.sql
        • tajo-core/tajo-core-backend/src/test/resources/results/TestSelectQuery/testSelectAsterisk5.result
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/PlanString.java
        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/GroupbyNode.java
        • tajo-core/tajo-core-backend/src/test/resources/results/TestGroupByQuery/testGroupByWithSameExprs1.result
        • tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testJoinCoReferredEvals1.result
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/ExceptNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/CreateTableNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/PartitionedTableScanNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/DropTableNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/StoreTableNode.java
        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprsVerifier.java
        • tajo-core/tajo-core-backend/src/test/resources/results/TestJoinOnPartitionedTables/testPartialFilterPushDown.result
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/HavingNode.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestGroupByQuery/testGroupByWithSameExprs2.sql
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/ScanNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/LogicalRootNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/eval/EvalNode.java
        • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/JoinNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/UnionNode.java
        • tajo-core/tajo-core-backend/src/test/resources/results/TestGroupByQuery/testGroupByWithSameExprs2.result
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/PlannerUtil.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testJoinCoReferredEvalsWithSameExprs2.sql
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlan.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/IntersectNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/SortNode.java
        • CHANGES.txt
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanVerifier.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestGroupByQuery/testGroupByWithSameExprs1.sql
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/LimitNode.java
        • tajo-algebra/src/main/java/org/apache/tajo/algebra/LiteralValue.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/TableSubQueryNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/InsertNode.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/ProjectionNode.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testJoinCoReferredEvalsWithSameExprs1.sql
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalEngine.java
        • tajo-core/tajo-core-backend/src/test/resources/results/TestSelectQuery/testSelectSameConstantsWithDifferentAliases.result
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/NamedExprsManager.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases.sql
        • tajo-core/tajo-core-backend/src/test/resources/results/TestSelectQuery/testSelectSameExprsWithDifferentAliases.result
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testJoinCoReferredEvals1.sql
        • tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testJoinCoReferredEvalsWithSameExprs1.result
        • tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testJoinRefEval.sql
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #66 (See https://builds.apache.org/job/Tajo-master-build/66/ ) TAJO-595 : The same expressions without different alias are not allowed. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=fbc358c2030e78f6616b286cf0736afaa8a583f8 ) tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testJoinRefEval.result tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/SelectionNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/Projectable.java tajo-core/tajo-core-backend/src/test/resources/queries/TestSelectQuery/testSelectSameExprsWithDifferentAliases.sql tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/PersistentStoreNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/Repartitioner.java tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testJoinCoReferredEvalsWithSameExprs2.result tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/PreLogicalPlanVerifier.java tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java tajo-core/tajo-core-backend/src/test/resources/queries/TestSelectQuery/testSelectAsterisk5.sql tajo-core/tajo-core-backend/src/test/resources/results/TestSelectQuery/testSelectAsterisk5.result tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/PlanString.java tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/GroupbyNode.java tajo-core/tajo-core-backend/src/test/resources/results/TestGroupByQuery/testGroupByWithSameExprs1.result tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testJoinCoReferredEvals1.result tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/ExceptNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/CreateTableNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/PartitionedTableScanNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/DropTableNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/StoreTableNode.java tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprsVerifier.java tajo-core/tajo-core-backend/src/test/resources/results/TestJoinOnPartitionedTables/testPartialFilterPushDown.result tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/HavingNode.java tajo-core/tajo-core-backend/src/test/resources/queries/TestGroupByQuery/testGroupByWithSameExprs2.sql tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/ScanNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/LogicalRootNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/eval/EvalNode.java tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/JoinNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/UnionNode.java tajo-core/tajo-core-backend/src/test/resources/results/TestGroupByQuery/testGroupByWithSameExprs2.result tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/PlannerUtil.java tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testJoinCoReferredEvalsWithSameExprs2.sql tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlan.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/IntersectNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/SortNode.java CHANGES.txt tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanVerifier.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java tajo-core/tajo-core-backend/src/test/resources/queries/TestGroupByQuery/testGroupByWithSameExprs1.sql tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/LimitNode.java tajo-algebra/src/main/java/org/apache/tajo/algebra/LiteralValue.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/TableSubQueryNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/InsertNode.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/logical/ProjectionNode.java tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testJoinCoReferredEvalsWithSameExprs1.sql tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/GlobalEngine.java tajo-core/tajo-core-backend/src/test/resources/results/TestSelectQuery/testSelectSameConstantsWithDifferentAliases.result tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/NamedExprsManager.java tajo-core/tajo-core-backend/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases.sql tajo-core/tajo-core-backend/src/test/resources/results/TestSelectQuery/testSelectSameExprsWithDifferentAliases.result tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testJoinCoReferredEvals1.sql tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testJoinCoReferredEvalsWithSameExprs1.result tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testJoinRefEval.sql

          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