felipecrv commented on code in PR #44447:
URL: https://github.com/apache/arrow/pull/44447#discussion_r1809559720
##########
cpp/src/arrow/array/util.cc:
##########
@@ -915,6 +916,29 @@ Result<std::shared_ptr<Array>>
MakeEmptyArray(std::shared_ptr<DataType> type,
return builder->Finish();
}
+Result<std::shared_ptr<Array>> MakeMaskArray(const std::vector<int64_t>&
indices,
Review Comment:
This `std::vector` could be a `span<int64_t>` for more flexibility. The
selection vector could come from anywhere.
##########
python/pyarrow/array.pxi:
##########
@@ -538,6 +538,51 @@ def repeat(value, size, MemoryPool memory_pool=None):
return pyarrow_wrap_array(c_array)
+def mask(indices, length, MemoryPool memory_pool=None):
+ """
+ Create a boolean Array instance where specific indices are marked as True.
+
+ Parameters
+ ----------
+ indices : list[int]
Review Comment:
If the utility is templated on integer type, it could be used to implement
kernels, but implementing the kernel involves a lot more code due to
dispatching logic. So I would be in favor of having the utility as it is and
leaving the kernel for later.
--
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]