You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/24 10:13:45 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #32787: [SPARK-35618][SQL] Resolve star expressions in subqueries using outer query plans
cloud-fan commented on a change in pull request #32787:
URL: https://github.com/apache/spark/pull/32787#discussion_r657816274
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -1571,6 +1582,26 @@ class Analyzer(override val catalogManager: CatalogManager)
}
}
+ // Expand the star expression using the input plan first. If failed, try resolve
+ // the star expression using the outer query plan and wrap the resolved attributes
+ // in outer references. Otherwise throw the original exception.
+ private def expand(s: Star, plan: LogicalPlan): Seq[NamedExpression] = {
+ withPosition(s) {
+ try {
+ s.expand(plan, resolver)
+ } catch {
+ case e: AnalysisException =>
+ AnalysisContext.get.outerPlan.map(p =>
+ // Only a few unary nodes (Project/Aggregate) can host star expressions.
+ Try(s.expand(p.children.head, resolver)) match {
Review comment:
how do we expand star for join in the main query?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org