klsince commented on code in PR #14649:
URL: https://github.com/apache/pinot/pull/14649#discussion_r1882969228


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java:
##########
@@ -102,6 +107,7 @@ public void postExplainPlan(ExplainPlanRows 
explainPlanRows) {
   public ExplainInfo getExplainInfo() {
     acquire();
     try {
+      materializeChildOperator();

Review Comment:
   this was caught by `testBetween()` when testing `explainAskingServers=true`



##########
pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java:
##########
@@ -57,7 +57,12 @@ public AcquireReleaseColumnsSegmentOperator(PlanNode 
planNode, IndexSegment inde
   }
 
   public void materializeChildOperator() {
-    _childOperator = (Operator<BaseResultsBlock>) _planNode.run();
+    // V2 query engine can call getNextBlock() methods repetitively to stream 
result blocks between query stages, but
+    // the query plan should be created just once, so cache the child 
operator. And no need to synchronize here as the
+    // operator object is used by a single thread.
+    if (_childOperator == null) {
+      _childOperator = (Operator<BaseResultsBlock>) _planNode.run();

Review Comment:
   this was caught by a few tests in MultiStageEngineIntegrationTest, e.g. 
`testSingleValueQuery()`



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