[Bug] Paimon ROW Type Internal Field Sum Aggregation Not Working
Search before asking
- [x] I searched in the issues and found nothing similar.
Paimon version
1.2
Compute Engine
Flink 1.20
Minimal reproduce step
Hi, I'm encountering an issue where the sum aggregation on internal fields of a ROW type in Paimon doesn't work as expected. Instead of aggregating values, the data is overwritten (only the last value is retained). Here's a reproducible test case:
- my DDL CREATE TABLE "test_row_agg" ( "id" INT, "data" ROW("num" INT, "info" VARCHAR) ) WITH ( options='{ "merge-engine":"aggregation", "fields.data.num.aggregate-function":"sum", "fields.data.sequence-group":"data" }', primary_key=ARRAY['id'], bucket=4, bucket_key=ARRAY['id'] );
- Insert Test Data (Two Writes with the Same Primary Key) INSERT INTO "test_row_agg" ("id", "data") VALUES (1, ROW(10, 'info1'));
INSERT INTO "test_row_agg" ("id", "data") VALUES (1, ROW(20, 'info2')); 3. Query Result SELECT "id", "data"."num" FROM "test_row_agg" WHERE "id" = 1;
I expected data.num = 30 ,But,Actual Result is 20 why? I create table and config "fields.data.num.aggregate-function":"sum", But not sum
What doesn't meet your expectations?
Expected: (1, 30, 'info2') Actual: (1, 20, 'info2')
Anything else?
No response
Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Currently agg func only works for the top level field, but cannot work for nested fields.