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

pengzhiwei resolved HUDI-2033.
------------------------------
    Resolution: Fixed

> ClassCastException Throw When PreCombineField Is String Type
> ------------------------------------------------------------
>
>                 Key: HUDI-2033
>                 URL: https://issues.apache.org/jira/browse/HUDI-2033
>             Project: Apache Hudi
>          Issue Type: Bug
>          Components: Spark Integration
>            Reporter: pengzhiwei
>            Assignee: pengzhiwei
>            Priority: Critical
>             Fix For: 0.9.0
>
>
> When the preCombineField is string type:
>  
> {code:java}
> create table h0 (
>   id int,
>   name string,
>   c string
> ) using hudi
> options(
>   primaryKey = 'id',
>   preCombineField = 'c'
> );
> {code}
>  
>  
> the follow exception throw out when execute merge into statement.
>  
> {code:java}
> Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to 
> org.apache.avro.util.Utf8Caused by: java.lang.ClassCastException: 
> java.lang.String cannot be cast to org.apache.avro.util.Utf8 at 
> org.apache.avro.util.Utf8.compareTo(Utf8.java:28) at 
> org.apache.hudi.common.model.DefaultHoodieRecordPayload.needUpdatingPersistedRecord(DefaultHoodieRecordPayload.java:105)
>  at 
> org.apache.spark.sql.hudi.command.payload.ExpressionPayload.protected$needUpdatingPersistedRecord(ExpressionPayload.scala:98)
>  at 
> org.apache.spark.sql.hudi.command.payload.ExpressionPayload$$anonfun$combineAndGetUpdateValue$4.apply(ExpressionPayload.scala:98)
>  at 
> org.apache.spark.sql.hudi.command.payload.ExpressionPayload$$anonfun$combineAndGetUpdateValue$4.apply(ExpressionPayload.scala:88)
> {code}
>  
>  



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

Reply via email to