ulysses-you commented on code in PR #39870:
URL: https://github.com/apache/spark/pull/39870#discussion_r1098714237
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Relation.scala:
##########
@@ -54,15 +54,7 @@ case class DataSourceV2Relation(
override lazy val metadataOutput: Seq[AttributeReference] = table match {
case hasMeta: SupportsMetadataColumns =>
- val resolve = conf.resolver
- val outputNames = outputSet.map(_.name)
- def isOutputColumn(col: MetadataColumn): Boolean = {
- outputNames.exists(name => resolve(col.name, name))
- }
- // filter out metadata columns that have names conflicting with output
columns. if the table
- // has a column "line" and the table can produce a metadata column
called "line", then the
- // data column should be returned, not the metadata column.
- hasMeta.metadataColumns.filterNot(isOutputColumn).toAttributes
+ metadataOutputWithOutConflicts(hasMeta.metadataColumns.toAttributes)
Review Comment:
One small difference is we call `toAttributes` before filter out conflicts.
Seems fine.
--
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]