plusplusjiajia opened a new pull request, #10896:
URL: https://github.com/apache/paimon/pull/10896
### Purpose
`JdbcCatalog.get_table` ignored the `$` suffix of the identifier. For
example, `db.t$snapshots`, `db.t$options` and `db.t$nosuch` all returned the
data table, and `db.t$branch_dev` returned a table with main's schema even when
that branch did not exist.
As in Java `AbstractCatalog.getTable`, system tables are now loaded through
the shared system table loader, as in the filesystem catalog, and unknown
system table names raise `TableNotExistException`. As in Java
`JdbcCatalog.loadTableSchema` (`assertMainBranch`), a branch other than main
raises `NotImplementedError`, Python's counterpart of
`UnsupportedOperationException`. As in `alter_table`, only a branch in the name
counts, so `Identifier('db', 't', branch='MAIN')` still reads `db.t`.
### Tests
- `JdbcCatalogTest#test_get_system_table`: `$options`, `$OPTIONS` and
`$branch_main$options` load the options system table of the data table, by name
and by `Identifier`.
- `JdbcCatalogTest#test_get_system_table_not_exist`: unknown system tables
and system tables of missing tables raise `TableNotExistException`.
- `JdbcCatalogTest#test_get_table_branch`: main branch identifiers read the
table, and other branches, also with a system table suffix, raise
`NotImplementedError`.
- `catalog_table_guard_test.py`: the shared guard test no longer expects
JDBC to read `$branch_dev`.
- The 3 new tests fail on master. The related tests pass locally: 14 tests
in `jdbc_catalog_test.py` and `catalog_table_guard_test.py`. 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]