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

LogicalPlanner::convertDataType causes NPE in some cases.

    Details

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

      Description

      SELECT x, p::interval, to_timestamp(time), to_timestamp(utc / 1000) FROM (SELECT u.x, time - (utc / 1000) as p, time, utc FROM T1 l JOIN T2 u ON l.x = u.x) T WHERE p < 0
      
      2014-10-06 15:17:42,334 ERROR org.apache.tajo.master.GlobalEngine:
      Stack Trace:
      java.lang.NullPointerException
        at org.apache.tajo.engine.planner.LogicalPlanner.convertDataType(LogicalPlanner.java:1836)
        at org.apache.tajo.engine.planner.TypeDeterminant.visitUnaryOperator(TypeDeterminant.java:60)
        at org.apache.tajo.engine.planner.TypeDeterminant.visitUnaryOperator(TypeDeterminant.java:37)
        at org.apache.tajo.engine.planner.SimpleAlgebraVisitor.visit(SimpleAlgebraVisitor.java:34)
        at org.apache.tajo.engine.planner.TypeDeterminant.determineDataType(TypeDeterminant.java:46)
        at org.apache.tajo.engine.planner.LogicalPlanPreprocessor.visitProjection(LogicalPlanPreprocessor.java:208)
        at org.apache.tajo.engine.planner.LogicalPlanPreprocessor.visitProjection(LogicalPlanPreprocessor.java:40)
        at org.apache.tajo.engine.planner.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:55)
        at org.apache.tajo.engine.planner.LogicalPlanner.createPlan(LogicalPlanner.java:129)
        at org.apache.tajo.engine.planner.LogicalPlanner.createPlan(LogicalPlanner.java:119)
        at org.apache.tajo.master.GlobalEngine.createLogicalPlan(GlobalEngine.java:497)
      

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-block_iteration-branch-build #15 (See https://builds.apache.org/job/Tajo-block_iteration-branch-build/15/)
        TAJO-1099: LogicalPlanner::convertDataType causes NPE in some cases. (hyunsik: rev 561edf3cb5328a5582d743e96ab596da347c1b90)

        • tajo-core/src/main/java/org/apache/tajo/engine/planner/TypeDeterminant.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
        • tajo-core/src/main/java/org/apache/tajo/engine/optimizer/eval/EvalTreeOptimizer.java
        • tajo-core/src/main/java/org/apache/tajo/engine/eval/SimpleEvalNodeVisitor.java
        • CHANGES
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/EvalExprNode.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-block_iteration-branch-build #15 (See https://builds.apache.org/job/Tajo-block_iteration-branch-build/15/ ) TAJO-1099 : LogicalPlanner::convertDataType causes NPE in some cases. (hyunsik: rev 561edf3cb5328a5582d743e96ab596da347c1b90) tajo-core/src/main/java/org/apache/tajo/engine/planner/TypeDeterminant.java tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java tajo-core/src/main/java/org/apache/tajo/engine/optimizer/eval/EvalTreeOptimizer.java tajo-core/src/main/java/org/apache/tajo/engine/eval/SimpleEvalNodeVisitor.java CHANGES tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/EvalExprNode.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-CODEGEN-build #41 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/41/)
        TAJO-1099: LogicalPlanner::convertDataType causes NPE in some cases. (hyunsik: rev 561edf3cb5328a5582d743e96ab596da347c1b90)

        • tajo-core/src/main/java/org/apache/tajo/engine/optimizer/eval/EvalTreeOptimizer.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/TypeDeterminant.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/EvalExprNode.java
        • CHANGES
        • tajo-core/src/main/java/org/apache/tajo/engine/eval/SimpleEvalNodeVisitor.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-CODEGEN-build #41 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/41/ ) TAJO-1099 : LogicalPlanner::convertDataType causes NPE in some cases. (hyunsik: rev 561edf3cb5328a5582d743e96ab596da347c1b90) tajo-core/src/main/java/org/apache/tajo/engine/optimizer/eval/EvalTreeOptimizer.java tajo-core/src/main/java/org/apache/tajo/engine/planner/TypeDeterminant.java tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/EvalExprNode.java CHANGES tajo-core/src/main/java/org/apache/tajo/engine/eval/SimpleEvalNodeVisitor.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #399 (See https://builds.apache.org/job/Tajo-master-build/399/)
        TAJO-1099: LogicalPlanner::convertDataType causes NPE in some cases. (hyunsik: rev 561edf3cb5328a5582d743e96ab596da347c1b90)

        • CHANGES
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/EvalExprNode.java
        • tajo-core/src/main/java/org/apache/tajo/engine/eval/SimpleEvalNodeVisitor.java
        • tajo-core/src/main/java/org/apache/tajo/engine/optimizer/eval/EvalTreeOptimizer.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/TypeDeterminant.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #399 (See https://builds.apache.org/job/Tajo-master-build/399/ ) TAJO-1099 : LogicalPlanner::convertDataType causes NPE in some cases. (hyunsik: rev 561edf3cb5328a5582d743e96ab596da347c1b90) CHANGES tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/EvalExprNode.java tajo-core/src/main/java/org/apache/tajo/engine/eval/SimpleEvalNodeVisitor.java tajo-core/src/main/java/org/apache/tajo/engine/optimizer/eval/EvalTreeOptimizer.java tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java tajo-core/src/main/java/org/apache/tajo/engine/planner/TypeDeterminant.java
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

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

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/185
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed it to master branch.

        Show
        hyunsik Hyunsik Choi added a comment - committed it to master branch.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user blrunner commented on the pull request:

        https://github.com/apache/tajo/pull/185#issuecomment-58303619

        +1

        Hi @hyunsik

        Thank you for your contribution.
        It looks good overall and all unit test passed successfully.

        Show
        githubbot ASF GitHub Bot added a comment - Github user blrunner commented on the pull request: https://github.com/apache/tajo/pull/185#issuecomment-58303619 +1 Hi @hyunsik Thank you for your contribution. It looks good overall and all unit test passed successfully.
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user hyunsik opened a pull request:

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

        TAJO-1099: LogicalPlanner::convertDataType causes NPE in some cases.

        So far, ExprTestBase has not passed through TypeDeterminant in LogicalPlanPreprocessor. So, unit tests haven't caused this problems.

        I fixed the bug and modified LogicalPlanPreprocessor to pass TypeDeterminant in LogicalPlanPreprocessor. As a result, even though this patch does not include any unit tests, it is same as all ExprTestBase tests verify this problem.

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

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

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

        https://github.com/apache/tajo/pull/185.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 #185


        commit 98a9cfa4778c1bbd035157865e28f57c10622cee
        Author: Hyunsik Choi <hyunsik@apache.org>
        Date: 2014-10-07T17:09:20Z

        TAJO-1099: LogicalPlanner::convertDataType causes NPE in some cases.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/185 TAJO-1099 : LogicalPlanner::convertDataType causes NPE in some cases. So far, ExprTestBase has not passed through TypeDeterminant in LogicalPlanPreprocessor. So, unit tests haven't caused this problems. I fixed the bug and modified LogicalPlanPreprocessor to pass TypeDeterminant in LogicalPlanPreprocessor. As a result, even though this patch does not include any unit tests, it is same as all ExprTestBase tests verify this problem. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-1099 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/185.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 #185 commit 98a9cfa4778c1bbd035157865e28f57c10622cee Author: Hyunsik Choi <hyunsik@apache.org> Date: 2014-10-07T17:09:20Z TAJO-1099 : LogicalPlanner::convertDataType causes NPE in some cases.
        Hide
        hyunsik Hyunsik Choi added a comment -

        The cast p::interval may be cause of this bug. When I remove p::interval, it works well.

        Show
        hyunsik Hyunsik Choi added a comment - The cast p::interval may be cause of this bug. When I remove p::interval, it works well.

          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