bkietz commented on issue #45817:
URL: https://github.com/apache/arrow/issues/45817#issuecomment-2749278098

   The trait is definitely annoying, and I'll think about how best to rewrite 
it. For now, the code example can be rewritten like:
   
   ```c++
     std::vector<Chunk> GetChunks(const int16_t* def_levels, const int16_t* 
rep_levels,
                                  int64_t num_levels, const ::arrow::Array& 
values) {
       auto handle_type = [&](auto&& type) -> std::vector<Chunk> {
         using ArrowType = std::decay_t<decltype(type)>;
   
         if constexpr (::arrow::is_base_binary_type<ArrowType>::value || 
::arrow::is_fixed_size_binary_type<ArrowType>::value) {
           if constexpr (!::arrow::is_string_like_type<ArrowType>::value) {
             return CalculateBinaryLike<::arrow::BinaryArray>(def_levels, 
rep_levels,
                                                              num_levels, 
values);
           }
         }
         throw ParquetException("Unsupported Arrow array type " +
                                values.type()->ToString());
       };
       return ::arrow::VisitType(*values.type(), handle_type);
     }
   ```


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to