c-thiel opened a new pull request, #3803: URL: https://github.com/apache/iceberg-rust/pull/3803
## Which issue does this PR close? - Closes #. ## What changes are included in this PR? Spark writes `"default-namespace": []` for a view created while no namespace is current ([capture in #331](https://github.com/apache/iceberg-rust/pull/331#issuecomment-2205383749)). As [@nastra noted there](https://github.com/apache/iceberg-rust/pull/331#issuecomment-2205517652), `[]` is an empty namespace, not a null one, and a valid value: Java has [`Namespace.empty()`](https://github.com/apache/iceberg/blob/23a383e8e517272120bd1feb7f192621e9533b05/api/src/main/java/org/apache/iceberg/catalog/Namespace.java#L34-L36), and its [view metadata test fixture](https://github.com/apache/iceberg/blob/23a383e8e517272120bd1feb7f192621e9533b05/core/src/test/resources/org/apache/iceberg/view/ValidViewMetadata.json#L42) uses `[]`. iceberg-rust already reads and writes such view versions through serde, but code can't build the value: `NamespaceIdent::from_vec` refuses an empty vector. This PR adds `NamespaceIdent::empty()`. `from_vec` stays strict, because identifier parsing such as `TableIdent::from_strs` relies on that error, which keeps it stricter than Java's `Namespace.of()`. ## Are these changes tested? Yes, unit tests: - The view version from #331 deserializes to one built with `NamespaceIdent::empty()` and serializes back to the same JSON. - `empty()` equals deserialized `[]` and serializes to `[]`; `from_vec(vec![])` still fails with `DataInvalid`. ## AI Disclosure Supported by Claude Code. Reviewed and checked by me. -- 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]
