Skip to content

Commit 77c64bd

Browse files
committed
Fixed string type codegen.
1 parent ffedb62 commit 77c64bd

File tree

1 file changed

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

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ abstract class BinaryComparison extends BinaryExpression with Predicate {
254254
case dt: NumericType if ctx.isNativeType(dt) => defineCodeGen (ctx, ev, {
255255
(c1, c3) => s"$c1 $symbol $c3"
256256
})
257-
case DateType | TimestampType => defineCodeGen (ctx, ev, {
258-
(c1, c3) => s"$c1 $symbol $c3"
259-
})
260-
case other => defineCodeGen (ctx, ev, {
261-
(c1, c2) => s"$c1.compare($c2) $symbol 0"
262-
})
257+
case StringType =>
258+
defineCodeGen (ctx, ev, (c1, c2) => s"$c1.compareTo($c2) $symbol 0")
259+
case DateType | TimestampType =>
260+
defineCodeGen (ctx, ev, (c1, c3) => s"$c1 $symbol $c3")
261+
case _ =>
262+
defineCodeGen (ctx, ev, (c1, c2) => s"$c1.compare($c2) $symbol 0")
263263
}
264264
}
265265

0 commit comments

Comments
 (0)