Skip to content

Commit

Permalink
Fixed string type codegen.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin committed Jun 11, 2015
1 parent ffedb62 commit 77c64bd
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ abstract class BinaryComparison extends BinaryExpression with Predicate {
case dt: NumericType if ctx.isNativeType(dt) => defineCodeGen (ctx, ev, {
(c1, c3) => s"$c1 $symbol $c3"
})
case DateType | TimestampType => defineCodeGen (ctx, ev, {
(c1, c3) => s"$c1 $symbol $c3"
})
case other => defineCodeGen (ctx, ev, {
(c1, c2) => s"$c1.compare($c2) $symbol 0"
})
case StringType =>
defineCodeGen (ctx, ev, (c1, c2) => s"$c1.compareTo($c2) $symbol 0")
case DateType | TimestampType =>
defineCodeGen (ctx, ev, (c1, c3) => s"$c1 $symbol $c3")
case _ =>
defineCodeGen (ctx, ev, (c1, c2) => s"$c1.compare($c2) $symbol 0")
}
}

Expand Down

0 comments on commit 77c64bd

Please sign in to comment.