baibaichen commented on issue #8446:
URL: 
https://github.com/apache/incubator-gluten/issues/8446#issuecomment-2742662626

   The format **`YYYY`** is invalid in Java's **`SimpleDateFormat`**. Instead, 
you should use **`yyyy`** (lowercase) for the year. Using **`YYYY`** may result 
in an error or unexpected(as I test, spark 35 did throw an exception).
   
   Here are my test:
   ```scala
       withSQLConf(("spark.sql.legacy.timeParserPolicy" -> "legacy")) { // 
avoid throwing an exception in spark 3.5
         spark
           .sql("select date_format('2024-12-29 20:55:30', 'YYYY-MM-dd 
HH:00:00'), 
                       date_format('2024-12-29 20:55:30', 'yyyy-MM-dd 
HH:00:00')")
           .show(100, 100, vertical = true)
       }
   ```
   
   Here are results:
   
   ```
   -RECORD 0--------------------------------------------------------------------
    date_format(2024-12-29 20:55:30, YYYY-MM-dd HH:00:00) | 2025-12-29 20:00:00 
    date_format(2024-12-29 20:55:30, yyyy-MM-dd HH:00:00) | 2024-12-29 20:00:00 
   ```


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