Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6726#discussion_r32072533
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
 ---
    @@ -254,6 +254,37 @@ 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 => defineCodeGen (ctx, ev, {
    +        (c1, c3) => s"$c1 $symbol $c3"
    +      })
    +      case BinaryType =>
    +        val eval1 = left.gen(ctx)
    +        val eval2 = right.gen(ctx)
    +        s"""
    +          ${eval1.code}
    +          boolean ${ev.isNull} = ${eval1.isNull};
    +          boolean ${ev.primitive} = ${ctx.defaultValue(dataType)};
    +          if (!${ev.isNull}) {
    +            ${eval2.code}
    +            if (!${eval2.isNull}) {
    +              boolean done = false;
    --- End diff --
    
    can we call a function here? define some BinaryUtils to put everything for 
binary there. That makes it much easier to change.
     
    Code generated version can just generate the code to call that function.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to