Akash3121 commented on code in PR #10896:
URL: https://github.com/apache/paimon/pull/10896#discussion_r4429804512


##########
paimon-python/pypaimon/catalog/jdbc_catalog.py:
##########
@@ -404,20 +404,38 @@ def list_tables(self, database_name: str) -> List[str]:
     def get_table(self, identifier: Union[str, Identifier]) -> Table:
         if not isinstance(identifier, Identifier):
             identifier = Identifier.from_string(identifier)
+        branch = encoded_branch_name(identifier)
+        if branch is not None and branch != DEFAULT_MAIN_BRANCH:
+            raise NotImplementedError("JdbcCatalog currently does not support 
table branches")
         if self.catalog_options.contains(CoreOptions.SCAN_FALLBACK_BRANCH):
             raise ValueError(f"Unsupported CoreOption 
{CoreOptions.SCAN_FALLBACK_BRANCH}")
         if not self._table_exists(identifier):
             raise TableNotExistException(identifier)
         table_path = self.get_table_path(identifier)
         table_schema = self.get_table_schema(identifier)
+        table_identifier = identifier

Review Comment:
   [P2] Canonicalize accepted default-main identifiers
    
   For `Identifier("db", "t", branch="MAIN")`, `encoded_branch_name()` returns 
`None`, so the new guard accepts it, but this assignment preserves the 
identifier’s cached `"MAIN"`  branch. `FileStoreTable.current_branch()` then 
returns `"MAIN"`, causing snapshot and read paths to target a nonexistent 
uppercase branch rather than main. I reproduced this after writing one row to 
main: the returned table had `current_branch == "MAIN"` and read `[]`. Please 
normalize the base identifier for every accepted default-main input - not only 
system tables - and extend this test to perform an actual read.
   



-- 
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]

Reply via email to