Skip to content

[python] Add PyPaimon maintenance operations#7727

Open
HansiChan wants to merge 2 commits intoapache:masterfrom
HansiChan:codex/pypaimon-maintenance-actions
Open

[python] Add PyPaimon maintenance operations#7727
HansiChan wants to merge 2 commits intoapache:masterfrom
HansiChan:codex/pypaimon-maintenance-actions

Conversation

@HansiChan
Copy link
Copy Markdown
Contributor

Purpose

This PR adds native PyPaimon APIs and CLI commands for table maintenance and snapshot inspection.

Changes

  • Add SnapshotManager.list_snapshots() and extend table snapshot CLI with --id, --earliest, --time-millis, and --all.
  • Add table.new_maintenance() with compact(partition=None) and rescale_bucket(bucket_num, partition=None).
  • Add CLI commands for table compact and table rescale.
  • Document the new snapshot and maintenance APIs.

Native Python maintenance currently rejects row tracking, data evolution, and deletion-vector tables because those modes require extra metadata handling beyond a plain data rewrite.

Tests

  • PYTHONPATH=. python -m pytest pypaimon/tests/table/maintenance_test.py
  • PYTHONPATH=. python -m pytest pypaimon/tests/cli_table_test.py -k snapshot
  • python -m flake8 --config=paimon-python/dev/cfg.ini paimon-python/pypaimon/cli/cli_table.py paimon-python/pypaimon/common/json_util.py paimon-python/pypaimon/snapshot/snapshot_manager.py paimon-python/pypaimon/table/file_store_table.py paimon-python/pypaimon/table/maintenance.py paimon-python/pypaimon/write/file_store_commit.py paimon-python/pypaimon/write/table_commit.py paimon-python/pypaimon/tests/cli_table_test.py paimon-python/pypaimon/tests/table/maintenance_test.py

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.

1 participant