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

    https://github.com/apache/spark/pull/863#discussion_r13019060
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
    @@ -206,17 +206,24 @@ class SQLContext(@transient val sparkContext: 
SparkContext)
          * final desired output requires complex expressions to be evaluated 
or when columns can be
          * further eliminated out after filtering has been done.
          *
    +     * The `prunePushedDownFilter` is used to remove those filters that 
can be removed by the filter
    +     * pushdown optimization.
    +     *
          * The required attributes for both filtering and expression 
evaluation are passed to the
          * provided `scanBuilder` function so that it can avoid unnecessary 
column materialization.
          */
         def pruneFilterProject(
             projectList: Seq[NamedExpression],
             filterPredicates: Seq[Expression],
    +        prunePushedDownFilter: Option[Expression => Boolean],
             scanBuilder: Seq[Attribute] => SparkPlan): SparkPlan = {
     
           val projectSet = projectList.flatMap(_.references).toSet
           val filterSet = filterPredicates.flatMap(_.references).toSet
    -      val filterCondition = filterPredicates.reduceLeftOption(And)
    +      val filterCondition = prunePushedDownFilter
    +        .map(filterPredicates.filter)
    --- End diff --
    
    I find this slightly hard to understand because prunePushedDownFilter is an 
option. Can we write this out as a full closure?


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

Reply via email to