eyjian commented on issue #8757:
URL: https://github.com/apache/hudi/issues/8757#issuecomment-1554184806

   Create table:
   
   ```
   drop table if exists t31 purge;
   create table t31 (
       ds BIGINT,
       ut STRING,
       pk BIGINT,
       f0 BIGINT,
       f1 BIGINT,
       f2 BIGINT,
       f3 BIGINT,
       f4 BIGINT
   ) using hudi
   partitioned by (ds)
   tblproperties (
     type = 'mor',
     primaryKey = 'pk',
     preCombineField = 'ut',  
     hoodie.index.type = 'BUCKET',
     hoodie.bucket.index.num.buckets = '2',
     hoodie.datasource.write.payload.class = 
'org.apache.hudi.common.model.PartialUpdateAvroPayload'
   );
   ```
   
   Insert and update:
   
   ```    
   insert into t31 (ds,ut,pk,f0) values (20230101,CURRENT_TIMESTAMP,1001,1);
   select * from t31 where pk=1001; -- Results1
   
   update t31 set f1=2 where pk=1001;
   --insert into t31 (ds,ut,pk,f1) values (20230101,CURRENT_TIMESTAMP,1001,2);
   select * from t31 where pk=1001; -- Results2
   
   update t31 set f2=3 where pk=1001;
   --insert into t31 (ds,ut,pk,f2) values (20230101,CURRENT_TIMESTAMP,1001,3);
   select * from t31 where pk=1001; -- Results3
   
   update t31 set f1=10 where pk=1001;
   --insert into t31 (ds,ut,pk,f0) values (20230101,CURRENT_TIMESTAMP,1001,10);
   select * from t31 where pk=1001; -- Results4
   ```
   
   Results1:
   
   ```
   _hoodie_commit_time  _hoodie_commit_seqno     _hoodie_record_key    
_hoodie_partition_path    _hoodie_file_name                                     
                        ut                         pk      f0   f1      f2      
f3      f4      ds
   20230519152711909    20230519152711909_0_0    pk:1001               
ds=20230101               
4f16b9e0-685e-4eaa-bbf0-78d24e8cbb77-0_0-22-1013_20230519152711909.parquet    
2023-05-19 15:27:12.089    1001    1    NULL    NULL    NULL    NULL    20230101
   ```
   
   Results2:
   
   ```
   _hoodie_commit_time  _hoodie_commit_seqno     _hoodie_record_key    
_hoodie_partition_path    _hoodie_file_name                                     
                        ut                         pk      f0   f1      f2      
f3      f4      ds
   20230519152711909    20230519152711909_0_0    pk:1001                
ds=20230101              
4f16b9e0-685e-4eaa-bbf0-78d24e8cbb77-0_0-22-1013_20230519152711909.parquet    
2023-05-19 15:27:12.089    1001    1    NULL    NULL    NULL    NULL    20230101
   20230519153041211    20230519153041211_0_0    pk:1001                
ds=20230101              
13db8833-03d1-4aa7-9f24-b1ada191ffdb-0_0-12-1008_20230519153041211.parquet    
2023-05-19 15:27:12.089    1001    1    2       NULL    NULL    NULL    20230101
   ```
   
   Results3:
   
   ```
   _hoodie_commit_time  _hoodie_commit_seqno     _hoodie_record_key    
_hoodie_partition_path    _hoodie_file_name                                     
                        ut                         pk      f0   f1      f2     
f3      f4      ds
   20230519153428612    20230519153428612_0_0    pk:1001                
ds=20230101              
48ee2f19-6068-4936-a224-33a9014b15c1-0_0-12-1011_20230519153428612.parquet    
2023-05-19 15:27:12.089    1001    1    2       3      NULL    NULL    20230101
   20230519152711909    20230519152711909_0_0    pk:1001                
ds=20230101              
4f16b9e0-685e-4eaa-bbf0-78d24e8cbb77-0_0-22-1013_20230519152711909.parquet    
2023-05-19 15:27:12.089    1001    1    NULL    NULL   NULL    NULL    20230101
   20230519153041211    20230519153041211_0_0    pk:1001                
ds=20230101              
13db8833-03d1-4aa7-9f24-b1ada191ffdb-0_0-12-1008_20230519153041211.parquet    
2023-05-19 15:27:12.089    1001    1    2       NULL   NULL    NULL    20230101
   ```
   
   Results4:
   
   ```
   _hoodie_commit_time  _hoodie_commit_seqno     _hoodie_record_key    
_hoodie_partition_path    _hoodie_file_name                                     
                        ut                         pk      f0   f1      f2      
f3      f4      ds
   20230519153428612    20230519153428612_0_0    pk:1001                
ds=20230101              
48ee2f19-6068-4936-a224-33a9014b15c1-0_0-12-1011_20230519153428612.parquet    
2023-05-19 15:27:12.089    1001    1    2       3       NULL    NULL    20230101
   20230519152711909    20230519152711909_0_0    pk:1001                
ds=20230101              
4f16b9e0-685e-4eaa-bbf0-78d24e8cbb77-0_0-22-1013_20230519152711909.parquet    
2023-05-19 15:27:12.089    1001    1    NULL    NULL    NULL    NULL    20230101
   20230519153041211    20230519153041211_0_0    pk:1001                
ds=20230101              
13db8833-03d1-4aa7-9f24-b1ada191ffdb-0_0-12-1008_20230519153041211.parquet    
2023-05-19 15:27:12.089    1001    1    2       NULL    NULL    NULL    20230101
   20230519153812023    20230519153812023_0_0    pk:1001                
ds=20230101              
352e5566-c4c5-4e81-aed9-3050abb4cfe5-0_0-12-1009_20230519153812023.parquet    
2023-05-19 15:27:12.089    1001    1    10      NULL    NULL    NULL    20230101
   ```


-- 
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]

Reply via email to