This is an automated email from the ASF dual-hosted git repository.
ptoth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new e77c38a8d439 [SPARK-55113][SQL] `EnsureRequirements` should copy tags
e77c38a8d439 is described below
commit e77c38a8d439ea88d62b19f4ac31ac4ec3b07c98
Author: Peter Toth <[email protected]>
AuthorDate: Thu Jan 22 09:03:23 2026 +0100
[SPARK-55113][SQL] `EnsureRequirements` should copy tags
### What changes were proposed in this pull request?
This is a minor fix of `EnsureRequirements` to make sure copied scan nodes
inherit the tags from original ones in SPJ functions.
### Why are the changes needed?
Fix possible bugs.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing tests.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #53884 from peter-toth/SPARK-55113-ensurerequirements-copy-tags.
Authored-by: Peter Toth <[email protected]>
Signed-off-by: Peter Toth <[email protected]>
---
.../apache/spark/sql/execution/exchange/EnsureRequirements.scala | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git
a/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
b/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
index 23f8c51045f0..e239174e40ad 100644
---
a/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
+++
b/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
@@ -679,7 +679,7 @@ case class EnsureRequirements(
applyPartialClustering: Boolean,
replicatePartitions: Boolean): SparkPlan = plan match {
case scan: BatchScanExec =>
- scan.copy(
+ val newScan = scan.copy(
spjParams = scan.spjParams.copy(
commonPartitionValues = Some(values),
joinKeyPositions = joinKeyPositions,
@@ -688,6 +688,8 @@ case class EnsureRequirements(
replicatePartitions = replicatePartitions
)
)
+ newScan.copyTagsFrom(scan)
+ newScan
case node =>
node.mapChildren(child => populateCommonPartitionInfo(
child, values, joinKeyPositions, reducers, applyPartialClustering,
replicatePartitions))
@@ -698,11 +700,13 @@ case class EnsureRequirements(
plan: SparkPlan,
joinKeyPositions: Option[Seq[Int]]): SparkPlan = plan match {
case scan: BatchScanExec =>
- scan.copy(
+ val newScan = scan.copy(
spjParams = scan.spjParams.copy(
joinKeyPositions = joinKeyPositions
)
)
+ newScan.copyTagsFrom(scan)
+ newScan
case node =>
node.mapChildren(child => populateJoinKeyPositions(
child, joinKeyPositions))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]