MaxGekk commented on a change in pull request #27494: [WIP] Port `millisToDays`
and `daysToMillis` on Java 8 time API
URL: https://github.com/apache/spark/pull/27494#discussion_r376614669
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -494,7 +494,7 @@ class DateExpressionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
// Valid range of DateType is [0001-01-01, 9999-12-31]
val maxMonthInterval = 10000 * 12
checkEvaluation(
- AddMonths(Literal(Date.valueOf("0001-01-01")),
Literal(maxMonthInterval)), 2933261)
+ AddMonths(Literal(LocalDate.parse("0001-01-01")),
Literal(maxMonthInterval)), 2933263)
Review comment:
I had to replace `Date.valueOf` by `LocalDate.parse` due to migration on
another calendar from Julian to Gregorian. The expected number of days is easy
to get:
```scala
val a = LocalDate.of(10001, 1, 1).toEpochDay
println(a)
2933263
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]