Repository navigation
Conversation
xiangfu0
force-pushed
the
xiangfu0/agg-rewrite/01-first-last-with-time
branch
from
October 21, 2026 08:21
2b49933 to
7725620
Compare
xiangfu0
force-pushed
the
xiangfu0/agg-rewrite/02-array-agg
branch
from
October 21, 2026 22:10
b80d110 to
a23a7fd
Compare
Both query engines rewrite ARRAY_AGG(expression) and ARRAY_AGG(expression, isDistinct) to the explicit form ARRAY_AGG(expression, 'dataType'[, isDistinct]) with the type of the expression, or its element type for a multi-value input: AggregateFunctionRewriteOptimizer for a column in the single-stage engine and PinotAggregateTypeArgumentRewriteRule in the multi-stage engine.
xiangfu0
force-pushed
the
xiangfu0/agg-rewrite/01-first-last-with-time
branch
from
October 22, 2026 09:28
ca99413 to
2dab204
Compare
xiangfu0
force-pushed
the
xiangfu0/agg-rewrite/02-array-agg
branch
from
October 22, 2026 09:41
a23a7fd to
4d7e69f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supports
ARRAY_AGG(expr)andARRAY_AGG(expr, isDistinct)without the explicit data type argument.Stacked on #19986; will be retargeted to
masteronce it merges.How
Both engines rewrite the call to the existing explicit form
ARRAY_AGG(expr, 'dataType'[, isDistinct]), using the type ofexpr, or its element type for a multi-value input. A JSON column maps toSTRINGin both engines.AggregateFunctionRewriteOptimizer, for column operands.PinotAggregateTypeArgumentRewriteRule, for any expression. Validation rejects types that the explicit form does not support.The explicit form is unchanged: a string second argument is the data type. Distinct
ARRAY_AGGis still served from the star-tree.Tests
AggregateFunctionRewriteOptimizerTestArrayAggQueriesTest,ArrayAggMvQueriesTest,ArrayAggStarTreeQueriesTestAggregatePlans.json, runtime queries inUDFAggregates.json