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

rongr 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 bfa03fe387 [multistage][hotfix] init execution stats map to avoid NPE 
(#11801)
bfa03fe387 is described below

commit bfa03fe387ab3345bc34a06f623590411aaad836
Author: Rong Rong <[email protected]>
AuthorDate: Thu Oct 12 19:34:13 2023 -0700

    [multistage][hotfix] init execution stats map to avoid NPE (#11801)
    
    Co-authored-by: Rong Rong <[email protected]>
---
 .../query/runtime/operator/LeafStageTransferableBlockOperator.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/LeafStageTransferableBlockOperator.java
 
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/LeafStageTransferableBlockOperator.java
index 35361e48e9..2eba9b5f9c 100644
--- 
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/LeafStageTransferableBlockOperator.java
+++ 
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/LeafStageTransferableBlockOperator.java
@@ -24,6 +24,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ArrayBlockingQueue;
@@ -95,6 +96,7 @@ public class LeafStageTransferableBlockOperator extends 
MultiStageOperator {
     _dataSchema = dataSchema;
     _queryExecutor = queryExecutor;
     _executorService = executorService;
+    _executionStats = new HashMap<>();
     Integer maxStreamingPendingBlocks = 
QueryOptionsUtils.getMaxStreamingPendingBlocks(context.getOpChainMetadata());
     _blockingQueue = new ArrayBlockingQueue<>(maxStreamingPendingBlocks != 
null ? maxStreamingPendingBlocks
         : QueryOptionValue.DEFAULT_MAX_STREAMING_PENDING_BLOCKS);
@@ -193,7 +195,7 @@ public class LeafStageTransferableBlockOperator extends 
MultiStageOperator {
                   // Collect the execution stats
                   Map<String, String> executionStats = 
instanceResponseBlock.getResponseMetadata();
                   synchronized (LeafStageTransferableBlockOperator.this) {
-                    if (_executionStats == null) {
+                    if (_executionStats.size() == 0) {
                       _executionStats = executionStats;
                     } else {
                       aggregateExecutionStats(_executionStats, executionStats);


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

Reply via email to