[GitHub] incubator-quickstep pull request #234: Add protobuf support for UNION ALL op...

2017-04-20 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-quickstep/pull/234


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-quickstep pull request #234: Add protobuf support for UNION ALL op...

2017-04-20 Thread zuyu
Github user zuyu commented on a diff in the pull request:

https://github.com/apache/incubator-quickstep/pull/234#discussion_r112401278
  
--- Diff: relational_operators/UnionAllOperator.hpp ---
@@ -149,6 +151,11 @@ class UnionAllOperator : public RelationalOperator {
InsertDestination *output_destination,
const std::size_t relation_index);
 
+  // Create work order proto
--- End diff --

No for a private method.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-quickstep pull request #234: Add protobuf support for UNION ALL op...

2017-04-20 Thread zuyu
Github user zuyu commented on a diff in the pull request:

https://github.com/apache/incubator-quickstep/pull/234#discussion_r112400291
  
--- Diff: relational_operators/UnionAllOperator.cpp ---
@@ -128,14 +128,56 @@ bool UnionAllOperator::getAllWorkOrders(
 }
 
 bool UnionAllOperator::getAllWorkOrderProtos(WorkOrderProtosContainer* 
container) {
-  // TODO(tianrun): Add protobuf for UnionAllWorkOrder to support 
distributed mode.
-  LOG(FATAL) << "UnionAllOperator is not supported in distributed mode 
yet.";
-  return true;
+  if (!stored_generated_) {
+for (std::size_t relation_index = 0; relation_index < 
input_relations_.size(); ++relation_index) {
--- End diff --

Not necessary.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-quickstep pull request #234: Add protobuf support for UNION ALL op...

2017-04-19 Thread cramja
Github user cramja commented on a diff in the pull request:

https://github.com/apache/incubator-quickstep/pull/234#discussion_r112333485
  
--- Diff: relational_operators/UnionAllOperator.hpp ---
@@ -149,6 +151,11 @@ class UnionAllOperator : public RelationalOperator {
InsertDestination *output_destination,
const std::size_t relation_index);
 
+  // Create work order proto
--- End diff --

Does this require a full doxy comment?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-quickstep pull request #234: Add protobuf support for UNION ALL op...

2017-04-19 Thread cramja
Github user cramja commented on a diff in the pull request:

https://github.com/apache/incubator-quickstep/pull/234#discussion_r11271
  
--- Diff: relational_operators/UnionAllOperator.cpp ---
@@ -128,14 +128,56 @@ bool UnionAllOperator::getAllWorkOrders(
 }
 
 bool UnionAllOperator::getAllWorkOrderProtos(WorkOrderProtosContainer* 
container) {
-  // TODO(tianrun): Add protobuf for UnionAllWorkOrder to support 
distributed mode.
-  LOG(FATAL) << "UnionAllOperator is not supported in distributed mode 
yet.";
-  return true;
+  if (!stored_generated_) {
+for (std::size_t relation_index = 0; relation_index < 
input_relations_.size(); ++relation_index) {
+  if (input_relations_are_stored_[relation_index]) {
+const std::vector &all_blocks = 
input_relations_block_ids_[relation_index];
+const relation_id relation = 
input_relations_[relation_index]->getID();
+const std::vector &attributes = 
select_attribute_ids_[relation_index];
+for (const block_id block : all_blocks) {
+  container->addWorkOrderProto(createWorkOrderProto(block, 
relation, attributes), op_index_);
+}
+  }
+}
+stored_generated_ = true;
+  }
+
+  for (std::size_t relation_index = 0; relation_index < 
input_relations_.size(); ++relation_index) {
+if (!input_relations_are_stored_[relation_index]) {
+  const std::vector &all_blocks = 
input_relations_block_ids_[relation_index];
+  std::size_t num_generated = 
num_workorders_generated_[relation_index];
+  const relation_id relation = 
input_relations_[relation_index]->getID();
+  const std::vector &attributes = 
select_attribute_ids_[relation_index];
+  while (num_generated < all_blocks.size()) {
+
container->addWorkOrderProto(createWorkOrderProto(all_blocks[num_generated], 
relation, attributes), op_index_);
+++num_generated;
+  }
+  num_workorders_generated_[relation_index] = num_generated;
+}
+  }
+  return stored_generated_ && done_feeding_input_relation_;
--- End diff --

Is `stored_generated_ && ...` redundant, as it will always be true here? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-quickstep pull request #234: Add protobuf support for UNION ALL op...

2017-04-19 Thread cramja
Github user cramja commented on a diff in the pull request:

https://github.com/apache/incubator-quickstep/pull/234#discussion_r112333067
  
--- Diff: relational_operators/UnionAllOperator.cpp ---
@@ -128,14 +128,56 @@ bool UnionAllOperator::getAllWorkOrders(
 }
 
 bool UnionAllOperator::getAllWorkOrderProtos(WorkOrderProtosContainer* 
container) {
-  // TODO(tianrun): Add protobuf for UnionAllWorkOrder to support 
distributed mode.
-  LOG(FATAL) << "UnionAllOperator is not supported in distributed mode 
yet.";
-  return true;
+  if (!stored_generated_) {
+for (std::size_t relation_index = 0; relation_index < 
input_relations_.size(); ++relation_index) {
--- End diff --

I'd suggest to refactor this into a small `generateStored (?)` method, 
because it seems like isolatable functionality.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-quickstep pull request #234: Add protobuf support for UNION ALL op...

2017-04-18 Thread Terranlee
GitHub user Terranlee opened a pull request:

https://github.com/apache/incubator-quickstep/pull/234

Add protobuf support for UNION ALL operator.

This PR implements protobuf for Union All operator in distributed setting.

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

$ git pull https://github.com/Terranlee/incubator-quickstep 
union-operator-proto

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

https://github.com/apache/incubator-quickstep/pull/234.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 #234


commit c32f558a5e7eaf1237c41266774e0993f6b362d4
Author: Tianrun 
Date:   2017-04-17T17:03:13Z

Add protobuf support for union all operator.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---