CurtHagenlocher opened a new pull request, #474: URL: https://github.com/apache/arrow-dotnet/pull/474
## What's Changed For a dictionary-encoded extension type such as `dictionary<int32, arrow.uuid>`, Arrow C++ puts the value type's `ARROW:extension:name` on the `dictionary` child `ArrowSchema`. `CArrowSchemaExporter` put it on the field instead, which is where IPC keeps it. As a result, pyarrow rejected such fields (`Invalid storage type for UuidType: dictionary<...>`), and the importer didn't resolve them in either direction (#473). In memory, .NET follows IPC: a `DictionaryType` whose value type is the extension type, with the extension name in the field metadata. The C Data exporter and importer now translate between that and the C Data placement. ### Export - For a dictionary field, the extension keys are written on the `dictionary` child, and any other field metadata stays on the field. This also applies when the keys come only from the field metadata, as with a field read from IPC without a registry. - `ExportType` now writes extension metadata when given an `ExtensionType`, as Arrow C++ does. The dictionary child is exported through it. **Behavior change:** `ExportType(GuidType.Default, ptr)` previously produced a bare `w:16` with no extension name. - An extension type whose storage is a dictionary keeps its metadata on the field, which is also how Arrow C++ encodes that case. ### Import - The `dictionary` child's extension metadata resolves the value type against the registry, and is copied into the field metadata so the result matches the IPC reader. - For schemas exported by earlier versions of this library, an extension name on a dictionary field is tried against the whole dictionary type first and then against the value type. ### Tests - .NET: where export puts the metadata (including moving field-level keys), schema round trips with and without a registry, the legacy field-level placement, and a `DictionaryArray` of `GuidArray` round trip. - pyarrow: .NET → pyarrow gives `dictionary<values=extension<arrow.uuid>, indices=int32>` with equal values, and pyarrow → .NET gives a `DictionaryArray` whose `Dictionary` is a `GuidArray`. Closes #473. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5.5 <[email protected]> -- 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]
