gengliangwang commented on code in PR #39152:
URL: https://github.com/apache/spark/pull/39152#discussion_r1054068399
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -1012,15 +1012,18 @@ class Analyzer(override val catalogManager:
CatalogManager)
})
}
- private def addMetadataCol(plan: LogicalPlan): LogicalPlan = plan match {
- case s: ExposesMetadataColumns => s.withMetadataColumns()
- case p: Project =>
+ private def addMetadataCol(
+ plan: LogicalPlan,
+ isRequired: Attribute => Boolean): LogicalPlan = plan match {
+ case s: ExposesMetadataColumns if s.metadataOutput.exists(isRequired) =>
+ s.withMetadataColumns()
Review Comment:
Since we are doing this, shall we propagate the required metadata columns
only?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]