You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by ji...@apache.org on 2017/07/20 19:57:13 UTC

incubator-quickstep git commit: Ensure Physical node with partitioned inputs has partitioned output, if possible.

Repository: incubator-quickstep
Updated Branches:
  refs/heads/master 174b92c80 -> beda9cb84


Ensure Physical node with partitioned inputs has partitioned output, if possible.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/beda9cb8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/beda9cb8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/beda9cb8

Branch: refs/heads/master
Commit: beda9cb8476020ad08c638b1cbf408aa2683c0a9
Parents: 174b92c
Author: Zuyu Zhang <zu...@cs.wisc.edu>
Authored: Tue Jul 18 15:28:44 2017 -0500
Committer: Zuyu Zhang <zu...@cs.wisc.edu>
Committed: Tue Jul 18 15:28:44 2017 -0500

----------------------------------------------------------------------
 query_optimizer/rules/Partition.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/beda9cb8/query_optimizer/rules/Partition.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/rules/Partition.cpp b/query_optimizer/rules/Partition.cpp
index 4ecdc4a..fd4deb3 100644
--- a/query_optimizer/rules/Partition.cpp
+++ b/query_optimizer/rules/Partition.cpp
@@ -490,10 +490,9 @@ P::PhysicalPtr Partition::applyToNode(const P::PhysicalPtr &node) {
                                    hash_join->project_expressions(),
                                    hash_join->join_type(),
                                    output_partition_scheme_header.release());
-      } else if (left_partition_scheme_header) {
-        return hash_join->copyWithNewOutputPartitionSchemeHeader(output_partition_scheme_header.release());
       }
-      break;
+
+      return hash_join->copyWithNewOutputPartitionSchemeHeader(output_partition_scheme_header.release());
     }
     case P::PhysicalType::kNestedLoopsJoin: {
       const P::NestedLoopsJoinPtr nested_loops_join = static_pointer_cast<const P::NestedLoopsJoin>(node);
@@ -549,7 +548,11 @@ P::PhysicalPtr Partition::applyToNode(const P::PhysicalPtr &node) {
           return selection->copyWithNewOutputPartitionSchemeHeader(output_partition_scheme_header.release());
         }
       }
-      break;
+
+      // TODO(quickstep-team): Check RangePartitionSchemeHeader against the project expressions.
+      DCHECK(input_partition_scheme_header->partition_type != P::PartitionSchemeHeader::PartitionType::kRange);
+      auto output_partition_scheme_header = make_unique<P::PartitionSchemeHeader>(*input_partition_scheme_header);
+      return selection->copyWithNewOutputPartitionSchemeHeader(output_partition_scheme_header.release());
     }
     default:
       break;