kszucs opened a new issue, #45817:
URL: https://github.com/apache/arrow/issues/45817
### Describe the bug, including details regarding any error messages,
version, and platform.
Tried to use template condition in the following code snippet:
```cpp
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_binary_like_type<ArrowType>::value) {
return CalculateBinaryLike<::arrow::BinaryArray>(def_levels,
rep_levels,
num_levels, values);
} else {
throw ParquetException("Unsupported Arrow array type " +
values.type()->ToString());
}
};
return ::arrow::VisitType(*values.type(), handle_type);
}
```
but getting compiler error:
```
/Users/kszucs/Workspace/arrow/cpp/src/arrow/type_traits.h:719:70: error: no
member named 'is_utf8' in 'arrow::Time64Type'
719 | std::integral_constant<bool, is_base_binary_type<T>::value &&
T::is_utf8>;
|
~~~^
/Users/kszucs/Workspace/arrow/cpp/src/arrow/type_traits.h:744:36: note: in
instantiation of template type alias 'is_string_like_type' requested here
744 | !is_string_like_type<T>::value) ||
| ^
/Users/kszucs/Workspace/arrow/cpp/src/parquet/chunker_internal.cc:291:30:
note: in instantiation of template type alias 'is_binary_like_type' requested
here
291 | if constexpr (::arrow::is_binary_like_type<ArrowType>::value) {
| ^
/Users/kszucs/Workspace/arrow/cpp/src/arrow/visit_type_inline.h:84:34: note:
in instantiation of function template specialization
'parquet::internal::ContentDefinedChunker::Impl::GetChunks(const int16_t *,
const int16_t *, int64_t, const ::arrow::Array &)::(anonymous
class)::operator()<const arrow::Time64Type &>' requested here
84 | ARROW_GENERATE_FOR_ALL_TYPES(TYPE_VISIT_INLINE);
| ^
/Users/kszucs/Workspace/arrow/cpp/src/parquet/chunker_internal.cc:299:21:
note: in instantiation of function template specialization
'arrow::VisitType<(lambda at
/Users/kszucs/Workspace/arrow/cpp/src/parquet/chunker_internal.cc:285:24) &>'
requested here
299 | return ::arrow::VisitType(*values.type(), handle_type);
```
### Component(s)
C++
--
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]