Skip to content

[Icerberg REST] Namespace separator mismatch #182

Open

Description

@szlta

Describe the bug

The current Iceberg dependency version is 1.5.2, which uses %1F as namespace separator character in its client implementation.

Unity however uses . character which causes client calls such as listTables() or loadTable() to fail if a Namespace is defined with more levels.

To Reproduce

Steps to reproduce the behavior:

  1. Create a uniform table such as unity_test.default.mytable
  2. Use the Iceberg client and call listTables(... , Namespace.of("unity_test", "default"));
  3. This yields to 400 Bad request

Expected behavior

Retrieve a TableIdentifer for mytable.

Activity

  1. added
    bug
    on Jul 9, 2024
  2. dennyglee commented on Jul 12, 2024

    @dennyglee
    Contributor

    Thanks @szlta - we will review this shortly!

  3. alexreid-db commented on Aug 2, 2024

    @alexreid-db
    Collaborator

    Hi I will be looking at making some changes to address this

  4. moomindani commented on Sep 5, 2026

    @moomindani
    Contributor

    Still reproducible on main at 58d5c7b (Iceberg is 1.11.0 now, and RESTUtil still joins levels with %1F). The mechanism is a little different from what the description says, though, so I wanted to record what I measured -- the separator is not chosen by IcebergRestCatalogService.

    Every client request goes through URLTranscoderVerticle, which listens on the port clients use and forwards to Armeria on port + 1. It rewrites the path with path.replace("%1F", "."), and query parameters by replacing the unit separator U+001F with ., before forwarding. So by the time any Iceberg endpoint sees the namespace, default%1Fnested and the literal default.nested are the same string:

    # through the transcoder (port 8080)
    GET /api/2.1/unity-catalog/iceberg/v1/catalogs/unity/namespaces/default%1Fnested
    400 {"error":{"message":"Invalid schema full name: unity.default.nested","type":"BaseException","code":400}}
    
    GET /api/2.1/unity-catalog/iceberg/v1/catalogs/unity/namespaces/default.nested
    400 {"error":{"message":"Invalid schema full name: unity.default.nested","type":"BaseException","code":400}}
    
    GET /api/2.1/unity-catalog/iceberg/v1/catalogs/unity/namespaces/default%1Fnested/tables
    404 {"error":{"message":"Schema not found: unity.default.nested","type":"NoSuchNamespaceException","code":404}}
    

    The rewrite is not gratuitous: Armeria rejects a control character in a path outright, which is what the transcoder exists to work around. Asking it directly shows that:

    # straight to Armeria (port 8081), no transcoder
    GET /api/2.1/unity-catalog/iceberg/v1/catalogs/unity/namespaces/default%1Fnested
    400 Status: 400
        Description: Invalid request path
    

    So the request never carries a level separator Unity Catalog could act on: it arrives as a single dotted name, which then fails either name validation (loadNamespace, 400) or the schema lookup (listTables, 404) depending on the endpoint. A fix therefore cannot just swap the separator in the service -- it has to get the levels past Armeria's path restriction first, for instance by having the transcoder encode them into something the service can split on, or by having the endpoints take the namespace from somewhere other than the path segment.

    Two side notes: the two endpoints disagreeing on the status for the same namespace is a symptom of the same thing, and the "type": "BaseException" in the first response is a separate issue (#1796, PR #1797) -- fixing that will make this one report BadRequestException, but it stays a 400.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions