Description
Expand to_char() to take date and timestamp expression as the first argument. For date and timestamp expression, the function will be equivalent to date_format(expr, fmt)
The goal is to achieve feature parity with other systems, and make the migration to Spark SQL easier:
- Snowflake: https://docs.snowflake.com/en/sql-reference/functions/to_char
- PostgreSQL: https://www.postgresql.org/docs/current/functions-formatting.html
- MariaDB: https://mariadb.com/kb/en/to_char/
- DB2: https://www.ibm.com/docs/en/db2/11.5?topic=sf-char
- Exasol: https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/to_char%20(datetime).htm