wesm commented on code in PR #13397:
URL: https://github.com/apache/arrow/pull/13397#discussion_r902624010
##########
r/src/compute.cpp:
##########
@@ -574,3 +576,118 @@ SEXP compute__CallFunction(std::string func_name,
cpp11::list args, cpp11::list
std::vector<std::string> compute__GetFunctionNames() {
return arrow::compute::GetFunctionRegistry()->GetFunctionNames();
}
+
+class RScalarUDFCallable : public arrow::compute::ArrayKernelExec {
Review Comment:
Please do this a different way (e.g. put the data that you need to persist
in a KernelState instead). `ArrayKernelExec` is a `std::function` and is meant
to have the semantics of a function pointer, not a generic callable. I actually
plan to make `ArrayKernelExec` a function pointer because debugging with
`std::function` adds ~4 levels to the call stack when using gdb which is very
tedious
##########
r/src/compute.cpp:
##########
@@ -574,3 +576,118 @@ SEXP compute__CallFunction(std::string func_name,
cpp11::list args, cpp11::list
std::vector<std::string> compute__GetFunctionNames() {
return arrow::compute::GetFunctionRegistry()->GetFunctionNames();
}
+
+class RScalarUDFCallable : public arrow::compute::ArrayKernelExec {
Review Comment:
Please do this a different way (e.g. put the data that you need to persist
in a KernelState instead). `ArrayKernelExec` is a `std::function` and is meant
to have the semantics of a function pointer, not a generic callable class. I
actually plan to make `ArrayKernelExec` a function pointer because debugging
with `std::function` adds ~4 levels to the call stack when using gdb which is
very tedious
--
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]