Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23042#discussion_r234401696
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ---
    @@ -138,6 +138,11 @@ object TypeCoercion {
         case (DateType, TimestampType)
           => if (conf.compareDateTimestampInTimestamp) Some(TimestampType) 
else Some(StringType)
     
    +    // to support a popular use case of tables using Decimal(X, 0) for 
long IDs instead of strings
    +    // see SPARK-26070 for more details
    +    case (n: DecimalType, s: StringType) if n.scale == 0 => 
Some(DecimalType(n.precision, n.scale))
    --- End diff --
    
    > no implicit cast at all
    
    Is that too strict? I feel it's OK to compare an int with long. Maybe we 
should come up with a list of "definitely safe" type coercions, and allow them 
only.


---

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

Reply via email to