xiangfu0 opened a new pull request, #19645:
URL: https://github.com/apache/pinot/pull/19645
## Summary
When the broker merges ExprMin/ExprMax results whose extrema tie, it merges
deserialized (immutable) `ExprMinMaxObject`s. `merge()` set `_mutable = true`
*before* copying the immutable rows. Both `getNumberOfRows()` and `getField()`
switch on `_mutable`, so the copy loop saw zero rows:
- the first server's tied rows were silently dropped, and
- the measuring key was never copied, so the merged object's key was `null`.
Merging a third tied result, or re-serializing the merged result, then fails
with an NPE.
The fix copies the rows and the key before switching to mutable mode.
The copied rows are now read through the immutable accessor, which ignored
the data block's null bitmap. Null projections were therefore read back as
values. For example, an MV `VALUE_IN` with no match was returned as an array
instead of `null`. `getField()` now honors the null bitmap, which is cached
once per column.
## User-visible change
- Queries whose extrema tie across servers now return the tied rows from
every server, not only from the last one merged. `BaseQueriesTest` executes
each query on two servers of two segments each, so the existing
`ExprMinMaxTest` expectations encoded the truncated result (2 rows instead of
4, and so on). They are updated here.
- A null projection from a serialized result is now returned as `null`.
Previously it was returned as an empty array, and the test asserted `[]`. The
unserialized path already returned `null`, because
`ExprMinMaxProjectionValSetWrapper` maps empty MV values to `null`. The result
no longer depends on whether the final accumulator was serialized.
## Tests
- New `ExprMinMaxObjectTest`:
- A three-way tied merge of serialized results keeps every row and the key.
- A merged tied result survives re-serialization.
- Both tests fail on master with an NPE (`key` is null after the first
tied merge).
- `ExprMinMaxTest`: expectations updated to include the previously dropped
tied rows, including null MV projections.
Split out of #19523.
--
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]