Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/8606#discussion_r39100128
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
---
@@ -82,7 +90,9 @@ object DateTimeUtils {
// SPARK-6785: use Math.floor so negative number of days (dates before
1970)
// will correctly work as input for function toJavaDate(Int)
val millisLocal = millisUtc +
threadLocalLocalTimeZone.get().getOffset(millisUtc)
- Math.floor(millisLocal.toDouble / MILLIS_PER_DAY).toInt
+ val days = Math.floor(millisLocal.toDouble / MILLIS_PER_DAY)
+ require(days <= Integer.MAX_VALUE && days >= Integer.MIN_VALUE, "Date
exceeeds allowed range.")
--- End diff --
I'd assume the millisUtc is a valid timestamp, then this check is not
needed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]