Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into add-more-not-null…
…-attrs

Conflicts:
	sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala
  • Loading branch information
viirya committed Apr 2, 2016
commit 65ea0dd283a93239de72147acb1cfb7768620c90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ case class Filter(condition: Expression, child: SparkPlan)

// Split out all the IsNotNulls from condition.
private val (notNullPreds, otherPreds) = splitConjunctivePredicates(condition).partition {
case IsNotNull(a) if a.references.subsetOf(child.outputSet) => true
case IsNotNull(a: NullIntolerant) if a.references.subsetOf(child.outputSet) => true
case _ => false
}

Expand Down Expand Up @@ -114,15 +114,12 @@ case class Filter(condition: Expression, child: SparkPlan)
override def doConsume(ctx: CodegenContext, input: Seq[ExprCode], row: ExprCode): String = {
val numOutput = metricTerm(ctx, "numOutputRows")

// filter out the nulls
val filterOutNull = notNullAttributes.map { a =>
val idx = child.output.map(_.exprId).indexOf(a)
if (idx != -1) {
s"if (${input(idx).isNull}) continue;"
} else {
""
}
}.mkString("\n")
/**
* Generates code for `c`, using `in` for input attributes and `attrs` for nullability.
*/
def genPredicate(c: Expression, in: Seq[ExprCode], attrs: Seq[Attribute]): String = {
val bound = BindReferences.bindReference(c, attrs)
val evaluated = evaluateRequiredVariables(child.output, in, c.references)

// Generate the code for the predicate.
val ev = ExpressionCanonicalizer.execute(bound).gen(ctx)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.