xuanyuanking commented on a change in pull request #27537:
[SPARK-30668][SQL][FOLLOWUP] Raise exception instead of silent change for new
TimestampFormatter
URL: https://github.com/apache/spark/pull/27537#discussion_r386378696
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateFormatter.scala
##########
@@ -42,7 +45,15 @@ class Iso8601DateFormatter(
override def parse(s: String): Int = {
val specialDate = convertSpecialDate(s.trim, zoneId)
specialDate.getOrElse {
- val localDate = LocalDate.parse(s, formatter)
+ val localDate = try {
+ LocalDate.parse(s, formatter)
+ } catch {
+ case e: DateTimeParseException if DateFormatter.hasDiffResult(s,
pattern, zoneId) =>
+ throw new RuntimeException(e.getMessage + ", set " +
Review comment:
Thanks for reminding, fix for the non-codegen in fbac26d.
----------------------------------------------------------------
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]