Github user maropu commented on a diff in the pull request: https://github.com/apache/spark/pull/21745#discussion_r201914482 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala --- @@ -1163,7 +1165,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) + // The resolved attributes might not come from `p.child`. Need to filter it. --- End diff -- At least, this case was [resolved](https://github.com/apache/spark/pull/21745#issuecomment-404380823) in `ResolveMissingReferences` in spark-v2.2.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org