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

    https://github.com/apache/spark/pull/22037#discussion_r208625409
  
    --- 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 --
    
    `toString.getBytes`? that would be pretty slow, how does avro store decimal 
physically?


---

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

Reply via email to