Skip to content

Commit 38a935d

Browse files
committed
Fix bug.
1 parent b99d0c7 commit 38a935d

File tree

1 file changed

+2
-2
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis

1 file changed

+2
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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) =>

0 commit comments

Comments
 (0)