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

    https://github.com/apache/spark/pull/13915#discussion_r68535509
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryTableScanExec.scala
 ---
    @@ -60,29 +60,31 @@ private[sql] case class InMemoryTableScanExec(
           if buildFilter.isDefinedAt(lhs) && buildFilter.isDefinedAt(rhs) =>
           buildFilter(lhs) || buildFilter(rhs)
     
    -    case EqualTo(a: AttributeReference, l: Literal) =>
    -      statsFor(a).lowerBound <= l && l <= statsFor(a).upperBound
    -    case EqualTo(l: Literal, a: AttributeReference) =>
    -      statsFor(a).lowerBound <= l && l <= statsFor(a).upperBound
    +    case EqualTo(a: AttributeReference, value: Literal) =>
    +      statsFor(a).lowerBound <= value && value <= statsFor(a).upperBound
    +    case EqualTo(value: Literal, a: AttributeReference) =>
    +      statsFor(a).lowerBound <= value && value <= statsFor(a).upperBound
     
    -    case LessThan(a: AttributeReference, l: Literal) => 
statsFor(a).lowerBound < l
    -    case LessThan(l: Literal, a: AttributeReference) => l < 
statsFor(a).upperBound
    +    case LessThan(a: AttributeReference, value: Literal) => 
statsFor(a).lowerBound < value
    +    case LessThan(value: Literal, a: AttributeReference) => value < 
statsFor(a).upperBound
     
    -    case LessThanOrEqual(a: AttributeReference, l: Literal) => 
statsFor(a).lowerBound <= l
    -    case LessThanOrEqual(l: Literal, a: AttributeReference) => l <= 
statsFor(a).upperBound
    +    case LessThanOrEqual(a: AttributeReference, value: Literal) => 
statsFor(a).lowerBound <= value
    +    case LessThanOrEqual(value: Literal, a: AttributeReference) => value 
<= statsFor(a).upperBound
     
    -    case GreaterThan(a: AttributeReference, l: Literal) => l < 
statsFor(a).upperBound
    -    case GreaterThan(l: Literal, a: AttributeReference) => 
statsFor(a).lowerBound < l
    +    case GreaterThan(a: AttributeReference, value: Literal) => value < 
statsFor(a).upperBound
    +    case GreaterThan(value: Literal, a: AttributeReference) => 
statsFor(a).lowerBound < value
     
    -    case GreaterThanOrEqual(a: AttributeReference, l: Literal) => l <= 
statsFor(a).upperBound
    -    case GreaterThanOrEqual(l: Literal, a: AttributeReference) => 
statsFor(a).lowerBound <= l
    +    case GreaterThanOrEqual(a: AttributeReference, value: Literal) =>
    +      value <= statsFor(a).upperBound
    +    case GreaterThanOrEqual(value: Literal, a: AttributeReference) =>
    +      statsFor(a).lowerBound <= value
     
         case IsNull(a: Attribute) => statsFor(a).nullCount > 0
         case IsNotNull(a: Attribute) => statsFor(a).count - 
statsFor(a).nullCount > 0
     
         case In(a: AttributeReference, list: Seq[Expression]) if 
list.forall(_.isInstanceOf[Literal]) =>
    -      list.map(l => statsFor(a).lowerBound <= l.asInstanceOf[Literal] &&
    -        l.asInstanceOf[Literal] <= statsFor(a).upperBound).reduce(_ || _)
    +      list.map(value => statsFor(a).lowerBound <= 
value.asInstanceOf[Literal] &&
    --- End diff --
    
    Maybe while we're here we can fix this redundant expression too. 
`list.map(...).reduce(_ || _)` is less clear than simply `list.exists(...)`


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