pitrou commented on a change in pull request #11357:
URL: https://github.com/apache/arrow/pull/11357#discussion_r724524473



##########
File path: r/src/compute.cpp
##########
@@ -254,6 +254,11 @@ std::shared_ptr<arrow::compute::FunctionOptions> 
make_compute_options(
                                      
cpp11::as_cpp<bool>(options["skip_nulls"]));
   }
 
+  if (func_name == "index") {
+    using Options = arrow::compute::IndexOptions;
+    return 
std::make_shared<Options>(cpp11::as_cpp<arrow::Scalar>(options["value"]));

Review comment:
       > Whilst this way actually compiles, it means I have to supply an Arrow 
Object to the call, e.g. `call_function("index", Array$create(c(1, 2, 3, 4, 
5)), options = list(value = Scalar$create(2)))` which is inconsistent with all 
the other Arrow functions.
   
   Oh, I see. Well, you just have to call `Scalar$create` implicitly then, or 
the R/C++ equivalent (I don't know what it is).
   




-- 
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]


Reply via email to