This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 0bddf5d18f GH-49415: [C++] Don't change map type key/item/value field
names (#49416)
0bddf5d18f is described below
commit 0bddf5d18fa3b89a2e2546b8dfa293c4d9f69bcf
Author: Sutou Kouhei <[email protected]>
AuthorDate: Tue Mar 3 08:58:22 2026 +0900
GH-49415: [C++] Don't change map type key/item/value field names (#49416)
### Rationale for this change
The current implementation forces using `key`/`value`/`entries` as
key/item/value field names and ignores field names in FlatBuffers.
### What changes are included in this PR?
Use field names in FlatBuffers.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.
**This PR includes breaking changes to public APIs.** If an application
depends on `key`/`value`/entries` as map type's field names, an application may
not work when incoming Apache Arrow data doesn't use `key`/`value`/`entries` as
map type's field names.
* GitHub Issue: #49415
Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/arrow/ipc/metadata_internal.cc | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/cpp/src/arrow/ipc/metadata_internal.cc
b/cpp/src/arrow/ipc/metadata_internal.cc
index 65a4fcee7a..68dfaa0798 100644
--- a/cpp/src/arrow/ipc/metadata_internal.cc
+++ b/cpp/src/arrow/ipc/metadata_internal.cc
@@ -390,9 +390,7 @@ 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)->WithName("key"),
-
children[0]->type()->field(1)->WithName("value"),
- map->keysSorted());
+ *out = std::make_shared<MapType>(children[0], map->keysSorted());
}
return Status::OK();
case flatbuf::Type::Type_FixedSizeList: