ZhangHuiGui commented on code in PR #41092:
URL: https://github.com/apache/arrow/pull/41092#discussion_r1559569385
##########
cpp/src/arrow/array/array_nested.cc:
##########
@@ -351,6 +371,44 @@ Result<std::shared_ptr<Array>> FlattenListViewArray(const
ListViewArrayT& list_v
return Concatenate(slices, memory_pool);
}
+Result<std::shared_ptr<Array>> FlattenWithRecursion::Flatten(const Array&
array,
+ bool
with_recursion,
+ MemoryPool*
memory_pool) {
+ const bool has_nulls = array.null_count() > 0;
+ switch (array.type_id()) {
+ case Type::LIST:
+ return FlattenListArray(checked_cast<const ListArray&>(array),
with_recursion,
+ memory_pool);
Review Comment:
Yes, `with_recursion` is unnecessary. And also, it seems that we can easily
complete flatten in one cycle with depth=1.
--
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]