zhouyuan commented on code in PR #11527:
URL: 
https://github.com/apache/incubator-gluten/pull/11527#discussion_r2759146556


##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -355,17 +357,39 @@ void WholeStageResultIterator::constructPartitionColumns(
   }
 }
 
-void WholeStageResultIterator::tryAddSplitsToTask() {
-  if (noMoreSplits_) {
+void WholeStageResultIterator::addIteratorSplits(const 
std::vector<std::shared_ptr<ResultIterator>>& inputIterators) {
+  // Create IteratorConnectorSplit for each iterator

Review Comment:
   should we also guard for `allSplitsAdded = true`? 



##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -355,17 +357,39 @@ void WholeStageResultIterator::constructPartitionColumns(
   }
 }
 
-void WholeStageResultIterator::tryAddSplitsToTask() {
-  if (noMoreSplits_) {
+void WholeStageResultIterator::addIteratorSplits(const 
std::vector<std::shared_ptr<ResultIterator>>& inputIterators) {
+  // Create IteratorConnectorSplit for each iterator
+  for (size_t i = 0; i < streamIds_.size() && i < inputIterators.size(); ++i) {
+    if (inputIterators[i] == nullptr) {
+      continue;
+    }
+    auto connectorSplit = std::make_shared<IteratorConnectorSplit>(
+        kIteratorConnectorId, inputIterators[i]);
+    exec::Split split(folly::copy(connectorSplit), -1);
+    task_->addSplit(streamIds_[i], std::move(split));
+  }
+}
+
+void WholeStageResultIterator::noMoreSplits() {

Review Comment:
   Would this work if calling from different threads? e.g. thread A called 
addIteratorSplits(), but thread B called on noMoreSplits()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to