luluorta commented on a change in pull request #29882:
URL: https://github.com/apache/spark/pull/29882#discussion_r504449033
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala
##########
@@ -320,24 +320,31 @@ trait DivModLike extends BinaryArithmetic {
override def nullable: Boolean = true
- final override def eval(input: InternalRow): Any = {
- val input2 = right.eval(input)
- if (input2 == null || input2 == 0) {
+ private lazy val isZero: Any => Boolean = right.dataType match {
+ case _: DecimalType => x => x.asInstanceOf[Decimal].isZero
+ case _ => x => x == 0
+ }
+
+ private def divByZero: Any = {
+ if (checkOverflow) {
Review comment:
done
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]