MaxGekk commented on a change in pull request #23594: [SPARK-26657][SQL] Use 
Proleptic Gregorian calendar in DayWeek and in WeekOfYear
URL: https://github.com/apache/spark/pull/23594#discussion_r249778044
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
 ##########
 @@ -231,8 +231,8 @@ class DateExpressionsSuite extends SparkFunSuite with 
ExpressionEvalHelper {
     checkEvaluation(WeekOfYear(Cast(Literal(date), DateType, gmtId)), 15)
     checkEvaluation(WeekOfYear(Cast(Literal(ts), DateType, gmtId)), 45)
     checkEvaluation(WeekOfYear(Cast(Literal("2011-05-06"), DateType, gmtId)), 
18)
-    checkEvaluation(WeekOfYear(Literal(new Date(toMillis("1582-10-15 
13:10:15")))), 40)
-    checkEvaluation(WeekOfYear(Literal(new Date(toMillis("1582-10-04 
13:10:15")))), 39)
+    checkEvaluation(WeekOfYear(Cast(Literal("1582-10-15 13:10:15"), DateType, 
gmtId)), 41)
 
 Review comment:
   It is interesting that previous checks for Julian calendar are also wrong: 
`1582-10-15 13:10:15` is `42` week, see 
https://www.timeanddate.com/calendar/?year=1582&country=23&wno=1

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to