cloud-fan commented on a change in pull request #28592:
URL: https://github.com/apache/spark/pull/28592#discussion_r429071489
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
##########
@@ -86,6 +86,33 @@ trait DateTimeFormatterHelper {
throw e
}
}
+
+ /**
+ * When the new DateTimeFormatter failed to initialize because of invalid
datetime pattern, it
+ * will throw IllegalArgumentException. If the pattern can be recognized by
the legacy formatter
+ * it will raise SparkUpgradeException to tell users to restore the previous
behavior via LEGACY
+ * policy or follow our guide to correct their pattern. Otherwise, the
original
+ * IllegalArgumentException will be thrown.
+ *
+ * @param pattern the date time pattern
+ * @param block a func to capture exception, identically which forces a
legacy datetime formatter
Review comment:
`block` is a bad name. How about `tryLegacyFormatter`?
----------------------------------------------------------------
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]