cloud-fan commented on code in PR #40693:
URL: https://github.com/apache/spark/pull/40693#discussion_r1162309743


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:
##########
@@ -821,10 +822,11 @@ case class Divide(
 
   private lazy val div: (Any, Any) => Any = dataType match {
     case d @ DecimalType.Fixed(precision, scale) => (l, r) => {
-      val value = d.fractional.asInstanceOf[Fractional[Any]].div(l, r)
+      val value =
+        PhysicalDecimalType(precision, 
scale).fractional.asInstanceOf[Fractional[Any]].div(l, r)

Review Comment:
   actually we can just return `PhysicalDecimalType(precision, 
scale).fractional.asInstanceOf[Fractional[Any]].div`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to