Skip to content

fix(datafusion): guard CoW MERGE partition pruning#475

Open
JaydenHD wants to merge 1 commit into
apache:mainfrom
JaydenHD:fix-cow-merge-pruning
Open

fix(datafusion): guard CoW MERGE partition pruning#475
JaydenHD wants to merge 1 commit into
apache:mainfrom
JaydenHD:fix-cow-merge-pruning

Conversation

@JaydenHD

@JaydenHD JaydenHD commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make CoW MERGE source-based partition pruning conservative
  • only use source partition values when the MERGE ON condition directly equates every target partition column with the same source column
  • add regression coverage for the case where source and target have the same partition column name but the ON clause does not join on that partition column

Closes #474.

Tests

  • cargo fmt --check
  • cargo check -p paimon-datafusion --lib
  • cargo test -p paimon-datafusion --lib merge_into::tests::test_source_partition_pruning -- --nocapture

Note: cargo test -p paimon-datafusion --test append_merge_into test_partitioned_update_and_insert -- --nocapture currently panics in this Windows environment inside OpenDAL fs listing (StripPrefixError(())), and the same happens for the new append_merge_into regression test. The new pure unit tests cover the pruning guard locally; the integration regression is included for CI/Linux coverage.

@JaydenHD JaydenHD force-pushed the fix-cow-merge-pruning branch from 6325422 to 70b0398 Compare July 7, 2026 15:04
@JaydenHD JaydenHD force-pushed the fix-cow-merge-pruning branch from 70b0398 to b6ae9ed Compare July 7, 2026 16:30
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.

CoW MERGE can misclassify rows after unsafe source-based partition pruning

1 participant