Prajwal-banakar opened a new pull request, #2296:
URL: https://github.com/apache/fluss/pull/2296
### Purpose
<!-- Linking this pull request to the issue -->
Linked issue: close #2247
<!-- What is the purpose of the change -->
This PR adds support for aggregate functions (specifically `MIN` and `MAX`)
over complex data types such as `ARRAY` and `ROW`. Previously, using these
functions on complex types would result in an exception because they were
considered incomparable. `LAST_VALUE` and `FIRST_VALUE` were already supported
but are now verified to work with complex types.
### Brief change log
<!-- Please describe the changes made in this pull request and explain how
they address the issue -->
- Updated `InternalRowUtils.compare()` to support recursive comparison for
`ARRAY` and `ROW` types.
- Updated `FieldMinAgg` and `FieldMaxAgg` to use the new
`InternalRowUtils.compare()` method that accepts `DataType` (preserving nested
type information) instead of just `DataTypeRoot`.
- Added `ComplexTypeAggregationTest` to verify `LAST_VALUE`, `MIN`, and
`MAX` aggregations on `ARRAY` and `ROW` types.
- Note: `MAP` type comparison is explicitly not supported and will throw an
exception, consistent with SQL standards.
### Tests
<!-- List UT and IT cases to verify this change -->
- Added `ComplexTypeAggregationTest` which includes:
- `testArrayLastValue`: Verifies `LAST_VALUE` on `ARRAY<INT>`.
- `testArrayMinMax`: Verifies `MIN`/`MAX` on `ARRAY<INT>`.
- `testRowMinMax`: Verifies `MIN`/`MAX` on nested `ROW<INT, STRING>`.
### API and Format
<!-- Does this change affect API or storage format -->
- No API or storage format changes. This only enhances the runtime
capability of existing aggregation functions.
### Documentation
<!-- Does this change introduce a new feature -->
- No documentation changes needed as this supports standard SQL behavior for
these types.
--
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]