raulcd commented on code in PR #53994:
URL: https://github.com/apache/arrow/pull/53994#discussion_r4312104252


##########
cpp/src/arrow/ipc/metadata_internal.cc:
##########
@@ -900,35 +953,21 @@ Status FieldFromFlatbuffer(const flatbuf::Field* field, 
FieldPosition field_pos,
     auto int_data = encoding->indexType();
     CHECK_FLATBUFFERS_NOT_NULL(int_data, "DictionaryEncoding.indexType");
     RETURN_NOT_OK(IntFromFlatbuffer(int_data, &index_type));
+    // The dictionary value type may be an extension type, whose metadata is
+    // found in DictionaryEncoding.custom_metadata (GH-49704)
+    if (encoding->custom_metadata() != nullptr) {
+      ARROW_ASSIGN_OR_RAISE(auto value_metadata,
+                            
internal::GetKeyValueMetadata(encoding->custom_metadata()));
+      RETURN_NOT_OK(MaybeDeserializeExtensionType(value_metadata.get(), 
&type));

Review Comment:
   I am wondering whether there would be a way of retaining this value_metadata 
even if this is a not known extension type. So the reader could retain it and a 
new writer would write it. I am thinking on the use case of data passing 
through:
   `app knows extension type` -> `app does not know extension type` -> `app 
knows extension type`
   
   Maybe not entirely related and just an implementation detail that can be 
done as a follow up.



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