Skip to content

Commit fc6b4d2

Browse files
committed
Update CodeGenerator
1 parent 3998ef2 commit fc6b4d2

File tree

1 file changed

+2
-2
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen

1 file changed

+2
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ class CodeGenContext {
194194
def genComp(dataType: DataType, c1: String, c2: String): String = dataType match {
195195
// java boolean doesn't support > or < operator
196196
case BooleanType => s"($c1 == $c2 ? 0 : ($c1 ? 1 : -1))"
197-
case DoubleType => s"org.apache.spark.sql.catalyst.util.TypeUtils.compareDoubles($c1, $c2)"
198-
case FloatType => s"org.apache.spark.sql.catalyst.util.TypeUtils.compareFloats($c1, $c2)"
197+
case DoubleType => s"org.apache.spark.util.Utils.nanSafeCompareDoubles($c1, $c2)"
198+
case FloatType => s"org.apache.spark.util.Utils.nanSafeCompareFloats($c1, $c2)"
199199
// use c1 - c2 may overflow
200200
case dt: DataType if isPrimitiveType(dt) => s"($c1 > $c2 ? 1 : $c1 < $c2 ? -1 : 0)"
201201
case BinaryType => s"org.apache.spark.sql.catalyst.util.TypeUtils.compareBinary($c1, $c2)"

0 commit comments

Comments
 (0)