Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22037#discussion_r208624572
  
    --- Diff: 
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala 
---
    @@ -138,10 +138,24 @@ class AvroDeserializer(rootAvroType: Schema, 
rootCatalystType: DataType) {
                 bytes
               case b: Array[Byte] => b
               case other => throw new RuntimeException(s"$other is not a valid 
avro binary.")
    -
             }
             updater.set(ordinal, bytes)
     
    +      case (FIXED, _: DecimalType) => (updater, ordinal, value) =>
    +        val decimal = Decimal(value.asInstanceOf[GenericFixed].bytes())
    --- End diff --
    
    shall we call `decimal.toPrecision(...)`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to