yaooqinn commented 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
   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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to