zeronerdzerogeekzerocool opened a new pull request, #19663:
URL: https://github.com/apache/pinot/pull/19663
`OrderByComparatorFactory.getGroupByExpressionIndexMap` keyed group-by
expressions by `expression.getIdentifier()`, which is `null` for anything that
isn't a plain column reference (e.g. `dateTrunc(...)`,
`json_extract_index(...)`). With two or more transform-based GROUP BY keys,
every expression collapsed onto the same `null` map entry, so
`getRecordKeyComparator` resolved every ORDER BY expression to the same column
index instead of its own.
This corrupted the SSE sort-aggregate combine
(`SortedGroupByCombineOperator` / `SequentialSortedGroupByCombineOperator`):
when merging per-segment sorted group-by results, the comparator no longer
distinguished between distinct group keys, so unequal groups could be treated
as equal and merged, silently corrupting aggregated values for multi-key GROUP
BY queries where at least two keys are transform expressions.
Fix: key the map by the whole `ExpressionContext` instead of its identifier,
and fail fast via `Preconditions.checkState` if an ORDER BY expression isn't
actually a GROUP BY key (rather than silently mapping to a wrong/null index).
Instructions:
1. The PR has to be tagged with at least one of the following labels (*):
1. `feature`
2. `bugfix`
3. `performance`
4. `ui`
5. `backward-incompat`
6. `release-notes` (**)
2. Remove these instructions before publishing the PR.
(*) Other labels to consider:
- `testing`
- `dependencies`
- `docker`
- `kubernetes`
- `observability`
- `security`
- `code-style`
- `extension-point`
- `refactor`
- `cleanup`
(**) Use `release-notes` label for scenarios like:
- New configuration options
- Deprecation of configurations
- Signature changes to public methods/interfaces
- New plugins added or old plugins removed
--
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]