Copilot commented on code in PR #474:
URL: https://github.com/apache/arrow-dotnet/pull/474#discussion_r4309311180


##########
src/Apache.Arrow/C/CArrowSchemaExporter.cs:
##########
@@ -59,17 +67,25 @@ public static unsafe void ExportType(IArrowType datatype, 
CArrowSchema* schema)
                 throw new ArgumentNullException(nameof(schema));
             }
 
+            // A dictionary-encoded field's extension metadata describes its 
value type. IPC
+            // keeps it on the field, but the C Data Interface puts it on the 
dictionary child.
+            IReadOnlyDictionary<string, string> dictionaryMetadata = null;
+            if (datatype is DictionaryType)
+            {
+                metadata = SplitExtensionMetadata(metadata, out 
dictionaryMetadata);

Review Comment:
   This also moves metadata for an unresolved extension whose storage is a 
dictionary. For example, importing an extension over `dictionary<int32, 
string>` without its registry definition leaves a plain `DictionaryType` with 
the extension keys on the field. Re-exporting now puts those keys on the 
string-valued dictionary child, changing the extension's storage type and 
potentially causing the consumer to reject it. Preserve whether unresolved 
metadata describes the dictionary itself or its values, while retaining the IPC 
metadata relocation, and add a no-registry import/re-export regression test.



-- 
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]

Reply via email to