cloud-fan commented on code in PR #40321:
URL: https://github.com/apache/spark/pull/40321#discussion_r1131869082


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -1033,9 +1033,12 @@ class Analyzer(override val catalogManager: 
CatalogManager) extends RuleExecutor
         requiredAttrIds.contains(a.exprId)) =>
         s.withMetadataColumns()
       case p: Project if p.metadataOutput.exists(a => 
requiredAttrIds.contains(a.exprId)) =>
+        // Inject the requested metadata columns into the project's output, if 
not already present.

Review Comment:
   do we hit a real issue with this? If the metadata col is already in the 
output, this code path should not be triggered as we have `val metaCols = 
getMetadataAttributes(node).filterNot(inputAttrs.contains)`
   
   What we can improve is to only include metadata columns that are included in 
`requiredAttrIds`.



-- 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to