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
Next Next commit
Add more not null attributes for Filter codegen.
  • Loading branch information
viirya committed Mar 18, 2016
commit 8e59a7450db57ca210010fa3df1cb41a84311fed
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ 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 child.output.contains(a) => true
case IsNotNull(a) if a.references.subsetOf(child.outputSet) => true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct, for example, IsNotNull(IsNull(a)) does not means a can not be null.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, you are right. With the NullIntolerant trait introduced in #11809, we can solve this easily. Wait for that PR to be ready then we can re-visit this. Thanks!

case _ => false
}

// The columns that will filtered out by `IsNotNull` could be considered as not nullable.
private val notNullAttributes = notNullPreds.flatMap(_.references)
private val notNullAttributes =
notNullPreds.flatMap(_.references) ++ child.output.filterNot(_.nullable)

override def output: Seq[Attribute] = {
child.output.map { a =>
Expand Down