cloud-fan commented on a change in pull request #28766:
URL: https://github.com/apache/spark/pull/28766#discussion_r437966472



##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DatetimeFormatterSuite.scala
##########
@@ -51,4 +79,36 @@ trait DatetimeFormatterSuite extends SparkFunSuite with 
SQLHelper with Matchers
       pattern => 
intercept[SparkUpgradeException](checkFormatterCreation(pattern, true))
     }
   }
+
+  test("SPARK-31939: Fix Parsing day of year when year field pattern is 
missing") {
+    // resolved to queryable LocaleDate or fail directly
+    assertEqual("yyyy-dd-DD", "2020-29-60", date(2020, 2, 29))
+    assertError("yyyy-dd-DD", "2020-02-60",
+      "Field DayOfMonth 29 differs from DayOfMonth 2 derived from 2020-02-29")

Review comment:
       shall we remove `derived from 2020-02-29`? looks confusing.




----------------------------------------------------------------
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]

Reply via email to