cloud-fan commented on a change in pull request #31758:
URL: https://github.com/apache/spark/pull/31758#discussion_r588151665
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -1964,28 +1963,22 @@ class Analyzer(override val catalogManager:
CatalogManager)
*
* @param e The expression need to be resolved.
* @param q The LogicalPlan whose children are used to resolve expression's
attribute.
- * @param trimAlias When true, trim unnecessary alias of GetStructField`.
Note that,
- * we cannot trim the alias of top-level `GetStructField`,
as we should
- * resolve `UnresolvedAttribute` to a named expression. The
caller side
- * can trim the alias of top-level `GetStructField` if it's
safe to do so.
* @return resolved Expression.
*/
def resolveExpressionByPlanChildren(
e: Expression,
- q: LogicalPlan,
- trimAlias: Boolean = false): Expression = {
+ q: LogicalPlan): Expression = {
resolveExpression(
e,
q,
resolveColumnByName = nameParts => {
q.resolveChildren(nameParts, resolver)
},
resolveColumnByOrdinal = ordinal => {
- val candidates = q.children.flatMap(_.output)
- assert(ordinal >= 0 && ordinal < candidates.length)
- candidates.apply(ordinal)
+ assert(q.children.length == 1)
Review comment:
This change is not related to this PR, but a small followup from
https://github.com/apache/spark/pull/31728#discussion_r588049629
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]