kevinjqliu opened a new issue, #3801:
URL: https://github.com/apache/iceberg-rust/issues/3801
### Apache Iceberg Rust version
`main` (`0.10.1`)
### Describe the bug
`iceberg-catalog-rest` ignores the `namespace-separator` property advertised
by `GET /v1/config` (per the Iceberg REST Catalog OpenAPI spec) and always
joins multi-part namespaces with `\u{001f}` (`%1F`).
REST servers running Jetty 12 / strict RFC 3986 URI validation reject
control characters such as `%1F` in URL paths by default (`400 Bad Request` /
`Suspicious Path Character`). For example, `apache/iceberg-rest-fixture:latest`
(Jetty `12.1.15`,
`sha256:634e0a389240a6351ef4542deddabe9cb078f3bb786921c4b7c42cc75ed04302`)
returns `overrides: {"namespace-separator": "%2E"}` from `GET /v1/config`,
causing multi-part namespace requests to fail.
**Root cause:**
- `RestCatalogConfig::merge_with_config`
(`crates/catalog/rest/src/catalog.rs:400-414`) merges server `defaults` and
`overrides` into `self.props`, so `namespace-separator` is stored but never
read.
- `NamespaceIdent::to_url_string()`
(`crates/iceberg/src/catalog/mod.rs:224-226`) hardcodes
`self.as_ref().join("\u{001f}")`.
- `crates/catalog/rest/src/catalog.rs` uses `to_url_string()` directly in:
- `namespace_endpoint` (line 296)
- `tables_endpoint` (line 300)
- `register_table_endpoint` (line 308)
- `table_endpoint` (line 314)
- `list_namespaces` `parent` query parameter (line 1058)
- `dev/docker-compose.yaml` is currently pinned to
`apache/iceberg-rest-fixture:1.10.1` (Jetty 11), which masked this in CI.
### To Reproduce
1. Run `apache/iceberg-rest-fixture:latest` (Jetty 12, advertising
`overrides: {"namespace-separator": "%2E"}` in `GET /v1/config`) as the `rest`
service on port `8181`.
2. Run:
```bash
cargo test -p iceberg-catalog-loader --test rest_pagination_test
--all-features
```
3. `test_rest_lists_all_namespaces_and_tables_with_page_size`
(`crates/catalog/loader/tests/rest_pagination_test.rs`) fails with `400 Bad
Request` (`400: Suspicious Path Character` in Jetty logs) on `DELETE
/v1/namespaces/rest_pagination_test_pagination%1Fchild1`.
### Expected behavior
- `iceberg-catalog-rest` reads `namespace-separator` from the merged catalog
properties (`defaults < client < overrides`), defaulting to `"%1F"` when unset.
- URL path segments (`namespace_endpoint`, `tables_endpoint`,
`register_table_endpoint`, `table_endpoint`) encode individual namespace levels
and join them using the configured URL-encoded `namespace-separator` as-is
(without double-encoding `%`).
- The `parent` query parameter in `list_namespaces` uses the percent-decoded
separator before query serialization so `reqwest` encodes it once (avoiding
double-encoding e.g. `"%2E"` into `"%252E"`).
- `NamespaceIdent::to_url_string()` in `crates/iceberg` remains unchanged
for backwards compatibility (it is public API and also used by
`iceberg-catalog-s3tables`).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]