Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21935#discussion_r207095253
--- Diff:
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala ---
@@ -93,7 +94,13 @@ class AvroSerializer(rootCatalystType: DataType,
rootAvroType: Schema, nullable:
case DateType =>
(getter, ordinal) => getter.getInt(ordinal) *
DateTimeUtils.MILLIS_PER_DAY
case TimestampType =>
- (getter, ordinal) => getter.getLong(ordinal) / 1000
+ (getter, ordinal) => avroType.getLogicalType match {
--- End diff --
do not do pattern match per record, we should
```
avroType.getLogicalType match {
case _: TimestampMillis => (getter, ordinal) => ...
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]