gengliangwang commented on a change in pull request #34448:
URL: https://github.com/apache/spark/pull/34448#discussion_r746672150
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -610,7 +610,7 @@ abstract class CastBase extends UnaryExpression with
TimeZoneAwareExpression wit
case BooleanType =>
buildCast[Boolean](_, b => if (b) 1L else 0L)
case DateType =>
- buildCast[Int](_, d => null)
+ buildCast[Int](_, d => timestampToLong(daysToMicros(d, zoneId)))
Review comment:
This will overflow in year 2039
--
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]