Aditya Goenka created HUDI-6483:
-----------------------------------

             Summary: MERGE INTO should support schema evolution for partial 
updates.
                 Key: HUDI-6483
                 URL: https://issues.apache.org/jira/browse/HUDI-6483
             Project: Apache Hudi
          Issue Type: Improvement
          Components: spark-sql
            Reporter: Aditya Goenka
             Fix For: 0.15.0


Following code is example for doing MERGE INTO along with schema evolution 
which is not yet supported by hudi. Currently, Hudi tries to use target table 
schema during MERGE INTO.

Following code should be supported - 

```
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
) source
on target.id = source.id
when matched then update set target.new_col = source.new_col
when not matched then insert *;
```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to