Skip to content

Commit

Permalink
update comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxb1987 committed May 17, 2017
1 parent 3890b91 commit aa16ab3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT
case _ => Seq.empty[Attribute]
}

// Collect aliases from expressions, so we may avoid producing recursive constraints.
// Collect aliases from expressions of the whole tree rooted by the current QueryPlan node, so
// we may avoid producing recursive constraints.
private lazy val aliasMap: AttributeMap[Expression] = AttributeMap(
expressions.collect {
case a: Alias => (a.toAttribute, a.child)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ class InferFiltersFromConstraintsSuite extends PlanTest {
val t1 = testRelation.subquery('t1)
val t2 = testRelation.subquery('t2)

// We should prevent `Coalese(a, b)` from recursively creating complicated constraints through
// the constraint inference procedure.
val originalQuery = t1.select('a, 'b.as('d), Coalesce(Seq('a, 'b)).as('int_col))
// We hide an `Alias` inside the child's child's expressions, to cover the situation reported
// in [SPARK-20700].
.select('int_col, 'd, 'a).as("t")
.join(t2, Inner,
Some("t.a".attr === "t2.a".attr
Expand Down

0 comments on commit aa16ab3

Please sign in to comment.