MaxGekk commented on a change in pull request #28443:
URL: https://github.com/apache/spark/pull/28443#discussion_r419162505
##########
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:
it is not pure Gregorian calendar. For 1000-02-29, it is Julian
calendar.
----------------------------------------------------------------
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]