jhorstmann commented on issue #5398:
URL: 
https://github.com/apache/arrow-datafusion/issues/5398#issuecomment-1820970911

   Having recently implemented this in our proprietary engine, these were my 
notes regarding postgres, compared to other pattern syntaxes:
   
    - Seems very exhaustive but also super complex 
    - Features include years with commas, multipe variants of AM/PM indicates, 
roman numerals, complete sub-syntax for number formatting and padding 
    - In my opinion much too complex to implement, we’d need to define a small 
subset, at which point we can no longer claim postgres compatibility
   
   We ended up implementing a pattern syntax closer to the one supported by 
Java 
[SimpleDateFormat](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html),
 supporting a subset of those pattern characters. Similar syntax is supported 
by Presto/TrinoDB/Athena and so should be familiar to our users. My personal 
opinion was also that the percent-based syntax from MySQL or chrono looked a 
bit ugly, and does not make the width or padding of fields obvious.
   
   Internally we however translated the user-facing syntax to [chrono format 
items](https://docs.rs/chrono/latest/chrono/format/enum.Item.html) and used 
[chrono::format::parse](https://docs.rs/chrono/latest/chrono/format/fn.parse.html)


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