mapleFU commented on code in PR #45272:
URL: https://github.com/apache/arrow/pull/45272#discussion_r1944402094
##########
cpp/src/arrow/compute/kernels/codegen_internal.h:
##########
@@ -390,6 +417,12 @@ struct UnboxScalar<Type, enable_if_has_string_view<Type>> {
}
};
+template <typename Type>
+struct UnboxScalar<Type, enable_if_list_type<Type>> {
Review Comment:
So fixed_size_list is also declared as scalar, but not being registered in
compute? ( It's ok to me, just to make sure this)
##########
cpp/src/arrow/compute/kernels/codegen_internal.h:
##########
@@ -322,6 +329,26 @@ struct ArrayIterator<Type, enable_if_base_binary<Type>> {
}
};
+template <typename Type>
+struct ArrayIterator<Type, enable_if_list_type<Type>> {
+ using T = typename TypeTraits<Type>::ScalarType;
+ using ArrayT = typename TypeTraits<Type>::ArrayType;
+ using offset_type = typename Type::offset_type;
+
+ const ArraySpan& arr;
+ int64_t position;
+
+ explicit ArrayIterator(const ArraySpan& arr) : arr(arr), position(0) {}
+
+ T operator()() {
+ const auto array_ptr = arr.ToArray();
Review Comment:
How about:
1. Get offset, length
2. Subslice the value array
3. Build `ListScalar` / `LargeListScalar` from the child array?
Or materialize the child array, and using the sub array. `arr.ToArray()`
every call is too expansive?
--
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]