WillAyd commented on code in PR #45272:
URL: https://github.com/apache/arrow/pull/45272#discussion_r1916999948
##########
cpp/src/arrow/compute/kernels/codegen_internal.h:
##########
@@ -322,6 +329,32 @@ 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;
+
+ const ArraySpan& arr;
+ const char* data;
+ const int32_t width;
+ int64_t position;
+
+ explicit ArrayIterator(const ArraySpan& arr)
+ : arr(arr),
+ data(reinterpret_cast<const char*>(arr.buffers[1].data)),
+ width(arr.type->byte_width()),
+ position(arr.offset) {}
+
+ T operator()() {
+ // TODO: how cann we avoid the ToArray call
Review Comment:
I think this is the remaining piece that needs to be fixed. I noticed the
test failures appear when taking slices of the Arrays, and I think that ends up
flattening potentially chunked arrays into a single array given this `ToArray`
call.
Is there some other facility already in the code base to help get a
ListScalar from an ArraySpan that I may be overlooking? If not, should that be
implemented here directly, or somewhere within the ArraySpan class?
AFAICT the ArraySpan class only returns pointers to physical, primitive
types at the moment
--
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]