cloud-fan commented on code in PR #52762:
URL: https://github.com/apache/spark/pull/52762#discussion_r2472511072


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:
##########
@@ -90,7 +90,19 @@ trait TimestampFormatterHelper extends 
TimeZoneAwareExpression {
 
   @transient final protected lazy val formatterOption: 
Option[TimestampFormatter] =
     if (formatString.foldable) {
-      Option(formatString.eval()).map(fmt => getFormatter(fmt.toString))
+      Option(formatString.eval()).flatMap { fmt =>
+        try {
+          Some(getFormatter(fmt.toString))

Review Comment:
   ```suggestion
         Option(formatString.eval()).map { fmt =>
           try {
            getFormatter(fmt.toString)
   ```



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

To unsubscribe, e-mail: [email protected]

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