krinart opened a new pull request, #17479:
URL: https://github.com/apache/datafusion/pull/17479

   ## Which issue does this PR close?
   
   PR improves unparser to produce valid CAST SQL for SQLite and 
`timestamp_text`
   
   ## Rationale for this change
   
   Default implementation of `timestamp_cast_dtype` casts values to 
`Timestamp`. However you can see below that casting to `TIMESTAMP` produces 
invalid value in cast of sqlite, where casting to `TEXT` produces a valid one:
   
   ```bash
   sqlite> select event_time, cast(event_time as timestamp), cast(event_time as 
text) from my_table limit 1;
   
   2025-08-30 01:36:00.888580  |  2025  |  2025-08-30 01:36:00.888580
   ```
   
   ## What changes are included in this PR?
   
   PR introduces custom `timestamp_cast_dtype` implementation for 
`SqliteDialect`.
   
   ## Are these changes tested?
   
   Yes, added unit tests + manual testing
   
   ## Are there any user-facing changes?
   
   No


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