plusplusjiajia opened a new pull request, #10855:
URL: https://github.com/apache/paimon/pull/10855
### Purpose
`FileSystemBranchManager.drop_branch` only checked that the branch existed.
The main branch always exists because its path is the table root, so
`drop_branch('main')` deleted the whole table, through both the filesystem and
the JDBC catalog.
As in Java `FileSystemBranchManager.dropBranch` (#10825), dropping the main
branch now raises `The main branch cannot be deleted.` (`ValueError` in Python,
`IllegalArgumentException` in Java) before touching the file system.
### Tests
-
`FileSystemBranchManagerTest#test_main_branch_validation_before_file_access`:
`drop_branch('main')` raises Java's message without any file system call,
alongside the existing main branch checks of `create_branch` and `fast_forward`.
- `FileSystemCatalogBranchCRUDTest#test_drop_main_branch_preserves_table`
and `JdbcCatalogTest#test_drop_main_branch_preserves_table`: dropping main
raises, and the table directory and its data remain.
- The three tests fail on master. The branch manager, filesystem catalog
branch and JDBC catalog tests pass locally: 47 tests. flake8 is clean.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]