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

[jira] [Commented] (HUDI-2343) Fix the exception for mergeInto when the primaryKey and preCombineField of source table and target table differ in case only

    [ https://issues.apache.org/jira/browse/HUDI-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17402629#comment-17402629 ] 

ASF GitHub Bot commented on HUDI-2343:
--------------------------------------

hudi-bot edited a comment on pull request #3517:
URL: https://github.com/apache/hudi/pull/3517#issuecomment-903133286


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "df7b426190ea6c583d99fb67ca8adad93edf25f0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1851",
       "triggerID" : "df7b426190ea6c583d99fb67ca8adad93edf25f0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df7b426190ea6c583d99fb67ca8adad93edf25f0 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1851) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run travis` re-run the last Travis build
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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


> Fix the exception for mergeInto when the primaryKey and preCombineField of source table and target table differ in case only
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HUDI-2343
>                 URL: https://issues.apache.org/jira/browse/HUDI-2343
>             Project: Apache Hudi
>          Issue Type: Bug
>          Components: Spark Integration
>            Reporter: 董可伦
>            Assignee: 董可伦
>            Priority: Major
>             Fix For: 0.10.0
>
>
> Example:
> {code:java}
> val tableName = "test_hudi_table"
> spark.sql(
> s"""
> create table ${tableName} (
> id int,
> name string,
> price double,
> ts long
> ) using hudi
> options (
> primaryKey = 'id',
> type = 'cow'
> )
> location '/tmp/${tableName}'
> """.stripMargin)
> spark.sql(
>   s"""
>      | merge into $tableName
>      | using (
>      |  select 1 as ID, 'a1' as NAME, 10 as PRICE, 1000 as TS, '1' as FLAG
>      | ) s0
>      | on s0.ID = $tableName.id
>      | when matched and FLAG = '1' then update set
>      | id = s0.ID, name = s0.NAME, price = s0.PRICE, ts = s0.TS
>      | when not matched and FLAG = '1' then insert *
>  """.stripMargin){code}
> It will throw an exception:
> {code:java}
> org.apache.hudi.exception.HoodieException: ts(Part -ts) field not found in record. Acceptable fields were :[ID, NAME, PRICE, TS, FLAG]
> {code}
> and:
> {code:java}
> spark.sql(
>   s"""
>      | merge into $tableName
>      | using (
>      |  select 1 as ID, 'a1' as NAME, 10 as PRICE, 1000 as ts, '1' as FLAG
>      | ) s0
>      | on s0.ID = $tableName.id
>      | when matched and FLAG = '1' then update set
>      | id = s0.ID, name = s0.NAME, price = s0.PRICE, ts = s0.ts
>      | when not matched and FLAG = '1' then insert *
>  """.stripMargin)
> {code}
> It will throw the exception:
> {code:java}
> org.apache.hudi.exception.HoodieKeyException: recordKey values: "id:__null__" for fields: [id] cannot be entirely null or empty.
> {code}
>  
>  
>  



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