beliefer opened a new pull request #31847: URL: https://github.com/apache/spark/pull/31847
### What changes were proposed in this pull request? Data Type Formatting Functions: `to_number` and `to_char` is very useful. There are some mainstream database support the syntax. **PostgreSQL:** **Oracle:** **Vertica** **Redshift** **DB2** **Teradata** **Snowflake:** **Exasol** **Phoenix** **Singlestore** **Intersystems** The implement has many different between `Postgresql` ,`Oracle` and `Phoenix`. So, this PR follows the implement of `to_number` in `Oracle` that give a strict parameter verification. So, this PR follows the implement of `to_number` in `Phoenix` that uses BigDecimal. This PR support the patterns for numeric formatting as follows: Pattern | Description -- | -- 9 | Value with the specified number of digits 0 | Value with leading zeros . (period) | Decimal point , (comma) | Group (thousand) separator S | Sign anchored to number (uses locale) $ | a value with a leading dollar sign D | Decimal point (uses locale) G | Group separator (uses locale) ### Why are the changes needed? to_number and to_char are very useful for formatted currency to number conversion. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Jenkins test ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
