You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "sivabalan narayanan (Jira)" <ji...@apache.org> on 2021/08/05 21:30:00 UTC

[jira] [Updated] (HUDI-2282) Upsert for an already existing record throws DuplicateKeyException with primary key spark sql table

     [ https://issues.apache.org/jira/browse/HUDI-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sivabalan narayanan updated HUDI-2282:
--------------------------------------
    Description: 
[https://gist.github.com/nsivabalan/9837a90b1481c479a9c600bf16bafa57]

 
{code:java}
create table hudi_test4 (id int, name string, price double, ts long) using hudi options(primaryKey = 'id', precombineField = 'ts') partitioned by (name) location 'file:///tmp/hudi_testing/hudi_test4';

insert into hudi_test4 values(1, 100.0, 100000010, "abc");insert into hudi_test4 values(2, 200.0, 200000010, "abc");insert into hudi_test4 values(3, 300.0, 300000010, "abc");

// this throws DuplicateKeyException ? Even though operation w/ hudi is "upsert". 

insert into hudi_test4 values(1, 600.0, 600000010, "abc");
{code}
 

 

 

  was:
[https://gist.github.com/nsivabalan/9837a90b1481c479a9c600bf16bafa57]

 
{code:java}
create table hudi_test4 (id int, name string, price double, ts long) using hudi options(primaryKey = 'id', precombineField = 'ts') partitioned by (name) location 'file:///tmp/hudi_testing/hudi_test4';

insert into hudi_test4 values(1, 100.0, 100000010, "abc");insert into hudi_test4 values(2, 200.0, 200000010, "abc");insert into hudi_test4 values(3, 300.0, 300000010, "abc");

// this throws DuplicateKeyException ? Even though operation w/ hudi is "upsert". insert into hudi_test4 values(1, 600.0, 600000010, "abc");
{code}
 

 

 


> Upsert for an already existing record throws DuplicateKeyException with primary key spark sql table
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HUDI-2282
>                 URL: https://issues.apache.org/jira/browse/HUDI-2282
>             Project: Apache Hudi
>          Issue Type: Sub-task
>            Reporter: sivabalan narayanan
>            Priority: Major
>
> [https://gist.github.com/nsivabalan/9837a90b1481c479a9c600bf16bafa57]
>  
> {code:java}
> create table hudi_test4 (id int, name string, price double, ts long) using hudi options(primaryKey = 'id', precombineField = 'ts') partitioned by (name) location 'file:///tmp/hudi_testing/hudi_test4';
> insert into hudi_test4 values(1, 100.0, 100000010, "abc");insert into hudi_test4 values(2, 200.0, 200000010, "abc");insert into hudi_test4 values(3, 300.0, 300000010, "abc");
> // this throws DuplicateKeyException ? Even though operation w/ hudi is "upsert". 
> insert into hudi_test4 values(1, 600.0, 600000010, "abc");
> {code}
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)