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/11/21 11:35:29 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #38739: [SPARK-41207][SQL] Fix BinaryArithmetic with negative scale

LuciferYang commented on code in PR #38739:
URL: https://github.com/apache/spark/pull/38739#discussion_r1027903146


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -234,7 +234,17 @@ abstract class BinaryArithmetic extends BinaryOperator
   }
 
   override def dataType: DataType = (left.dataType, right.dataType) match {
-    case (DecimalType.Fixed(p1, s1), DecimalType.Fixed(p2, s2)) =>
+    case (DecimalType.Fixed(_p1, _s1), DecimalType.Fixed(_p2, _s2)) =>
+      // compatible with negative scale
+      val (p1, s1, p2, s2) = if (_s1 < 0 && _s2 < 0) {

Review Comment:
   nit: are there any other methods that use ยท`_xxx` for local vars name?
   
   



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