This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 607bed279d make AcquireReleaseColumnsSegmentOperator work for V2 
(#14649)
607bed279d is described below

commit 607bed279d40173ade61916f57d30e90b61be874
Author: Xiaobing <[email protected]>
AuthorDate: Thu Dec 12 16:37:56 2024 -0800

    make AcquireReleaseColumnsSegmentOperator work for V2 (#14649)
---
 .../pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java
index ad6da28fdc..4d077d9221 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java
@@ -57,7 +57,12 @@ public class AcquireReleaseColumnsSegmentOperator extends 
BaseOperator<BaseResul
   }
 
   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();
+    }
   }
 
   /**
@@ -102,6 +107,7 @@ public class AcquireReleaseColumnsSegmentOperator extends 
BaseOperator<BaseResul
   public ExplainInfo getExplainInfo() {
     acquire();
     try {
+      materializeChildOperator();
       return super.getExplainInfo();
     } finally {
       release();


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

Reply via email to