nealrichardson commented on code in PR #14361:
URL: https://github.com/apache/arrow/pull/14361#discussion_r993442605


##########
r/R/dplyr-funcs.R:
##########
@@ -160,6 +160,17 @@ create_binding_cache <- function() {
   register_bindings_type()
   register_bindings_augmented()
 
+  # HACK because random() doesn't work (ARROW-17974)
+  register_scalar_function(
+    "_random_along",
+    function(context, x) {
+      Array$create(runif(length(x)))
+    },

Review Comment:
   I tried this, and it fails with the same error message as the C++ `random()` 
function: `Error in `collect(.)`: Invalid: ExecuteScalarExpression cannot 
Execute non-scalar expression (Array[double] < 0.2)`
   
   That suggests that the problem with `random()` isn't random per se but the 
other issues that Weston flagged.
   
   (FTR, the parameter is `context$batch_length`)



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