wgtmac opened a new issue, #49217:
URL: https://github.com/apache/arrow/issues/49217

   ### 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.
   
   ```cpp
   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


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