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

A complex equality condition including columns of the same table is recognized as a join condition

    Details

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

      Description

      See the following example:

      SELECT 
        t1.str1, t1.str2, t2.abc 
      FROM 
        table1 t1, table2 t2 
      WHERE t1.id = t2.id and substr(t1.str1, 1, 3) = substr(t1.str2, 1,3);
      

      Currently, the expression substr(t1.str1, 1, 3) = substr(t1.str2, 1,3); is also addressed as a join condition. Since it includes columns of the same table, we shouldn't do it.

        Activity

        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 #342 (See https://builds.apache.org/job/Tajo-master-build/342/)
        TAJO-1013: a complex equality condition including columns of the same table is recognized as a join condition. (hyunsik: rev 7c84aeb298919ac0e6a1eb1c469ae830656f17fa)

        • tajo-core/src/test/resources/results/TestSelectQuery/testColumnEqualityButNotJoinCondition2.result
        • tajo-core/src/test/resources/results/TestSelectQuery/testColumnEqualityButNotJoinCondition1.result
        • CHANGES
        • tajo-core/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition2.sql
        • tajo-core/src/test/java/org/apache/tajo/engine/eval/TestEvalTreeUtil.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/join/JoinGraph.java
        • tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.java
        • tajo-core/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition1.sql
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/FilterPushDownRule.java
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprFinder.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #342 (See https://builds.apache.org/job/Tajo-master-build/342/ ) TAJO-1013 : a complex equality condition including columns of the same table is recognized as a join condition. (hyunsik: rev 7c84aeb298919ac0e6a1eb1c469ae830656f17fa) tajo-core/src/test/resources/results/TestSelectQuery/testColumnEqualityButNotJoinCondition2.result tajo-core/src/test/resources/results/TestSelectQuery/testColumnEqualityButNotJoinCondition1.result CHANGES tajo-core/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition2.sql tajo-core/src/test/java/org/apache/tajo/engine/eval/TestEvalTreeUtil.java tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/join/JoinGraph.java tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.java tajo-core/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition1.sql tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/FilterPushDownRule.java tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprFinder.java
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user blrunner commented on the pull request:

        https://github.com/apache/tajo/pull/123#issuecomment-52736347

        +1

        Thanks your contribution.
        It looks good to me 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/123#issuecomment-52736347 +1 Thanks your contribution. It looks good to me and 'mvn clean install' finished successfully.
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user hyunsik opened a pull request:

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

        TAJO-1013: A complex equality condition including columns of the same table is recognized as a join condition.

        See the jira.
        https://issues.apache.org/jira/browse/TAJO-1013

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

        $ git pull https://github.com/hyunsik/tajo 1013

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

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


        commit fb5c8817819a4e29d4406b07874ece30fca4f965
        Author: Hyunsik Choi <hyunsik@apache.org>
        Date: 2014-08-19T16:07:32Z

        Fixed the bug.

        commit 83cdb6e64ab8be4b04d3ff63fb10901c9b2976a3
        Author: Hyunsik Choi <hyunsik@apache.org>
        Date: 2014-08-19T16:16:56Z

        Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-103

        Conflicts:
        tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.java


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/123 TAJO-1013 : A complex equality condition including columns of the same table is recognized as a join condition. See the jira. https://issues.apache.org/jira/browse/TAJO-1013 You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo 1013 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/123.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 #123 commit fb5c8817819a4e29d4406b07874ece30fca4f965 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2014-08-19T16:07:32Z Fixed the bug. commit 83cdb6e64ab8be4b04d3ff63fb10901c9b2976a3 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2014-08-19T16:16:56Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-103 Conflicts: tajo-core/src/main/java/org/apache/tajo/engine/eval/EvalTreeUtil.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