cloud-fan commented on a change in pull request #32260:
URL: https://github.com/apache/spark/pull/32260#discussion_r616839630



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala
##########
@@ -562,13 +577,27 @@ case class IntegralDivide(
       case d: DecimalType =>
         d.asIntegral.asInstanceOf[Integral[Any]]
     }
-    (x, y) => {
-      val res = integral.quot(x, y)
-      if (res == null) {
-        null
-      } else {
-        integral.asInstanceOf[Integral[Any]].toLong(res)
+    val _div =
+      (x: Any, y: Any) => {
+        val res = integral.quot(x, y)
+        if (res == null) {
+          null
+        } else {
+          integral.asInstanceOf[Integral[Any]].toLong(res)
+        }
       }
+
+    dataType match {
+      case LongType if failOnError =>
+        (x: Any, y: Any) => {
+          if (x == Long.MinValue && y == -1) {

Review comment:
       yea, similar to the codegen path we can use `if (isIntegralDivide)`.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to