gengliangwang commented on a change in pull request #35379:
URL: https://github.com/apache/spark/pull/35379#discussion_r808827105



##########
File path: 
external/avro/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala
##########
@@ -166,30 +183,84 @@ private[sql] class AvroSerializer(
         (getter, ordinal) => ByteBuffer.wrap(getter.getBinary(ordinal))
 
       case (DateType, INT) =>
-        (getter, ordinal) => dateRebaseFunc(getter.getInt(ordinal))
+        (getter, ordinal) =>
+          getter.get(ordinal, DateType) match {

Review comment:
       Nit: we can save the Int result to a variable and then call 
`dateRebaseFunc(..)` at the end to reduce duplicated code.




-- 
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