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

    https://github.com/apache/spark/pull/11792#discussion_r57064001
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala ---
    @@ -110,23 +114,28 @@ case class Filter(condition: Expression, child: 
SparkPlan)
       override def doConsume(ctx: CodegenContext, input: Seq[ExprCode], row: 
String): String = {
         val numOutput = metricTerm(ctx, "numOutputRows")
     
    -    // filter out the nulls
    -    val filterOutNull = notNullAttributes.map { a =>
    -      val idx = child.output.indexOf(a)
    -      s"if (${input(idx).isNull}) continue;"
    -    }.mkString("\n")
    +    val conjuncts = splitConjunctivePredicates(condition)
     
    -    ctx.currentVars = input
    -    val predicates = otherPreds.map { e =>
    -      val bound = ExpressionCanonicalizer.execute(
    -        BindReferences.bindReference(e, output))
    -      val ev = bound.gen(ctx)
    +    // Generate the code to evaluate each filter.
    +    val generated = conjuncts.map { c =>
    --- End diff --
    
    That defeats the point of this. Then we're referencing all the attributes 
first before the predicates.


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