cloud-fan commented on code in PR #50921:
URL: https://github.com/apache/spark/pull/50921#discussion_r2184470442
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala:
##########
@@ -58,7 +60,15 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan] with
PredicateHelper {
private def createScanBuilder(plan: LogicalPlan) = plan.transform {
case r: DataSourceV2Relation =>
- ScanBuilderHolder(r.output, r,
r.table.asReadable.newScanBuilder(r.options))
+ val sHolder = ScanBuilderHolder(r.output, r,
r.table.asReadable.newScanBuilder(r.options))
+ sHolder.output.foreach { e =>
+ // Join column names can change when joins are pushed down. We need to
keep track of the
+ // up-to-date column name in case connector do some duplicate
resolving by aliasing the
+ // columns. ScanBuilderHolder.output will be left unchanged.
+ sHolder.pushedJoinOutputMap = sHolder.pushedJoinOutputMap + (e, e)
Review Comment:
this looks very inefficient, how about `sHolder.pushedJoinOutputMap =
sHolder.output.zip(sHolder.output).toMap`
--
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]