Skip to content
Prev Previous commit
Next Next commit
SPARK-6489: explode optimize - only deal with generate, other
situation return None
  • Loading branch information
dreamquster committed Apr 15, 2015
commit 8909a5d14dccc1933a451261bc0e56a2cc876897
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,13 @@ object ColumnPruning extends Rule[LogicalPlan] {
plan match {
case filter @ Filter(_, c) =>
val newChild = collectRefersUntilGen(collectRefers, c)
if (newChild != null) filter.copy(child = newChild) else filter
// null indicate child is not changed
if (newChild != null) filter.copy(child = newChild) else null
case gen @ Generate(_, _, _, _, c) =>
if ((c.outputSet -- collectRefers.filter(c.outputSet.contains)).nonEmpty) {
gen.copy(child = Project(collectRefers.filter(c.outputSet.contains).toSeq, c))
} else {
gen
null
}
case _ => null
}
Expand Down