linliu-code commented on code in PR #12519:
URL: https://github.com/apache/hudi/pull/12519#discussion_r1898669241
##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/SparkFileFormatInternalRowReaderContext.scala:
##########
@@ -263,20 +263,23 @@ class
SparkFileFormatInternalRowReaderContext(parquetFileReader: SparkParquetRea
}
override def castValue(value: Comparable[_], newType: Schema.Type):
Comparable[_] = {
- value match {
+ val valueToCast = if (value == null) 0 else value
+ valueToCast match {
case v: Integer => newType match {
case Type.INT => v
case Type.LONG => v.longValue()
case Type.FLOAT => v.floatValue()
case Type.DOUBLE => v.doubleValue()
case Type.STRING => UTF8String.fromString(v.toString)
+ case Type.FIXED => BigDecimal(v)
Review Comment:
Ok. let me add it here.
--
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]