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

    https://github.com/apache/spark/pull/20023#discussion_r161818562
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecision.scala
 ---
    @@ -243,17 +279,43 @@ object DecimalPrecision extends TypeCoercionRule {
         // Promote integers inside a binary expression with fixed-precision 
decimals to decimals,
         // and fixed-precision decimals in an expression with floats / doubles 
to doubles
         case b @ BinaryOperator(left, right) if left.dataType != 
right.dataType =>
    -      (left.dataType, right.dataType) match {
    -        case (t: IntegralType, DecimalType.Fixed(p, s)) =>
    --- End diff --
    
    we can do
    ```
    (left, right) match {
      case (l: Literal, r) => ...
      
      case (DecimalType.Expression(p, s), r @ IntergralType()) => ...
    }
    ```


---

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

Reply via email to