Skip to content

[spark]to DE insert into path,the target table should also be target splits - #9333

Merged
JingsongLi merged 2 commits into
apache:masterfrom
weijietong:de_fea_1
Aug 21, 2026
Merged

[spark]to DE insert into path,the target table should also be target splits#9333
JingsongLi merged 2 commits into
apache:masterfrom
weijietong:de_fea_1

Conversation

@weijietong

Copy link
Copy Markdown
Contributor

Purpose

to DE table, the insert path's left anti join could be more efficence by making the target table be target spltis

Tests

minor change, no tests,the existing one cove

@weijietong weijietong changed the title to DE insert into path,the target table should also be target splits [spark]to DE insert into path,the target table should also be target splits Aug 21, 2026

val targetReadPlan =
touchedFileTargetRelation.copy(targetRelation.table, allReadFieldsOnTarget.toSeq)
touchedFileTargetRelation.copy(output = allReadFieldsOnTarget.toSeq)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you apply the same change to paimon-spark/paimon-spark-4.0/src/main/scala/org/apache/paimon/spark/commands/MergeIntoPaimonDataEvolutionTable.scala? Spark 4.0 compiles its own copy of this class, and its insertActionInvoke still calls touchedFileTargetRelation.copy(targetRelation.table, ...). That replaces the KnownSplitsTable with the original target table, so WHEN NOT MATCHED continues to scan the full target table on Spark 4.0. A regression assertion on the insert-side scan or file count would also prevent the two implementations from drifting again.

@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit a17cee8 into apache:master Aug 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants