You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/22 14:29:02 UTC

[GitHub] [spark] gengliangwang commented on pull request #35896: [SPARK-38589][SQL] New SQL function: try_avg

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org