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

alias name which is the same to existing column name may cause NPE during PPD

    Details

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

      Description

      The following query will cause NPE. I attached the stacktrace.

        SELECT
          T1.l_orderkey
        FROM
          LINEITEM
        INNER JOIN (
          SELECT
            T1.l_orderkey
          FROM (
            SELECT
              LINEITEM.l_orderkey AS l_orderkey
            FROM
              LINEITEM
          ) T1
        ) T1 ON LINEITEM.l_orderkey=T1.l_orderkey
      
      2014-07-24 13:58:40,866 ERROR: org.apache.tajo.master.GlobalEngine (executeQuery(150)) - 
      Stack Trace:
      java.lang.NullPointerException
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule$TargetListManager.getTarget(ProjectionPushDownRule.java:311)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule$TargetListManager$FilteredTargetIterator.<init>(ProjectionPushDownRule.java:362)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule$TargetListManager.getFilteredTargets(ProjectionPushDownRule.java:352)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitScan(ProjectionPushDownRule.java:1053)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitScan(ProjectionPushDownRule.java:43)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:102)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitProjection(BasicLogicalPlanVisitor.java:155)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitProjection(ProjectionPushDownRule.java:457)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitProjection(ProjectionPushDownRule.java:43)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:63)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitTableSubQuery(BasicLogicalPlanVisitor.java:269)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitTableSubQuery(ProjectionPushDownRule.java:1106)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitTableSubQuery(ProjectionPushDownRule.java:43)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:99)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitProjection(BasicLogicalPlanVisitor.java:155)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitProjection(ProjectionPushDownRule.java:457)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitProjection(ProjectionPushDownRule.java:43)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:63)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitTableSubQuery(BasicLogicalPlanVisitor.java:269)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitTableSubQuery(ProjectionPushDownRule.java:1106)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitTableSubQuery(ProjectionPushDownRule.java:43)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:99)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitJoin(ProjectionPushDownRule.java:888)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitJoin(ProjectionPushDownRule.java:43)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:87)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitProjection(BasicLogicalPlanVisitor.java:155)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitProjection(ProjectionPushDownRule.java:457)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitProjection(ProjectionPushDownRule.java:43)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:63)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitRoot(BasicLogicalPlanVisitor.java:145)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitRoot(ProjectionPushDownRule.java:440)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.visitRoot(ProjectionPushDownRule.java:43)
      	at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:58)
      	at org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule.rewrite(ProjectionPushDownRule.java:77)
      	at org.apache.tajo.engine.planner.rewrite.BasicQueryRewriteEngine.rewrite(BasicQueryRewriteEngine.java:63)
      	at org.apache.tajo.engine.planner.LogicalOptimizer.optimize(LogicalOptimizer.java:101)
      	at org.apache.tajo.master.GlobalEngine.createLogicalPlan(GlobalEngine.java:475)
      	at org.apache.tajo.master.GlobalEngine.executeQuery(GlobalEngine.java:145)
      

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/tajo/pull/92

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/92
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Tajo-master-build #324 (See https://builds.apache.org/job/Tajo-master-build/324/)
          TAJO-975: alias name which is the same to existing column name may cause NPE during PPD. (hyunsik: rev ae384685f5c16853d47cc4a9a611729dfe2b14fc)

          • tajo-core/src/test/resources/results/TestSelectQuery/testSelectColumnAliasExistingInRelation3.result
          • CHANGES
          • tajo-core/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation3.sql
          • tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
          • tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #324 (See https://builds.apache.org/job/Tajo-master-build/324/ ) TAJO-975 : alias name which is the same to existing column name may cause NPE during PPD. (hyunsik: rev ae384685f5c16853d47cc4a9a611729dfe2b14fc) tajo-core/src/test/resources/results/TestSelectQuery/testSelectColumnAliasExistingInRelation3.result CHANGES tajo-core/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation3.sql tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java
          Hide
          hyunsik Hyunsik Choi added a comment -

          I've just committed it to master branch. Thank you for the review.

          Show
          hyunsik Hyunsik Choi added a comment - I've just committed it to master branch. Thank you for the review.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user blrunner commented on the pull request:

          https://github.com/apache/tajo/pull/92#issuecomment-51021619

          +1

          Thanks your contribution.
          It looks good overall, and 'mvn clean install' finished successfully.

          Show
          githubbot ASF GitHub Bot added a comment - Github user blrunner commented on the pull request: https://github.com/apache/tajo/pull/92#issuecomment-51021619 +1 Thanks your contribution. It looks good overall, and 'mvn clean install' finished successfully.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on the pull request:

          https://github.com/apache/tajo/pull/92#issuecomment-51014781

          rebased.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/92#issuecomment-51014781 rebased.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on the pull request:

          https://github.com/apache/tajo/pull/92#issuecomment-49968315

          This patch is the first work. It's still ongoing work. I'll add more comments and cleanup the related parts shortly.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/92#issuecomment-49968315 This patch is the first work. It's still ongoing work. I'll add more comments and cleanup the related parts shortly.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user hyunsik opened a pull request:

          https://github.com/apache/tajo/pull/92

          TAJO-975: alias name which is the same to existing column name may cause...

          ... NPE during PPD.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/hyunsik/tajo TAJO-975

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/tajo/pull/92.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #92


          commit 3680e13dd18be3c79f0f448207ce3c659c7e8e17
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2014-07-24T05:07:35Z

          TAJO-975: alias name which is the same to existing column name may cause NPE during PPD.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/92 TAJO-975 : alias name which is the same to existing column name may cause... ... NPE during PPD. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-975 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/92.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #92 commit 3680e13dd18be3c79f0f448207ce3c659c7e8e17 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2014-07-24T05:07:35Z TAJO-975 : alias name which is the same to existing column name may cause NPE during PPD.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development