Skip to content

[C++][Parquet] Key-value metadata is not preserved in the sub-fields of map type #49217

Closed

Description

@wgtmac

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

The code below does not deal with map type, which ends up with missing key-value metadata of key and value fields.

std::function<std::shared_ptr<::arrow::DataType>(FieldVector)> GetNestedFactory(
    const ArrowType& origin_type, const ArrowType& inferred_type) {
  switch (inferred_type.id()) {
    case ::arrow::Type::STRUCT:
      if (origin_type.id() == ::arrow::Type::STRUCT) {
        return [](FieldVector fields) { return ::arrow::struct_(std::move(fields)); };
      }
      break;
    case ::arrow::Type::LIST:
    case ::arrow::Type::LARGE_LIST:
      if (origin_type.id() == ::arrow::Type::LIST) {
        return [](FieldVector fields) {
          DCHECK_EQ(fields.size(), 1);
          return ::arrow::list(std::move(fields[0]));
        };
      }
      if (origin_type.id() == ::arrow::Type::LARGE_LIST) {
        return [](FieldVector fields) {
          DCHECK_EQ(fields.size(), 1);
          return ::arrow::large_list(std::move(fields[0]));
        };
      }
      if (origin_type.id() == ::arrow::Type::FIXED_SIZE_LIST) {
        const auto list_size =
            checked_cast<const ::arrow::FixedSizeListType&>(origin_type).list_size();
        return [list_size](FieldVector fields) {
          DCHECK_EQ(fields.size(), 1);
          return ::arrow::fixed_size_list(std::move(fields[0]), list_size);
        };
      }
      break;
    default:
      break;
  }
  return {};
}

Component(s)

C++, Parquet

Activity

  1. added a commit that references this issue on Feb 10, 2026
  2. added a commit that references this issue on Feb 11, 2026
  3. added this to the 24.0.0 milestone on Feb 11, 2026
  4. wgtmac commented on Feb 11, 2026

    @wgtmac
    MemberAuthor

    Issue resolved by pull request 49218
    #49218

  5. added a commit that references 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