edponce commented on a change in pull request #11886:
URL: https://github.com/apache/arrow/pull/11886#discussion_r776493536
##########
File path: cpp/src/arrow/compute/kernels/vector_selection.cc
##########
@@ -2355,6 +2358,76 @@ const FunctionDoc array_take_doc(
"given by `indices`. Nulls in `indices` emit null in the output."),
{"array", "indices"}, "TakeOptions");
+const FunctionDoc indices_nonzero_doc(
+ "Return indices of the array containing non zero or false values",
+ ("For each input value, check if it's zero, false or null. Emit the
index\n"
+ "of the value in the array if it's none of the those."),
+ {"values"});
+
+struct NonZeroVisitor {
+ UInt64Builder* builder;
+ const ArrayData& array;
+
+ NonZeroVisitor(UInt64Builder* builder, const ArrayData& array)
+ : builder(builder), array(array) {}
+
+ Status Visit(const DataType& type) { return
Status::NotImplemented(type.ToString()); }
+
+ template <typename Type>
+ enable_if_t<is_primitive_ctype<Type>::value, Status> Visit(const Type&) {
Review comment:
Create ARROW-15218 as follow-up to add Decimal support. We could also
argue that any of the temporal types also fit the non-zero property, but will
discuss this in JIRA.
--
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]