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
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.
Component(s)
C++, Parquet