lidavidm commented on code in PR #35298:
URL: https://github.com/apache/arrow/pull/35298#discussion_r1177207659


##########
cpp/src/arrow/ipc/metadata_internal.cc:
##########
@@ -367,8 +367,8 @@ Status ConcreteTypeFromFlatbuffer(flatbuf::Type type, const 
void* type_data,
         return Status::Invalid("Map's keys must be non-nullable");
       } else {
         auto map = static_cast<const flatbuf::Map*>(type_data);
-        *out = std::make_shared<MapType>(children[0]->type()->field(0)->type(),
-                                         children[0]->type()->field(1)->type(),
+        *out = 
std::make_shared<MapType>(children[0]->type()->field(0)->WithName("key"),

Review Comment:
   I think that's OK, since that's effectively what it was doing before when we 
just took the type. And now we preserve metadata.



##########
cpp/src/arrow/ipc/metadata_internal.cc:
##########
@@ -367,8 +367,8 @@ Status ConcreteTypeFromFlatbuffer(flatbuf::Type type, const 
void* type_data,
         return Status::Invalid("Map's keys must be non-nullable");
       } else {
         auto map = static_cast<const flatbuf::Map*>(type_data);
-        *out = std::make_shared<MapType>(children[0]->type()->field(0)->type(),
-                                         children[0]->type()->field(1)->type(),
+        *out = 
std::make_shared<MapType>(children[0]->type()->field(0)->WithName("key"),

Review Comment:
   However we should also probably force the nullability of key to `false` here 
to further match existing behavior.



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