quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianq...@apache.org
Subject incubator-quickstep git commit: Added Partition rules for Sort.
Date Mon, 11 Sep 2017 20:14:52 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/master 298165115 -> 4578c63f0


Added Partition rules for Sort.


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

Branch: refs/heads/master
Commit: 4578c63f06d7e0d2b9c5d60eb7bfeb33cb678bd8
Parents: 2981651
Author: Zuyu Zhang <zuyu@cs.wisc.edu>
Authored: Mon Sep 4 19:59:45 2017 -0500
Committer: Zuyu Zhang <zuyu@cs.wisc.edu>
Committed: Mon Sep 4 19:59:45 2017 -0500

----------------------------------------------------------------------
 query_optimizer/rules/CMakeLists.txt |  1 +
 query_optimizer/rules/Partition.cpp  | 11 +++++++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/4578c63f/query_optimizer/rules/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/query_optimizer/rules/CMakeLists.txt b/query_optimizer/rules/CMakeLists.txt
index 7abe0d1..73a80d2 100644
--- a/query_optimizer/rules/CMakeLists.txt
+++ b/query_optimizer/rules/CMakeLists.txt
@@ -182,6 +182,7 @@ target_link_libraries(quickstep_queryoptimizer_rules_Partition
                       quickstep_queryoptimizer_physical_Physical
                       quickstep_queryoptimizer_physical_PhysicalType
                       quickstep_queryoptimizer_physical_Selection
+                      quickstep_queryoptimizer_physical_Sort
                       quickstep_queryoptimizer_physical_TableReference
                       quickstep_queryoptimizer_physical_TopLevelPlan
                       quickstep_queryoptimizer_rules_BottomUpRule

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/4578c63f/query_optimizer/rules/Partition.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/rules/Partition.cpp b/query_optimizer/rules/Partition.cpp
index 5f8b2c6..5f68cd3 100644
--- a/query_optimizer/rules/Partition.cpp
+++ b/query_optimizer/rules/Partition.cpp
@@ -46,6 +46,7 @@
 #include "query_optimizer/physical/Physical.hpp"
 #include "query_optimizer/physical/PhysicalType.hpp"
 #include "query_optimizer/physical/Selection.hpp"
+#include "query_optimizer/physical/Sort.hpp"
 #include "query_optimizer/physical/TableReference.hpp"
 #include "query_optimizer/physical/TopLevelPlan.hpp"
 #include "types/operations/binary_operations/BinaryOperation.hpp"
@@ -566,6 +567,16 @@ P::PhysicalPtr Partition::applyToNode(const P::PhysicalPtr &node)
{
       return selection->copyWithNewOutputPartitionSchemeHeader(output_partition_scheme_header.release(),
                                                                false /* has_repartition */);
     }
+    case P::PhysicalType::kSort: {
+      const P::SortPtr sort = static_pointer_cast<const P::Sort>(node);
+      const P::PhysicalPtr input = sort->input();
+      if (P::SomeTableReference::Matches(input) ||
+          !input->getOutputPartitionSchemeHeader()) {
+        break;
+      }
+
+      return sort->copyWithNewChildren({ input->copyWithNewOutputPartitionSchemeHeader(nullptr)
});
+    }
     default:
       break;
   }


Mime
View raw message