ad1happy2go commented on issue #8502:
URL: https://github.com/apache/hudi/issues/8502#issuecomment-1621375702

   @kazdy @jhchee You are correct, this should be supported for MERGE INTO.. I 
confirmed master also doesn't support it. Attaching the same code which should 
work.
   
   ```
   create table test_insert3 (
       id int,
   name string,
   updated_at timestamp
   ) using hudi
   options (
       type = 'cow',
       primaryKey = 'id',
       preCombineField = 'updated_at'
   ) location 'file:///tmp/test_insert3';
   
   merge into test_insert3 as target
   using (
       select 1 as id, 'c' as name, 1 as new_col, current_timestamp as 
updated_at
   union select 1 as id,'d' as name, 1 as new_col, current_timestamp as 
updated_at
   union select 1 as id,'e' as name, 1 as new_col, current_timestamp as 
updated_at
   ) source
   on target.id = source.id
   when matched then update set target.new_col = source.new_col
   when not matched then insert *;
   ```
   
   Create JIRA to track - https://issues.apache.org/jira/browse/HUDI-6483
   
   Feel free to contribute.


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