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

Self-join with a partitioned table returns wrong result data.

    Details

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

      Description

      See the following case.

      CREATE TABLE orders_partition
      (o_orderkey INT8, o_custkey INT8, o_totalprice FLOAT8, o_orderpriority TEXT,
        o_clerk TEXT, o_shippriority INT4, o_comment TEXT) USING CSV WITH ('csvfile.delimiter'='|')
      PARTITION BY COLUMN(o_orderdate TEXT, o_orderstatus TEXT);
      
      select a.o_orderstatus, count(*) as cnt
      from orders_partition a
      inner join orders_partition b
      on a.o_orderdate = b.o_orderdate
          and a.o_orderstatus = b.o_orderstatus
          and a.o_orderkey = b.o_orderkey
      where a.o_orderdate='1995-02-21'
      and a.o_orderstatus in ('F')
      group by a.o_orderstatus;
      

      Because of the where condition (where a.o_orderdate='1995-02-21 and a.o_orderstatus in ('F')), orders_partition table aliased 'a' is small and broadcast target table.
      In this case GlobalPlanner can't resolve which table is partitioned table.

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user babokim opened a pull request:

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

        TAJO-1102: Self-join with a partitioned table returns wrong result data.

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

        $ git pull https://github.com/babokim/tajo TAJO-1102

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

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


        commit 4886312282dbff392a84f5f6f3c7569e52f5f2e5
        Author: HyoungJun Kim <babokim@babokim-macbook-pro.local>
        Date: 2014-10-07T12:56:28Z

        TAJO-1102: Self-join with a partitioned table returns wrong result data.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user babokim opened a pull request: https://github.com/apache/tajo/pull/189 TAJO-1102 : Self-join with a partitioned table returns wrong result data. You can merge this pull request into a Git repository by running: $ git pull https://github.com/babokim/tajo TAJO-1102 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/189.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 #189 commit 4886312282dbff392a84f5f6f3c7569e52f5f2e5 Author: HyoungJun Kim <babokim@babokim-macbook-pro.local> Date: 2014-10-07T12:56:28Z TAJO-1102 : Self-join with a partitioned table returns wrong result data.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user blrunner commented on the pull request:

        https://github.com/apache/tajo/pull/189#issuecomment-58298455

        Hi @babokim

        Could you rebase the patch against the master branch?

        Show
        githubbot ASF GitHub Bot added a comment - Github user blrunner commented on the pull request: https://github.com/apache/tajo/pull/189#issuecomment-58298455 Hi @babokim Could you rebase the patch against the master branch?
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user babokim commented on the pull request:

        https://github.com/apache/tajo/pull/189#issuecomment-58320232

        @blrunner I rebased the patch.

        Show
        githubbot ASF GitHub Bot added a comment - Github user babokim commented on the pull request: https://github.com/apache/tajo/pull/189#issuecomment-58320232 @blrunner I rebased the patch.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user blrunner commented on the pull request:

        https://github.com/apache/tajo/pull/189#issuecomment-58336955

        +1

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

        Github user asfgit closed the pull request at:

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

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/189
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #398 (See https://builds.apache.org/job/Tajo-master-build/398/)
        TAJO-1102: Self-join with a partitioned table returns wrong result data. (babokim: rev f42baa005dbf3f4fe64e3f3745616164df9aba65)

        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/ScanNode.java
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinBroadcast.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PartitionedTableScanNode.java
        • CHANGES
        • tajo-core/src/test/resources/results/TestJoinBroadcast/testBroadcastMultiColumnPartitionTableInFilter.result
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #398 (See https://builds.apache.org/job/Tajo-master-build/398/ ) TAJO-1102 : Self-join with a partitioned table returns wrong result data. (babokim: rev f42baa005dbf3f4fe64e3f3745616164df9aba65) tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/ScanNode.java tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinBroadcast.java tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PartitionedTableScanNode.java CHANGES tajo-core/src/test/resources/results/TestJoinBroadcast/testBroadcastMultiColumnPartitionTableInFilter.result
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-CODEGEN-build #40 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/40/)
        TAJO-1102: Self-join with a partitioned table returns wrong result data. (babokim: rev f42baa005dbf3f4fe64e3f3745616164df9aba65)

        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/ScanNode.java
        • CHANGES
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinBroadcast.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PartitionedTableScanNode.java
        • tajo-core/src/test/resources/results/TestJoinBroadcast/testBroadcastMultiColumnPartitionTableInFilter.result
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-CODEGEN-build #40 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/40/ ) TAJO-1102 : Self-join with a partitioned table returns wrong result data. (babokim: rev f42baa005dbf3f4fe64e3f3745616164df9aba65) tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/ScanNode.java CHANGES tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinBroadcast.java tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PartitionedTableScanNode.java tajo-core/src/test/resources/results/TestJoinBroadcast/testBroadcastMultiColumnPartitionTableInFilter.result
        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-1102: Self-join with a partitioned table returns wrong result data. (babokim: rev f42baa005dbf3f4fe64e3f3745616164df9aba65)

        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PartitionedTableScanNode.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/ScanNode.java
        • CHANGES
        • tajo-core/src/test/resources/results/TestJoinBroadcast/testBroadcastMultiColumnPartitionTableInFilter.result
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinBroadcast.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-1102 : Self-join with a partitioned table returns wrong result data. (babokim: rev f42baa005dbf3f4fe64e3f3745616164df9aba65) tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PartitionedTableScanNode.java tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/ScanNode.java CHANGES tajo-core/src/test/resources/results/TestJoinBroadcast/testBroadcastMultiColumnPartitionTableInFilter.result tajo-core/src/test/java/org/apache/tajo/engine/query/TestJoinBroadcast.java

          People

          • Assignee:
            hjkim Hyoungjun Kim
            Reporter:
            hjkim Hyoungjun Kim
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development