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 2021/08/05 03:12:46 UTC

[GitHub] [spark] gengliangwang commented on a change in pull request #33638: [SPARK-36415][SQL][DOCS] Add docs for try_cast/try_add/try_divide

gengliangwang commented on a change in pull request #33638:
URL: https://github.com/apache/spark/pull/33638#discussion_r683096447



##########
File path: docs/sql-ref-ansi-compliance.md
##########
@@ -257,6 +257,15 @@ The behavior of some SQL operators can be different under ANSI mode (`spark.sql.
   - `map_col[key]`: This operator throws `NoSuchElementException` if key does not exist in map.
   - `GROUP BY`: aliases in a select list can not be used in GROUP BY clauses. Each column referenced in a GROUP BY clause shall unambiguously reference a column of the table resulting from the FROM clause.
 
+### Special functions for using the ANSI dialect
+
+After turning ANSI mode on, if you expect some of your SQL operations to not throw exceptions on errors, as Spark's default behavior, you can use the following functions.

Review comment:
       It's not "as if ANSI mode is disabled":
   1. The acceptable input of TRY_CAST is the same as "CAST" in ANSI mode
   2. When ANSI mode is disabled, `1+Int.MaxValue` is -2147483648, while `TRY_ADD(1, Int.MaxValue)` is null




-- 
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