Skip to content

[python] Support FileStoreCommit overwrite dynamic partition#7749

Open
SteNicholas wants to merge 1 commit intoapache:masterfrom
SteNicholas:PAIMON-7748
Open

[python] Support FileStoreCommit overwrite dynamic partition#7749
SteNicholas wants to merge 1 commit intoapache:masterfrom
SteNicholas:PAIMON-7748

Conversation

@SteNicholas
Copy link
Copy Markdown
Member

@SteNicholas SteNicholas commented Apr 30, 2026

Purpose

Support dynamic partition overwrite in FileStoreCommit.overwrite(), aligned with Java FileStoreCommitImpl.overwritePartition():

  • When dynamic-partition-overwrite=true (default), only partitions present in the committed data are replaced — other partitions remain untouched.
  • When no data is committed, the overwrite is skipped entirely. When dynamic-partition-overwrite=false, existing static overwrite behavior is unchanged.

Key Changes:

  • Add DYNAMIC_PARTITION_OVERWRITE config option and accessor in CoreOptions.
  • Restructure overwrite() with skip_overwrite / partition_filter control flow mirroring Java's skipOverwrite / partitionFilter.
  • Add _create_dynamic_partition_filter() mirroring PartitionPredicate.fromMultiple.
  • Add _create_static_partition_filter() mirroring createPartitionPredicate + fromPredicate.

Close #7748.

Tests

Add test_dynamic_partition_overwrite to ReaderBasicTest, RESTTableReadWriteTest, and RESTAOReadWritePy36Test:

  • Single-partition dynamic overwrite: only touched partition replaced, others untouched.
  • Multi-partition dynamic overwrite: multiple partitions replaced, others untouched.
  • Existing test_overwrite (static mode with dynamic-partition-overwrite=false) passes without regression.

partition_values = tuple(msg.partition)
if partition_values not in seen_partitions:
seen_partitions.add(partition_values)
equalities = [predicate_builder.equal(name, value)
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.

It seems that this does not handle NULL partition values correctly, could you add a case for null partition?

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.

[Feature] Support FileStoreCommit overwrite dynamic partition for pypaimon

2 participants