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/02/10 14:01:57 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #35478: [SPARK-38176][SQL] ANSI mode: allow implicitly casting String to other simple types

cloud-fan commented on a change in pull request #35478:
URL: https://github.com/apache/spark/pull/35478#discussion_r803704536



##########
File path: docs/sql-ref-ansi-compliance.md
##########
@@ -188,34 +188,33 @@ java.lang.ArithmeticException: Casting 2147483648 to int causes overflow
 When `spark.sql.ansi.enabled` is set to `true`, Spark SQL uses several rules that govern how conflicts between data types are resolved.
 At the heart of this conflict resolution is the Type Precedence List which defines whether values of a given data type can be promoted to another data type implicitly.
 
-| Data type | precedence list(from narrowest to widest)                        |
-|-----------|------------------------------------------------------------------|
-| Byte      | Byte -> Short -> Int -> Long -> Decimal -> Float* -> Double      |
-| Short     | Short -> Int -> Long -> Decimal-> Float* -> Double               |
-| Int       | Int -> Long -> Decimal -> Float* -> Double                       |
-| Long      | Long -> Decimal -> Float* -> Double                              |
-| Decimal   | Decimal -> Float* -> Double                                      |
-| Float     | Float -> Double                                                  |
-| Double    | Double                                                           |
-| Date      | Date -> Timestamp                                                |
-| Timestamp | Timestamp                                                        |
-| String    | String                                                           |
-| Binary    | Binary                                                           |
-| Boolean   | Boolean                                                          |
-| Interval  | Interval                                                         |
-| Map       | Map**                                                            |
-| Array     | Array**                                                          |
-| Struct    | Struct**                                                         |
+| Data type | precedence list(from narrowest to widest)                            |
+|-----------|----------------------------------------------------------------------|
+| Byte      | Byte -> Short -> Int -> Long -> Decimal -> Float* -> Double          |
+| Short     | Short -> Int -> Long -> Decimal-> Float* -> Double                   |
+| Int       | Int -> Long -> Decimal -> Float* -> Double                           |
+| Long      | Long -> Decimal -> Float* -> Double                                  |
+| Decimal   | Decimal -> Float* -> Double                                          |
+| Float     | Float -> Double                                                      |
+| Double    | Double                                                               |
+| Date      | Date -> Timestamp                                                    |
+| Timestamp | Timestamp                                                            |
+| String    | String, Long -> Double, Date -> Timestamp, Boolean, Interval, Binary |

Review comment:
       I find this line a bit hard to understand. Shall we add some explanation below?




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