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

complex join conditions should be supported in ON clause

    Details

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

      Description

      join condition can be complex expressions instead of simple equi-join condition of fields.

      See the example where t3.id is INT4 and t4.id INT8. In this case, t3.id and t4.id are different but compatible to each other. In this case, current planner handles the expression incorrectly.

      select * from table3 t3 join table4 t4 on t3.id = t4.id;
      

      Also, please see the following example. Currently, the following join condition does not work.

      select * from table3 t3 join table4 t4 on substr(t3.key, 1, 4) = t4.key;
      

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user hyunsik opened a pull request:

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

        TAJO-884: complex join conditions should be supported in ON clause.

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

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

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

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


        commit 4965cd6a36e13accc4541b7aae8a3582988c42e3
        Author: Hyunsik Choi <hyunsik@apache.org>
        Date: 2014-06-23T08:54:00Z

        TAJO-884: complex join conditions should be supported in ON clause.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/44 TAJO-884 : complex join conditions should be supported in ON clause. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-884 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/44.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 #44 commit 4965cd6a36e13accc4541b7aae8a3582988c42e3 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2014-06-23T08:54:00Z TAJO-884 : complex join conditions should be supported in ON clause.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/44#issuecomment-46952845

        I rebased the patch against the latest revision.

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/44#issuecomment-46952845 I rebased the patch against the latest revision.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jinossy commented on the pull request:

        https://github.com/apache/tajo/pull/44#issuecomment-47180029

        +1
        Looks great to me. I've verified 'mvn clean install'.

        Show
        githubbot ASF GitHub Bot added a comment - Github user jinossy commented on the pull request: https://github.com/apache/tajo/pull/44#issuecomment-47180029 +1 Looks great to me. I've verified 'mvn clean install'.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

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

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

        committed.

        Show
        hyunsik Hyunsik Choi added a comment - committed.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #265 (See https://builds.apache.org/job/Tajo-master-build/265/)
        TAJO-884: complex join conditions should be supported in ON clause. (hyunsik: rev b3758361335a4cd26d8b7b9d18879b2b35f612fb)

        • tajo-core/src/test/resources/queries/TestJoinBroadcast/testLeftOuterJoinWithConstantExpr3.sql
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlan.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java
        • CHANGES
        • tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition1.sql
        • tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition4.sql
        • tajo-core/src/test/resources/queries/TestJoinQuery/table1_int4_ddl.sql
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestCreateTable.java
        • tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition3.result
        • tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition2.sql
        • tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr3.sql
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprAnnotator.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
        • tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition4.result
        • tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition2.result
        • tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition1.result
        • tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/join/JoinGraph.java
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
        • tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition3.sql
        • tajo-core/src/test/resources/results/TestJoinQuery/testDifferentTypesJoinCondition.result
        • tajo-core/src/test/resources/queries/TestJoinQuery/testDifferentTypesJoinCondition.sql
        • tajo-core/src/test/resources/queries/TestJoinQuery/table1_int8_ddl.sql
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #265 (See https://builds.apache.org/job/Tajo-master-build/265/ ) TAJO-884 : complex join conditions should be supported in ON clause. (hyunsik: rev b3758361335a4cd26d8b7b9d18879b2b35f612fb) tajo-core/src/test/resources/queries/TestJoinBroadcast/testLeftOuterJoinWithConstantExpr3.sql tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlan.java tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java CHANGES tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition1.sql tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition4.sql tajo-core/src/test/resources/queries/TestJoinQuery/table1_int4_ddl.sql tajo-core/src/test/java/org/apache/tajo/engine/query/TestCreateTable.java tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition3.result tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition2.sql tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr3.sql tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprAnnotator.java tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition4.result tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition2.result tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition1.result tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.java tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/join/JoinGraph.java tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition3.sql tajo-core/src/test/resources/results/TestJoinQuery/testDifferentTypesJoinCondition.result tajo-core/src/test/resources/queries/TestJoinQuery/testDifferentTypesJoinCondition.sql tajo-core/src/test/resources/queries/TestJoinQuery/table1_int8_ddl.sql

          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