Skip to content

Support optional parameters argument for tuple sketch aggregations in the multi-stage engine - #19312

Open
davecromberge wants to merge 1 commit into
apache:masterfrom
permutive-engineering:fix-contrib/msqe-tuple-sketch-operands
Open

Support optional parameters argument for tuple sketch aggregations in the multi-stage engine#19312
davecromberge wants to merge 1 commit into
apache:masterfrom
permutive-engineering:fix-contrib/msqe-tuple-sketch-operands

Conversation

@davecromberge

Copy link
Copy Markdown
Member

Description

The IntegerSumTupleSketch aggregation functions (distinctCountTupleSketch, distinctCountRawIntegerSumTupleSketch, sumValuesIntegerSumTupleSketch, avgValueIntegerSumTupleSketch) accept an optional second parameters argument (e.g. nominalEntries) in the single-stage engine, but are registered in AggregationFunctionType with OperandTypes.BINARY (exactly one operand). The multi-stage engine therefore rejects the parameterized form at query validation:

QueryValidationError: Invalid number of arguments to function
'DISTINCTCOUNTRAWINTEGERSUMTUPLESKETCH'. Was expecting 1 arguments.

even though the identical query runs on the single-stage engine.

Fix

Register the four tuple-sketch aggregations with the same 1-or-2 operand signature (OperandTypes.family(List.of(ANY, ANY), i -> i == 1)) already used by the CPC sketch functions, so the optional parameters operand is accepted. This is a planning-only change; execution, return types, and serialization are unchanged.

Testing

TupleSketchTest now exercises the 2-argument (parameterized) form across both query engines.

…age engine

IntegerSumTupleSketch aggregations accept an optional parameters operand
(e.g. nominalEntries) in the single-stage engine, but were registered with
OperandTypes.BINARY, so the multi-stage engine rejected the parameterized form
at query validation. Register them with the same 1-or-2 operand signature as
the CPC sketch functions, and cover the parameterized form in TupleSketchTest.
@codecov-commenter

codecov-commenter commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.18%. Comparing base (84becf5) to head (c79a335).

Files with missing lines Patch % Lines
...che/pinot/segment/spi/AggregationFunctionType.java 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #19312   +/-   ##
=========================================
  Coverage     67.18%   67.18%           
  Complexity     1424     1424           
=========================================
  Files          3462     3462           
  Lines        220361   220365    +4     
  Branches      35147    35147           
=========================================
+ Hits         148045   148056   +11     
+ Misses        60506    60502    -4     
+ Partials      11810    11807    -3     
Flag Coverage Δ
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-25 67.18% <42.85%> (+<0.01%) ⬆️
lane-a 100.00% <ø> (ø)
lane-b 0.00% <ø> (ø)
temurin 67.18% <42.85%> (+<0.01%) ⬆️
unittests 67.18% <42.85%> (+<0.01%) ⬆️
unittests1 57.83% <42.85%> (+<0.01%) ⬆️
unittests2 39.20% <42.85%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants