File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1165,8 +1165,8 @@ class Analyzer(
11651165 case p : Project =>
11661166 val maybeResolvedExprs = exprs.map(resolveExpression(_, p))
11671167 val (newExprs, newChild) = resolveExprsAndAddMissingAttrs(maybeResolvedExprs, p.child)
1168- // The resolved attributes might not come from `p.child`. Need to filter it .
1169- val missingAttrs = (AttributeSet (newExprs).intersect(p.child.outputSet)) -- p.outputSet
1168+ // Only add missing attributes coming from `newChild` .
1169+ val missingAttrs = (AttributeSet (newExprs) -- p.outputSet).intersect(newChild.outputSet)
11701170 (newExprs, Project (p.projectList ++ missingAttrs, newChild))
11711171
11721172 case a @ Aggregate (groupExprs, aggExprs, child) =>
You can’t perform that action at this time.
0 commit comments