Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6574#discussion_r31878120
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala
 ---
    @@ -512,22 +512,22 @@ trait HiveTypeCoercion {
           // all other cases are considered as false.
     
           // We may simplify the expression if one side is literal numeric 
values
    -      case EqualTo(left @ BooleanType(), Literal(value, _: NumericType))
    -        if trueValues.contains(value) => left
    -      case EqualTo(left @ BooleanType(), Literal(value, _: NumericType))
    -        if falseValues.contains(value) => Not(left)
    -      case EqualTo(Literal(value, _: NumericType), right @ BooleanType())
    -        if trueValues.contains(value) => right
    -      case EqualTo(Literal(value, _: NumericType), right @ BooleanType())
    -        if falseValues.contains(value) => Not(right)
    -      case EqualNullSafe(left @ BooleanType(), Literal(value, _: 
NumericType))
    -        if trueValues.contains(value) => And(IsNotNull(left), left)
    -      case EqualNullSafe(left @ BooleanType(), Literal(value, _: 
NumericType))
    -        if falseValues.contains(value) => And(IsNotNull(left), Not(left))
    -      case EqualNullSafe(Literal(value, _: NumericType), right @ 
BooleanType())
    -        if trueValues.contains(value) => And(IsNotNull(right), right)
    -      case EqualNullSafe(Literal(value, _: NumericType), right @ 
BooleanType())
    -        if falseValues.contains(value) => And(IsNotNull(right), Not(right))
    +      case EqualTo(bool @ BooleanType(), Literal(value, _: NumericType))
    --- End diff --
    
    We only care about boolean type and literal type here, not left and right, 
so I use `bool` instead.


---
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