Skip to content

[spark] Fix merge into update columns detection#7868

Merged
JingsongLi merged 5 commits into
apache:masterfrom
leaves12138:codex/spark-merge-update-columns-master
May 18, 2026
Merged

[spark] Fix merge into update columns detection#7868
JingsongLi merged 5 commits into
apache:masterfrom
leaves12138:codex/spark-merge-update-columns-master

Conversation

@leaves12138
Copy link
Copy Markdown
Contributor

@leaves12138 leaves12138 commented May 15, 2026

What changed

This updates Spark merge-into data evolution update column detection so target self-assignments are not treated as modified columns when Spark adds or changes qualifiers. The logic now treats matching AttributeReference exprIds as the same target column, while still including source-side assignments such as target_col = source_col.

Why

Spark AttributeReference.equals also compares qualifiers, so the same target field can compare unequal as file_name#2 versus t.file_name#2. That made updateColumns include unchanged fields and caused partial updates to rewrite more columns than expected.

Validation

  • mvn -pl paimon-spark/paimon-spark-common -DskipTests -Dcheckstyle.skip -Drat.skip -Dspotless.check.skip=true compile
  • mvn -pl paimon-spark/paimon-spark-common -DskipTests -Dcheckstyle.skip -Drat.skip spotless:check

@leaves12138 leaves12138 marked this pull request as ready for review May 15, 2026 09:53
@leaves12138 leaves12138 force-pushed the codex/spark-merge-update-columns-master branch from d17a057 to 081fe31 Compare May 15, 2026 09:57
@leaves12138 leaves12138 force-pushed the codex/spark-merge-update-columns-master branch from 081fe31 to 2214b94 Compare May 15, 2026 09:59
Copy link
Copy Markdown
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 65b0589 into apache:master May 18, 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