Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.1.0
-
None
-
None
Description
Date and time related functions in Spark use DateTimeFormatter to parse and format dates where a pattern is defined. Unfortunately, it is not entirely compatible with the SQL:2016 standard.
There is an initiative in Impala: IMPALA-4018 and Hive HIVE-21575 to support SQL:2016 patterns as both these systems lack this feature currently.
The Impala design document and compatibility matrix created by gaborkaszab covers how the compliance with the standard can be achieved and how do other databases support this standard. I believe these documents are very useful for Spark community as well.
Since Hive is also JVM based I also see an option to share some code that does the parsing/formatting according to the standard.
(Please note that format patterns are just one part of these tickets, the other part about `CAST (... FORMAT <pattern>)` function, which is also part of the SQL:2016 standard, is covered here: SPARK-27881)