fivetran-kostaszoumpatianos opened a new issue, #1771: URL: https://github.com/apache/polaris/issues/1771
### Describe the bug We have seen issues with Polaris and tables named after Iceberg metadata table names. For example, when we try to create tables named as: `entries`, `history`, etc. It looks like this is an Iceberg problem and not directly a Polaris one. **Upon Creation** Polaris will call `Catalog::tableExists(...)`, which internally calls `BaseMetastoreCatalog::loadTable(...)`. If that call returns an exception then the table is considered non-existent. The problem, however, is that `loadTable` will try to resolve the table as a metadata table if it's not found and if the table name matches one of the reserved metadata keywords defined [here](https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/MetadataTableType.java), it will try to call `loadMetadataTable` using the namespace as a table name, and this will fail. This issue is also open on the iceberg community: https://github.com/apache/iceberg/issues/10550 ** Fix Request ** I understand that we want to keep `tableExists` implementation-agnostic and use `loadTable` in a `try/catch`, but the problem is that loadTable will try to resolve it as a metadata table if it matches one of these words. Since we do, however, have the `IcebergCatalog` class, we could simply override tableExists with the following: ``` public boolean tableExists(TableIdentifier identifier) { if (isValidIdentifier(identifier)) { return newTableOps(identifier).current() != null; } return false; } ``` This would allow us to bypass the problem, since we only care about actual tables when we call this method and not metadata tables. ### To Reproduce _No response_ ### Actual Behavior _No response_ ### Expected Behavior _No response_ ### Additional context _No response_ ### System information _No response_ -- 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]
