Skip to content

Commit 476b4ab

Browse files
committed
Replace example query plan.
1 parent 38631bb commit 476b4ab

File tree

1 file changed

+15
-7
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+15
-7
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,21 @@ case class In(value: Expression, list: Seq[Expression]) extends Predicate {
149149
// SPARK-21759:
150150
// It is possibly that the subquery plan has more output than value expressions, because
151151
// the condition expressions in `ListQuery` might use part of subquery plan's output.
152-
// For example, in the following query plan, the condition of `ListQuery` uses value#207
153-
// from the subquery query. For now the size of output of subquery is 2, the size of value
154-
// is 1.
155-
//
156-
// Filter key#201 IN (list#200 [(value#207 = min(value)#204)])
157-
// : +- Project [key#206, value#207]
158-
// : +- Filter (value#207 > val_9)
152+
// For example, in the following query plan, the condition of `ListQuery` uses d#3.
153+
// from the subquery query. For now the size of output of subquery is 2(c#2, d#3), the
154+
// size of value is 1 (a#0).
155+
// Query:
156+
// SELECT t1.a FROM t1
157+
// WHERE
158+
// t1.a IN (SELECT t2.c
159+
// FROM t2
160+
// WHERE t1.b < t2.d);
161+
// Query Plan:
162+
// Project [a#0]
163+
// +- Filter a#0 IN (list#4 [(b#1 < d#3)])
164+
// : +- Project [c#2, d#3]
165+
// : +- LocalRelation <empty>, [c#2, d#3]
166+
// +- LocalRelation <empty>, [a#0, b#1]
159167

160168
// Take the subset of output which are not going to match with value expressions and also
161169
// not used in condition expressions, if any.

0 commit comments

Comments
 (0)