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


##########
pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/operator/AggregateOperatorTest.java:
##########
@@ -351,6 +353,133 @@ public void testGroupTrimHintOverridesContextValue() {
     assertEquals(getAggregateOperator(context, nodeHint, 5, List.of(new 
RelFieldCollation(1))).getGroupTrimSize(), 30);
   }
 
+  @DataProvider
+  public Object[][] orderedGroupTrimCases() {
+    return new Object[][]{
+        {"COUNT", null, AggType.LEAF},
+        {"COUNT", null, AggType.INTERMEDIATE},
+        {"DISTINCTCOUNT", null, AggType.LEAF},
+        {"DISTINCTCOUNT", null, AggType.INTERMEDIATE},
+        {"DISTINCTCOUNTHLL", null, AggType.LEAF},
+        {"DISTINCTCOUNTHLL", null, AggType.INTERMEDIATE},
+        {"DISTINCTCOUNTSMARTHLL", null, AggType.LEAF},
+        {"DISTINCTCOUNTSMARTHLL", null, AggType.INTERMEDIATE},
+        {"DISTINCTCOUNTSMARTHLL", "threshold=1", AggType.LEAF},
+        {"DISTINCTCOUNTSMARTHLL", "threshold=1", AggType.INTERMEDIATE}
+    };
+  }
+
+  @Test(dataProvider = "orderedGroupTrimCases")
+  public void testOrderedGroupTrimPreservesIntermediateResults(String 
functionName, @Nullable String parameters,
+      AggType trimmedStage) {
+    OpChainExecutionContext context =
+        
OperatorTestUtil.getContext(Map.of(QueryOptionKey.MSE_MIN_GROUP_TRIM_SIZE, 
"1"));
+    ColumnDataType finalType = functionName.equals("DISTINCTCOUNTHLL") || 
functionName.equals("COUNT")
+        ? ColumnDataType.LONG : INT;

Review Comment:
   Addressed in `913f8c225d`. Reformatted the multiline test ternaries with 
separate ? and : branches. The executor conversion ternary was removed with the 
SSE sort-key normalization; the remaining short ternary fits on one line. 
Validation: all 40 focused runtime tests and the four affected-module hygiene 
checks pass.



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