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

    https://github.com/apache/spark/pull/22448#discussion_r219018069
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ---
    @@ -89,10 +90,10 @@ object TypeCoercion {
         case (NullType, t1) => Some(t1)
         case (t1, NullType) => Some(t1)
     
    -    case (t1: IntegralType, t2: DecimalType) if t2.isWiderThan(t1) =>
    -      Some(t2)
    -    case (t1: DecimalType, t2: IntegralType) if t1.isWiderThan(t2) =>
    -      Some(t1)
    +    case (t1: IntegralType, t2: DecimalType) =>
    +      findWiderDecimalType(DecimalType.forType(t1), t2)
    +    case (t1: DecimalType, t2: IntegralType) =>
    +      findWiderDecimalType(t1, DecimalType.forType(t2))
     
         // Promote numeric types to the highest of the two
         case (t1: NumericType, t2: NumericType)
    --- End diff --
    
    shall we handle 2 decimals as well?


---

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

Reply via email to