xiangfu0 commented on code in PR #19800:
URL: https://github.com/apache/pinot/pull/19800#discussion_r4251403186


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/funnel/SetMergeStrategy.java:
##########
@@ -41,11 +42,13 @@ public List<Set> merge(List<Set> intermediateResult1, 
List<Set> intermediateResu
   @Override
   public LongArrayList extractFinalResult(List<Set> stepsSets) {
     long[] result = new long[_numSteps];
-    result[0] = stepsSets.get(0).size();
+    Set<?> firstStep = stepsSets.get(0);
+    Set<?> intersection = new HashSet<>(firstStep);

Review Comment:
   Fixed in 
[4292f86188](https://github.com/apache/pinot/commit/4292f86188e9cd01f7b48b0d7541e62ec4b4b235).
 The first count comes directly from `size()`, single-step funnels do not copy 
the population, and an empty operand stops intersection work immediately. 
Nonempty intersections copy the smaller operand; later steps reuse the private 
intersection when it is already smaller. Matching INT/LONG/FLOAT/DOUBLE sets 
retain primitive containers and typed intersection operations, while all input 
populations remain intact for later merging.
   
   Local validation: 64 focused funnel/MSE tests passed, plus all four 
`pinot-core` formatting/checkstyle/license checks, with no compiler warnings on 
added lines. The regression rejects iteration over a mocked million-entry first 
step in single-step, empty-second-step and skewed-step cases. Primitive/string 
cases cover repeated extraction and preserved populations, including distinct 
NaN payloads and signed zeros. Running these tests against the previous 
`c4513289bd` finalizer produces three expected failures (large population 
traversal and float/double NaN counts); the fixed code passes.
   
   The push is verified at this head. Hosted CI for the new head is pending; 
human approval remains pending.



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