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

Complex join conditions with UNION or inline should be supported

    Details

      Description

      Please see the following two example queries. Currently, they will cause planning exception. This patch fixes the bugs.

      select
        n1.n_nationkey,
        substr(n1.n_name, 1, 4) name1,
        substr(n2.n_name, 1, 4) name2
      from nation n1 join (select * from nation) n2 on substr(n1.n_name, 1, 4) = substr(n2.n_name, 1, 4)
      order by n1.n_nationkey;
      
      select
        n1.n_nationkey,
        substr(n1.n_name, 1, 4) name1,
        substr(n2.n_name, 1, 4) name2
      from nation n1 join (select * from nation union select * from nation) n2 on substr(n1.n_name, 1, 4) = substr(n2.n_name, 1, 4)
      order by n1.n_nationkey;
      

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #274 (See https://builds.apache.org/job/Tajo-master-build/274/)
        TAJO-891: Complex join conditions with UNION or inline should be supported. (hyunsik: rev eae4c132363a63240d93c5522e48b44e45d9553d)

        • tajo-core/src/main/java/org/apache/tajo/engine/planner/PlannerUtil.java
        • tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition5.result
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java
        • tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition6.sql
        • tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition5.sql
        • tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition7.sql
        • CHANGES
        • tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition6.result
        • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java
        • tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition7.result
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #274 (See https://builds.apache.org/job/Tajo-master-build/274/ ) TAJO-891 : Complex join conditions with UNION or inline should be supported. (hyunsik: rev eae4c132363a63240d93c5522e48b44e45d9553d) tajo-core/src/main/java/org/apache/tajo/engine/planner/PlannerUtil.java tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition5.result tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition6.sql tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition5.sql tajo-core/src/test/resources/queries/TestJoinQuery/testComplexJoinCondition7.sql CHANGES tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition6.result tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java tajo-core/src/test/resources/results/TestJoinQuery/testComplexJoinCondition7.result tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

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

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

        committed to master.

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

        Github user jinossy commented on the pull request:

        https://github.com/apache/tajo/pull/49#issuecomment-47642574

        +1
        Looks great! 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/49#issuecomment-47642574 +1 Looks great! I've verified 'mvn clean install'.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/49#issuecomment-47313674

        I've rebased and fixed some additional bugs.

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/49#issuecomment-47313674 I've rebased and fixed some additional bugs.
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user hyunsik opened a pull request:

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

        TAJO-891: Complex join conditions with UNION or inline should be support...

        ...ed.

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

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

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

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


        commit 83b5eb12f79502cff370539f7e9dd3308f049d33
        Author: Hyunsik Choi <hyunsik@apache.org>
        Date: 2014-06-26T10:11:20Z

        TAJO-891: Complex join conditions with UNION or inline should be supported.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/49 TAJO-891 : Complex join conditions with UNION or inline should be support... ...ed. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-891 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/49.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 #49 commit 83b5eb12f79502cff370539f7e9dd3308f049d33 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2014-06-26T10:11:20Z TAJO-891 : Complex join conditions with UNION or inline should be supported.

          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