Github user gengliangwang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22037#discussion_r208699939
  
    --- Diff: 
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala ---
    @@ -86,7 +86,8 @@ class AvroSerializer(rootCatalystType: DataType, 
rootAvroType: Schema, nullable:
           case DoubleType =>
             (getter, ordinal) => getter.getDouble(ordinal)
           case d: DecimalType =>
    -        (getter, ordinal) => getter.getDecimal(ordinal, d.precision, 
d.scale).toString
    +        (getter, ordinal) =>
    +          ByteBuffer.wrap(getter.getDecimal(ordinal, d.precision, 
d.scale).toString.getBytes)
    --- End diff --
    
    I will update it to `decimal.toJavaBigDecimal.unscaledValue().toByteArray`


---

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

Reply via email to