yaooqinn edited a comment on pull request #28650:
URL: https://github.com/apache/spark/pull/28650#issuecomment-635448724
No the pattern `yyyyyyyyyyy-MM-dd` is valid for both version of formatters,
but calling the `format()` throws an exception in the new one but silently
suppressed in FromUnixTime expression. Now we are not suppressing the
exceptions in this PR,
it will do the same as `date_format`
```
spark-sql> select from_unixtime(1, 'yyyyyyyyyyy-MM-dd'); -- this is before
NULL
spark-sql> select date_format('now', 'yyyyyyyyyyy-MM-dd'); -- this will be
after for `from_unixtime` too
20/05/29 00:14:47 ERROR SparkSQLDriver: Failed in [ select
date_format('now', 'yyyyyyyyyyy-MM-dd')]
java.lang.ArrayIndexOutOfBoundsException: 11
at
java.time.format.DateTimeFormatterBuilder$NumberPrinterParser.format(DateTimeFormatterBuilder.java:2568)
at
java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.format(DateTimeFormatterBuilder.java:2190)
```
----------------------------------------------------------------
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]