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


##########
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:
   It's not guaranteed thread-safe. In the Delta PR, the plan is still created 
and executed in one single thread so no requirement for thread safety on this 
API now.



-- 
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