Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/21745#discussion_r201945591
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
---
@@ -1167,7 +1169,8 @@ class Analyzer(
case p: Project =>
val maybeResolvedExprs = exprs.map(resolveExpression(_, p))
val (newExprs, newChild) =
resolveExprsAndAddMissingAttrs(maybeResolvedExprs, p.child)
- val missingAttrs = AttributeSet(newExprs) --
AttributeSet(maybeResolvedExprs)
+ // Only add missing attributes coming from `newChild`.
+ val missingAttrs = (AttributeSet(newExprs) --
p.outputSet).intersect(newChild.outputSet)
--- End diff --
Thanks. I think it's better to have a re-producible test case before
changing `Aggregate` case. I'm trying to create a test case for it. Then it can
be more confident to change `Aggregate` case.
Actually I found another place we need to fix. Seems we don't have enough
test coverage for similar features.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]