gengliangwang commented on a change in pull request #34985: URL: https://github.com/apache/spark/pull/34985#discussion_r773902811
########## File path: docs/sql-ref-ansi-compliance.md ########## @@ -70,23 +70,20 @@ SELECT abs(-2147483648); When `spark.sql.ansi.enabled` is set to `true`, explicit casting by `CAST` syntax throws a runtime exception for illegal cast patterns defined in the standard, e.g. casts from a string to an integer. -The `CAST` clause of Spark ANSI mode follows the syntax rules of section 6.13 "cast specification" in [ISO/IEC 9075-2:2011 Information technology — Database languages - SQL — Part 2: Foundation (SQL/Foundation)](https://www.iso.org/standard/53682.html), except it specially allows the following - straightforward type conversions which are disallowed as per the ANSI standard: -* NumericType <=> BooleanType -* StringType <=> BinaryType -* ArrayType => String -* MapType => String -* StructType => String +Comparing to the default behavior, the ANSI SQL mode also disallows the following type conversions: Review comment: This is the second difference. The first one is that it will throw runtime exception. -- 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]
