Content-Length: 274565 | pFad | http://github.com/apache/polaris/issues/1771

F4 Reserved Iceberg metadata table names in Polaris (`history`, `entries`, etc.) · Issue #1771 · apache/polaris · GitHub
Skip to content

Reserved Iceberg metadata table names in Polaris (history, entries, etc.) #1771

Open
@fivetran-kostaszoumpatianos

Description

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, 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:
apache/iceberg#10550

Possible Fix
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

Build a table named history

Actual Behavior

Fails with unclear error.

Expected Behavior

Should accept it.

Additional context

Clashes with metadata table names.

System information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/apache/polaris/issues/1771

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy