Skip to content

Commit

Permalink
specified as ListQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
wzhfy committed Mar 28, 2017
1 parent 0be551a commit d3a174a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ trait PredicateHelper {
* Returns true iff `expr` could be evaluated as a condition within join.
*/
protected def canEvaluateWithinJoin(expr: Expression): Boolean = expr match {
case e: SubqueryExpression => false
case l: ListQuery => false
case e: SubqueryExpression =>
// non-correlated subquery will be replaced as literal
e.children.isEmpty
case a: AttributeReference => true
case e: Unevaluable => false
case e => e.children.forall(canEvaluateWithinJoin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ class JoinOptimizationSuite extends PlanTest {
}
}

test("reorder inner joins - don't put predicate with subquery into join condition") {
test("reorder inner joins - don't put predicate with IN subquery into join condition") {
// ReorderJoin collects all predicates and try to put them into join condition when creating
// ordered join. If a predicate with a subquery is in a join condition instead of a filter
// ordered join. If a predicate with an IN subquery is in a join condition instead of a filter
// condition, `RewritePredicateSubquery.rewriteExistentialExpr` would fail to convert the
// subquery to an ExistenceJoin, and thus result in error.
val x = testRelation.subquery('x)
Expand Down

0 comments on commit d3a174a

Please sign in to comment.