vivienwwg opened a new pull request, #7446:
URL: https://github.com/apache/paimon/pull/7446
<!-- Please specify the module before the PR name: [core] ... or [flink] ...
-->
### Purpose
Because the original aggregate function for merging maps could not handle
partial updates at the key level, a new function has been created to enable
partial updates of keys within map-formatted fields.
- Supported map field types:MAP<STRING, ROW<`value` STRING, `sequece_group`
STRING>>
> The `sequence_group` tag indicates the time of the last change to the
current key-value pair.
> Set `sequence_group` tag index:
'fields.key_value_map_with_time.ts_field_index'= '1',default is 1
> e.g.
```json
{
"product_name": { "value": "iPhone", "ts": "1712345678901" },
"color": { "value": "Black", "ts": "1712345678905" }
}
```
> ddl.
```sql
CREATE TABLE IF NOT EXISTS tmp_table (
`biz_order_id` STRING,
`key_value_map_with_time` MAP<STRING, ROW<`value` STRING, `ts` STRING>>
) PARTITIONED BY (ds)
WITH (
'primary-key' = 'biz_order_id',
'fields.key_value_map_with_time.aggregate-function' =
'merge_map_with_keytime'
);
```
--
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]