tianshizz commented on a change in pull request #28443: URL: https://github.com/apache/spark/pull/28443#discussion_r419164577
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala ########## @@ -205,6 +205,29 @@ object DateTimeUtils { (day.toInt, MICROSECONDS.toNanos(micros)) } + /** + *Returns Gregorian days since epoch + */ + def toGregorianDays( + year: Int, + month: Byte = 1, + day: Byte = 1, + hour: Byte = 0, + minute: Byte = 0, + sec: Byte = 0): SQLDate = { + val calendar = new GregorianCalendar(year, month - 1, day, hour, minute, sec) Review comment: Ah, okay, should we close SPARK-31212 then? Is it the right behavior to not able to cast `1000-02-29`? ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org