Skip to content

Commit

Permalink
Fix Scala 2.10 match reachability build error
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjoon-hyun committed Jul 1, 2016
1 parent 2892372 commit 984854b
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,18 @@ object PropagateEmptyRelation extends Rule[LogicalPlan] with PredicateHelper {
}

case p: UnaryNode if p.children.nonEmpty && p.children.forall(isEmptyLocalRelation) => p match {
case _: Project | _: Filter | _: Sample | _: Sort | _: GlobalLimit | _: LocalLimit |
_: Repartition | _: RepartitionByExpression => empty(p)
case _: Project => empty(p)
case _: Filter => empty(p)
case _: Sample => empty(p)
case _: Sort => empty(p)
case _: GlobalLimit => empty(p)
case _: LocalLimit => empty(p)
case _: Repartition => empty(p)
case _: RepartitionByExpression => empty(p)
// AggregateExpressions like COUNT(*) return their results like 0.
case Aggregate(_, ae, _) if !ae.exists(containsAggregateExpression) => empty(p)
// Generators like Hive-style UDTF may return their records within `close`.
case Generate(_ : Explode, _, _, _, _, _) => empty(p)
case Generate(_: Explode, _, _, _, _, _) => empty(p)
case _ => p
}
}
Expand Down

0 comments on commit 984854b

Please sign in to comment.