MaxGekk commented on code in PR #56825:
URL: https://github.com/apache/spark/pull/56825#discussion_r3485917248


##########
sql/core/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala:
##########
@@ -213,6 +213,28 @@ private[sql] class AvroDeserializer(
           s"Avro logical type $other cannot be converted to SQL type 
${TimeType().sql}.")
       }
 
+      case (LONG, t: TimestampLTZNanosType) => avroType.getLogicalType match {
+        // The timestamp-nanos logical type stores epoch-nanoseconds (Long), 
while the value is
+        // represented internally as (epochMicros, nanosWithinMicro). Floor 
semantics keep
+        // nanosWithinMicro in [0, 999] for pre-epoch values. Nanos timestamps 
are always proleptic
+        // Gregorian, so they are exempt from datetime rebasing.
+        case _: LogicalTypes.TimestampNanos => (updater, ordinal, value) =>

Review Comment:
   Good point - no, we don't. I added `TimestampNanos` and 
`LocalTimestampNanos` to the existing `org.apache.avro.LogicalTypes.{...}` 
import and dropped the `LogicalTypes.` prefix in `AvroDeserializer`, 
`AvroSerializer`, and `SchemaConverters`, to match the surrounding 
`TimestampMicros`/`LocalTimestampMicros` cases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to