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

    https://github.com/apache/spark/pull/21935#discussion_r206742249
  
    --- Diff: 
external/avro/src/main/scala/org/apache/spark/sql/avro/SchemaConverters.scala 
---
    @@ -114,7 +121,10 @@ object SchemaConverters {
           case ByteType | ShortType | IntegerType => builder.intType()
           case LongType => builder.longType()
           case DateType => builder.longType()
    -      case TimestampType => builder.longType()
    +      case TimestampType =>
    +        // To be consistent with the previous behavior of writing 
Timestamp type with Avro 1.7,
    +        // the default output Avro Timestamp type is with millisecond 
precision.
    +        builder.longBuilder().prop(LogicalType.LOGICAL_TYPE_PROP, 
"timestamp-millis").endLong()
    --- End diff --
    
    is there a better API for it? hardcoding a string is hacky.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to