cloud-fan commented on a change in pull request #32869:
URL: https://github.com/apache/spark/pull/32869#discussion_r649399569



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -1204,6 +1207,11 @@ abstract class CastBase extends UnaryExpression with 
TimeZoneAwareExpression wit
         (c, evPrim, evNull) =>
           code"""$evPrim =
             org.apache.spark.sql.catalyst.util.DateTimeUtils.microsToDays($c, 
$zid);"""
+      case TimestampWithoutTZType =>
+        (c, evPrim, evNull) =>
+          // scalastyle:off line.size.limit
+          code"$evPrim = 
org.apache.spark.sql.catalyst.util.DateTimeUtils.microsToDays($c, 
java.time.ZoneOffset.UTC);"

Review comment:
       nit: we can add a `protected def dtUtilCls = 
classOf[DateTimeUtils].getClass.getName` in `CaseBase`, to shorten the code 
here and other places.




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

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