Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/3249#discussion_r25551740
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
---
@@ -422,6 +424,108 @@ class Analyzer(catalog: Catalog,
Generate(g, join = false, outer = false, None, child)
}
}
+
+ /**
+ * Transforms the query which has subquery expressions in where clause
to left semi join.
+ * select T1.x from T1 where T1.x in (select T2.y from T2) transformed to
+ * select T1.x from T1 left semi join T2 on T1.x = T2.y.
+ */
+ object SubQueryExpressions extends Rule[LogicalPlan] {
+
+ def apply(plan: LogicalPlan): LogicalPlan = plan transform {
+ case p: LogicalPlan if !p.childrenResolved => p
+ case filter @ Filter(conditions, child) =>
--- End diff --
We are not going to handle the non `Subquery` case here right? how about
```
case filter @ Filter(In(expr, SubqueryExpression(subquery)), child) =>
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]