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

InvalidOperationException in outer join with constant values

    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

      select 
        a.name, 
        1::FLOAT, 
        max_id 
      from table1 a
      left outer join
       (select id, max(type) as max_id from table1 group by id) b
       on a.id = b.id
      

      The above case causes the following error:

      2014-01-29 14:37:35,419 ERROR worker.Task (Task.java:run(378)) - org.apache.tajo.datum.exception.InvalidOperationException: Cannot equivalent check: TEXT and INT4
              at org.apache.tajo.datum.TextDatum.equalsTo(TextDatum.java:137)
              at org.apache.tajo.engine.eval.BinaryEval.eval(BinaryEval.java:134)
              at org.apache.tajo.engine.planner.physical.HashLeftOuterJoinExec.next(HashLeftOuterJoinExec.java:144)
              at org.apache.tajo.engine.planner.physical.HashShuffleFileWriteExec.next(HashShuffleFileWriteExec.java:117)
              at org.apache.tajo.worker.Task.run(Task.java:370)
              at org.apache.tajo.worker.TaskRunner$1.run(TaskRunner.java:392)
              at java.lang.Thread.run(Thread.java:662)
      
      1. TAJO-570_2.patch
        14 kB
        Hyunsik Choi
      2. TAJO-570.patch
        14 kB
        Hyunsik Choi

        Activity

        Hide
        hyunsik Hyunsik Choi added a comment - - edited

        The patch includes one improvement and one bug fix related to this bug.

        One improvement is to eliminate constant casting. Currently, a casting operation remains even if the casting is for constant. This improvement removes a constant casting operation and just replaces it by a pre-casted constant value. This improvement does not allow this bug case.

        It also fixes a bug of LogicalPlanner::checkIfBeEvaluatedAtRelation. It works incorrectly if there is no column references (i.e., constant value) which is the same case to this bug. Hyoung jun pointed out this bug in offline, and I included it to this patch.

        Show
        hyunsik Hyunsik Choi added a comment - - edited The patch includes one improvement and one bug fix related to this bug. One improvement is to eliminate constant casting. Currently, a casting operation remains even if the casting is for constant. This improvement removes a constant casting operation and just replaces it by a pre-casted constant value. This improvement does not allow this bug case. It also fixes a bug of LogicalPlanner::checkIfBeEvaluatedAtRelation. It works incorrectly if there is no column references (i.e., constant value) which is the same case to this bug. Hyoung jun pointed out this bug in offline, and I included it to this patch.
        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/12625952/TAJO-570_2.patch
        against master revision 8aa0e55.

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

        +1 tests included. The patch appears to include 3 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 introduce 212 new Findbugs (version 1.3.9) warnings.

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

        +1 core tests. The patch passed unit tests in tajo-common tajo-core/tajo-core-backend.

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/93//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/93//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/93//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-core-backend.html
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/93//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/12625952/TAJO-570_2.patch against master revision 8aa0e55. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 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 introduce 212 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-common tajo-core/tajo-core-backend. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/93//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/93//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/93//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-core-backend.html Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/93//console This message is automatically generated.
        Hide
        jihoonson Jihoon Son added a comment -

        +1 for the last patch.

        Show
        jihoonson Jihoon Son added a comment - +1 for the last patch.
        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
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #46 (See https://builds.apache.org/job/Tajo-master-build/46/)
        TAJO-570: InvalidOperationException in outer join with constant values. (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=8d6e3785d1b151456463961109387dd71657a8c6)

        • tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr3.sql
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/eval/CastEval.java
        • tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr3.result
        • 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/LogicalPlanner.java
        • CHANGES.txt
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprAnnotator.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java
        • tajo-common/src/main/java/org/apache/tajo/datum/DatumFactory.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #46 (See https://builds.apache.org/job/Tajo-master-build/46/ ) TAJO-570 : InvalidOperationException in outer join with constant values. (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=8d6e3785d1b151456463961109387dd71657a8c6 ) tajo-core/tajo-core-backend/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr3.sql tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/eval/CastEval.java tajo-core/tajo-core-backend/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr3.result 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/LogicalPlanner.java CHANGES.txt tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprAnnotator.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java tajo-common/src/main/java/org/apache/tajo/datum/DatumFactory.java

          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