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

    https://github.com/apache/spark/pull/8799#discussion_r39791707
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala ---
    @@ -102,46 +102,32 @@ private[orc] object OrcFilters extends Logging {
               negate <- buildSearchArgument(child, builder.startNot())
             } yield negate.end()
     
    -      case EqualTo(attribute, value) =>
    -        Option(value)
    -          .filter(isSearchableLiteral)
    -          .map(builder.equals(attribute, _))
    +      case EqualTo(attribute, value) if isSearchableLiteral(value) =>
    +        Some(builder.startAnd().equals(attribute, value).end())
     
    -      case EqualNullSafe(attribute, value) =>
    -        Option(value)
    -          .filter(isSearchableLiteral)
    -          .map(builder.nullSafeEquals(attribute, _))
    +      case EqualNullSafe(attribute, value) if isSearchableLiteral(value) =>
    +        Some(builder.startAnd().nullSafeEquals(attribute, value).end())
     
    -      case LessThan(attribute, value) =>
    -        Option(value)
    -          .filter(isSearchableLiteral)
    -          .map(builder.lessThan(attribute, _))
    +      case LessThan(attribute, value) if isSearchableLiteral(value) =>
    +        Some(builder.startAnd().lessThan(attribute, value).end())
     
    -      case LessThanOrEqual(attribute, value) =>
    -        Option(value)
    -          .filter(isSearchableLiteral)
    -          .map(builder.lessThanEquals(attribute, _))
    +      case LessThanOrEqual(attribute, value) if isSearchableLiteral(value) 
=>
    +        Some(builder.startAnd().lessThanEquals(attribute, value).end())
     
    -      case GreaterThan(attribute, value) =>
    -        Option(value)
    -          .filter(isSearchableLiteral)
    -          .map(builder.startNot().lessThanEquals(attribute, _).end())
    +      case GreaterThan(attribute, value) if isSearchableLiteral(value) =>
    +        Some(builder.startNot().lessThanEquals(attribute, value).end())
     
    -      case GreaterThanOrEqual(attribute, value) =>
    -        Option(value)
    -          .filter(isSearchableLiteral)
    -          .map(builder.startNot().lessThan(attribute, _).end())
    +      case GreaterThanOrEqual(attribute, value) if 
isSearchableLiteral(value) =>
    +        Some(builder.startNot().lessThan(attribute, value).end())
     
           case IsNull(attribute) =>
    -        Some(builder.isNull(attribute))
    +        Some(builder.startAnd().isNull(attribute).end())
     
           case IsNotNull(attribute) =>
             Some(builder.startNot().isNull(attribute).end())
     
    -      case In(attribute, values) =>
    -        Option(values)
    -          .filter(_.forall(isSearchableLiteral))
    -          .map(builder.in(attribute, _))
    --- End diff --
    
    The `in(attribute, _)` part is wrong, because `in` accepts varargs instead 
of a list.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to