gengliangwang commented on pull request #35896: URL: https://github.com/apache/spark/pull/35896#issuecomment-1075253530
@srowen good question. The major motivation is for better adoption of the ANSI SQL mode. As we know, the ANSI SQL mode can improve the data quality since it throws exceptions instead of returning null results on overflow errors. However, after turning on ANSI mode users may face unnecessary runtime interrupts, e.g. a function which they don't care if its result is null. These "try_*" functions provide alternative solutions to finish their query. This is not rare in other database systems, for example: * Snowflake has try_* functions: https://docs.snowflake.com/en/sql-reference/functions/try_cast.html * BigQuery has safe_* functions: https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#safe_prefix My first goal is to add try_* functions for all the functions which can overflow. There should not be many of them. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
