[
https://issues.apache.org/jira/browse/HUDI-7183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wechar resolved HUDI-7183.
--------------------------
> Fix static insert overwrite partitions issue
> --------------------------------------------
>
> Key: HUDI-7183
> URL: https://issues.apache.org/jira/browse/HUDI-7183
> Project: Apache Hudi
> Issue Type: Bug
> Reporter: Wechar
> Assignee: Wechar
> Priority: Major
> Labels: pull-request-available
>
> when configured {{hoodie.datasource.overwrite.mode=static}}, hudi should
> overwrite the matching static partitions.
> *How to Reproduce*
> {code:sql}
> -- create a hudi table
> create table wechar_hudi_part (
> id int,
> name string,
> price double,
> ts long, dt string,
> hh string
> ) using hudi partitioned by (dt, hh) options (primaryKey='id');
> -- insert some values
> insert into wechar_hudi_part values
> (0, 'a0', 10, 1000, '2023-12-05', '00'),
> (1, 'a1', 10, 1000, '2023-12-06', '00'),
> (2, 'a2', 10, 1000, '2023-12-06', '01');
> -- static insert overwrite
> set hoodie.datasource.overwrite.mode=static;
> insert overwrite table wechar_hudi_part partition (dt='2023-12-06', hh)
> values (3, 'a3', 10, 1000, '00');
> select id,name,price,ts,dt,hh from wechar_hudi_part;
> 3 a3 10.0 1000 2023-12-06 00
>
> 2 a2 10.0 1000 2023-12-06 01 // partition
> dt=2023-12-06/hh=01 shoud be overwritten
> 0 a0 10.0 1000 2023-12-05 00
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)