You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/07/02 00:39:09 UTC
[GitHub] [spark] cloud-fan commented on a diff in pull request #41804: [SPARK-43851][SQL] Support LCA in grouping expressions
cloud-fan commented on code in PR #41804:
URL: https://github.com/apache/spark/pull/41804#discussion_r1249041539
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveReferencesInAggregate.scala:
##########
@@ -112,9 +105,11 @@ object ResolveReferencesInAggregate extends SQLConfHelper
assert(selectList.forall(_.resolved))
if (conf.groupByAliases) {
groupExprs.map { g =>
- g.transformWithPruning(_.containsPattern(UNRESOLVED_ATTRIBUTE)) {
- case u: UnresolvedAttribute =>
- selectList.find(ne => conf.resolver(ne.name, u.name)).getOrElse(u)
+ g.transformWithPruning(_.containsAnyPattern(UNRESOLVED_ATTRIBUTE,
+ LATERAL_COLUMN_ALIAS_REFERENCE)) {
+ case u @ (_: UnresolvedAttribute | _: LateralColumnAliasReference) =>
Review Comment:
shall we update the lca resolution rule to not resolve columns in grouping expressions to `LateralColumnAliasReference`? The produced plan is very weird. also cc @anchovYu
--
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-unsubscribe@spark.apache.org
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