mrhhsg opened a new pull request, #68606:
URL: https://github.com/apache/doris/pull/68606
### What problem does this PR solve?
Issue Number: None
Related PR: #51343
Problem Summary:
#51343 added `map_agg_v2`, which keeps NULL keys and handles NULL values
correctly, and made `map_agg` an alias of it. The old implementation
(`AggregateFunctionMapAgg`, exposed as `map_agg_v1`) was kept only so it
could still be called explicitly. It has no remaining callers, so this PR
removes it:
- BE: delete `aggregate_function_map.h/.cpp` and its registration
(`map_agg_v1` and the BE-side `map_agg` -> `map_agg_v1` alias).
- FE: delete the `MapAgg` expression class, its `map_agg_v1` builtin entry
and the `visitMapAgg` visitor method. `map_agg` keeps resolving to
`map_agg_v2` in FE.
- Tests: drop the v1-only regression suite and the v1-specific BE UT,
switch the agg_state column in the segment flusher format test to
`map_agg_v2`, and regenerate its golden Segments. The only byte that
changes in those Segments is the aggregate function name stored in the
column metadata (`map_agg_v1` -> `map_agg_v2`), plus the footer
checksum for V2 Segments.
After this change `SELECT map_agg_v1(...)` fails with
`Can not found function 'map_agg_v1'`.
Upgrade compatibility with agg_state columns created by old versions
(e.g. `agg_state<map_agg(...)>` created before `map_agg_v2` existed,
which BE resolved to the v1 implementation) is intentionally not kept.
### Release note
Remove the legacy aggregate function `map_agg_v1`. Use `map_agg` (the same
as `map_agg_v2`) instead. `agg_state` columns built on the old `map_agg`
implementation are no longer readable and must be rebuilt.
### Check List (For Author)
- Test:
- Regression test: `query_p0/aggregate/map_agg` (adds a negative case
for `map_agg_v1`), `test_agg_state_map`, `agg_sync_mv`,
`map_agg_nested_insert_doris`, `map_agg_by_key`,
`test_mapagg_with_jsonfuncs`
- Unit Test: `AggFnEvaluatorTest.*`, `SegmentFlusherFormatTest.*`,
`SegmentFlusherTransformFormatTest.*`, `InferAggNotNullTest`
- Behavior changed: Yes (`map_agg_v1` is removed)
- Does this need documentation: Yes (the `map_agg_v1` entry in the function
docs
should be removed in doris-website; no doc PR yet)
--
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]