MaxGekk commented on a change in pull request #23358: [SPARK-26424][SQL] Use
java.time API in date/timestamp expressions
URL: https://github.com/apache/spark/pull/23358#discussion_r243538699
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala
##########
@@ -566,7 +566,7 @@ class DateFunctionsSuite extends QueryTest with
SharedSQLContext {
// february
val y1 = "2016-02-29"
- val y2 = "2017-02-29"
+ val y2 = "2017-02-32"
Review comment:
By default (in
[SMART](https://docs.oracle.com/javase/8/docs/api/java/time/format/ResolverStyle.html#SMART)
resolving style), new parser just checks that values fall to valid ranges. So,
it is 1-31 for `dd`. The parsed date is "casted" to closer valid date later.
In this particular case, `2017-02-29` is interpreted as a valid date because
`29` is in the range of `[1,31]`, and it is converted to number of
microseconds/days since epoch for `2017-02-28`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]