Skip to content

Commit 9bd6930

Browse files
committed
revert accidental change
1 parent e6f44c4 commit 9bd6930

File tree

1 file changed

+5
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+5
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/math.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,11 @@ case class Atan2(left: Expression, right: Expression)
404404
case class Pow(left: Expression, right: Expression)
405405
extends BinaryMathExpression(math.pow, "POWER") {
406406
override def genCode(ctx: CodeGenContext, ev: GeneratedExpressionCode): String = {
407-
defineCodeGen(ctx, ev, (c1, c2) => s"java.lang.Math.pow($c1, $c2)")
407+
defineCodeGen(ctx, ev, (c1, c2) => s"java.lang.Math.pow($c1, $c2)") + s"""
408+
if (Double.valueOf(${ev.primitive}).isNaN()) {
409+
${ev.isNull} = true;
410+
}
411+
"""
408412
}
409413
}
410414

0 commit comments

Comments
 (0)