Skip to content

[C++] Map type ignores key/item/value field names #49415

Closed

Description

@kou

Describe the bug, including details regarding any error messages, version, and platform.

I'm preparing an integration test for pure Ruby Apache Arrow reader/writer and found this.

In our integration test, we have an integration test that uses some_key/some_item/some_entries as key/item/value field names:

MapField('map_other_names',
get_field('some_key', 'utf8', nullable=False),
get_field('some_value', 'int32'),
entries_name='some_entries'),

The C++ implementation rewrites key/item/value field names as key/value/entries:

*out = std::make_shared<MapType>(children[0]->type()->field(0)->WithName("key"),
children[0]->type()->field(1)->WithName("value"),

arrow/cpp/src/arrow/type.cc

Lines 1042 to 1043 in 007903c

::arrow::field("entries",
struct_({std::move(key_field), std::move(item_field)}), false),

So the expected value represented in JSON uses some_key/some_item/some_entries but the generated Apache Arrow data by the C++ implementation uses key/item/entries.

FYI: The above WithName() code was added by #35297.

Component(s)

C++

Activity

  1. added 2 commits that reference this issue on Mar 1, 2026
  2. added a commit that references this issue on Mar 2, 2026
  3. added this to the 24.0.0 milestone on Mar 2, 2026
  4. kou commented on Mar 2, 2026

    @kou
    MemberAuthor

    Issue resolved by pull request 49416
    #49416

  5. added a commit that references this issue on Mar 5, 2026
  6. added a commit that references this issue on Mar 5, 2026
  7. added a commit that references this issue on Mar 10, 2026
  8. added 3 commits that reference this issue on Apr 6, 2026
  9. added 3 commits that reference this issue on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions