Skip to content

Commit

Permalink
add exists to tree node
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-fan committed Jul 21, 2015
1 parent 2cab68c commit 330021e
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,9 @@ object PushPredicateThroughProject extends Rule[LogicalPlan] with PredicateHelpe
private def hasNondeterministic(
condition: Expression,
sourceAliases: AttributeMap[Expression]) = {
condition.find {
case a: Attribute =>
sourceAliases.get(a).map(_.find(!_.deterministic).isDefined).getOrElse(false)
case _ => false
}.isDefined
condition.collect {
case a: Attribute if sourceAliases.contains(a) => sourceAliases(a)
}.exists(!_.deterministic)
}

// Substitute any attributes that are produced by the child projection, so that we safely
Expand Down

0 comments on commit 330021e

Please sign in to comment.