alamb opened a new issue, #8915:
URL: https://github.com/apache/arrow-datafusion/issues/8915

   ### Is your feature request related to a problem or challenge?
   
   After https://github.com/apache/arrow-datafusion/pull/8886 (thanks to 
@Omega359) DataFusion supports converting strings to timestamps using a string 
format:
   
   ```sql
   SELEECT to_timestamp('2020-09-08T12:00:00+00:00', '2020-09-08 
12/00/00+00:00', '%c', '%+', '%Y-%m-%d %H/%M/%s%#z'
   ```
   
   Which will parse `'2020-09-08T12:00:00+00:00'` with several possible 
formats` %c', '%+', '%Y-%m-%d`
   
   However, as @comphead  points out, the format used is specific to `chrono` , 
the underlying Rust library used. These are slightly different semantics than 
any existing `to_timestamp` (it isn't postgres format strings, nor is it spark 
format strings, it is something datafusion specific based on the rust chrono 
format strings)
   
   
   
   ### Describe the solution you'd like
   
   Ideally users could decide what "dialect" of string format specifiers they 
wanted to support based on configuration option. For example, either postgres 
or spark, 
   
   However, this is non trivial given the scope of those two implementations
   
   
   ### Describe alternatives you've considered
   
   Users can always use DataFusion's user defined functions to define the 
semantics they want, for example with a ScalarUDF  that rewrites the specified 
time string from a postgres format into the chrono format
   
   (though there are likely all sorts of corner cases -- see 
https://github.com/apache/arrow-datafusion/pull/8886#issuecomment-1899745153)
   
   
   
   
   ### Additional context
   
   
   @jhorstmann has notes about Postgres: 
https://github.com/apache/arrow-datafusion/issues/5398#issuecomment-1820970911
   @Omega359 notes that the spark format library is entirely different still: 
https://github.com/apache/arrow-datafusion/issues/5398#issuecomment-1866926774


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

Reply via email to