cloud-fan commented on code in PR #50570: URL: https://github.com/apache/spark/pull/50570#discussion_r2041394407
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala: ########## @@ -671,9 +671,11 @@ object RemoveRedundantAliases extends Rule[LogicalPlan] { val subQueryAttributes = if (conf.getConf(SQLConf .EXCLUDE_SUBQUERY_EXP_REFS_FROM_REMOVE_REDUNDANT_ALIASES)) { // Collect the references for all the subquery expressions in the plan. - AttributeSet.fromAttributeSets(plan.expressions.collect { - case e: SubqueryExpression => e.references - }) + AttributeSet.fromAttributeSets(plan.expressions.flatMap(e => { + e.collect { + case e: SubqueryExpression => e.references + } + })) Review Comment: ```suggestion AttributeSet.fromAttributeSets(plan.expressions.flatMap { e => e.collect { case e: SubqueryExpression => e.references } }) ``` -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org