fujianhua168 opened a new issue, #6243:
URL: https://github.com/apache/hudi/issues/6243

   **Describe the problem you faced**
   
   spark sql mergeinto sqlstatment 'when matched then update set' not effect 
(source data have both matched and not matched record),  sql code as follows: 
    `--1:create table 
   create table hudi_mor_tbl (
     id int,
     name string,
     price double,
     ts bigint
   ) using hudi
   tblproperties (
     type = 'mor',
     primaryKey = 'id',
     preCombineField = 'ts'
   );
   --2:first insert into one record (id=1):
   insert into hudi_mor_tbl select 1, 'a1', 20, 1000;
   --3:create the merge_source table then insert into three record
   create table merge_source (id int, name string, price double, ts bigint) 
using hudi
   tblproperties (primaryKey = 'id', preCombineField = 'ts');
   insert into merge_source values (1, "old_a1", 22.22, 900), (2, "new_a2", 
33.33, 2000), (3, "new_a3", 44.44, 2000);
   
   --4:execute mergeinto sql:
   merge into hudi_mor_tbl as target
   using merge_source as source
   on target.id = source.id
   when matched then update set *
   when not matched then insert *
   ;
   --5:'insert' action effect,but 'update set' action not effect;
   select * from hudi_mor_tbl;`
   
   
![image](https://user-images.githubusercontent.com/5379274/181714688-b2c2c30e-109d-4ab8-ba1a-4bab6c56a9c5.png)
   
   **Expected behavior**
     in the hudi_mor_tbl table , record ( id=1 ) 'name' filed value should 
change to the 'old_a1'...
    
   
   **Environment Description**
   
   * Hudi version : 0.11.1
   
   * Spark version :3.2.1
   
   * Hive version :3.1.0
   
   * Hadoop version :3.1.1
   
   * Storage (HDFS/S3/GCS..) :HDFS
   
   * Running on Docker? (yes/no) :no
   
   
   **Additional context**
   
   Add any other context about the problem here.
   
   **Stacktrace**
   
   ```Add the stacktrace of the error.```
   
   


-- 
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: commits-unsubscr...@hudi.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to