tlfua commented on issue #7471:
URL: 
https://github.com/apache/datafusion-comet/issues/7471#issuecomment-6674528964

   A cast from `DATE` to `STRING` has the same problem, raised in review on 
https://github.com/apache/datafusion-comet/pull/7457 . Comet sends it to 
arrow-cast's `value_to_string`, whose `ValueFormatter::write` ignores the 
`safe` option, so a date beyond chrono's year range raises in every mode:
   
   ```sql
   CREATE TABLE big_date(dt date) USING parquet;
   INSERT INTO big_date SELECT date_from_unix_date(100000000);
   SELECT dt, CAST(dt AS STRING) FROM big_date;
   ```
   
   Spark returns the date and its string. Comet fails with `Cast error: Failed 
to convert 100000000 to temporal for Date32` (checked on Spark 4.1 with a 
`CometSqlFileTestSuite` fixture). Implicit casts such as `concat(s, dt)` go the 
same way. https://github.com/apache/datafusion-comet/pull/7457 now treats this 
cast as able to fail for TopK sort keys.
   


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