platinumhamburg opened a new issue, #2916: URL: https://github.com/apache/fluss/issues/2916
### Search before asking - [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar. ### Motivation The Aggregation Merge Engine currently supports upsert and deleteoperations. However, there is no way to **reverse a previously applied aggregation contribution** without deleting the entire row. Consider an e-commerce scenario: a table aggregates total revenue per shop using `SUM`. When a refund occurs, the system needs to subtract the refunded amount from the running total. Today, this requires the Flink compute layer to maintain full aggregation state — defeating the purpose of pushing aggregation down to the storage engine. ### Solution Introduce a **retract** operation that computes the inverse of a previous aggregation at the storage layer: - `SUM`: subtracts the retracted value - `PRODUCT`: divides by the retracted value - `LAST_VALUE` / `LAST_VALUE_IGNORE_NULLS`: clears to null Functions that cannot be mathematically reversed (`MAX`, `MIN`, `FIRST_VALUE`, `LISTAGG`, etc.) do not support retract. ### Anything else? _No response_ ### Willingness to contribute - [x] I'm willing to submit a PR! -- 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]
