nealrichardson commented on code in PR #13773:
URL: https://github.com/apache/arrow/pull/13773#discussion_r935523906
##########
r/R/compute.R:
##########
@@ -358,10 +358,15 @@ cast_options <- function(safe = TRUE, ...) {
#' auto_convert = TRUE
#' )
#'
+#' # User-defined functions require some special handling
+#' # in the query engine which currently require an opt-in using
+#' # the R_ARROW_COLLECT_WITH_UDF environment variable.
+#' Sys.setenv(R_ARROW_COLLECT_WITH_UDF = "true")
#' as_arrow_table(mtcars) %>%
#' transmute(mpg, mpg_predicted = mtcars_predict_mpg(disp, cyl)) %>%
#' collect() %>%
#' head()
+#' Sys.unsetenv("R_ARROW_COLLECT_WITH_UDF")
#'
register_scalar_function <- function(name, fun, in_type, out_type,
Review Comment:
What if you put `Sys.setenv(R_ARROW_COLLECT_WITH_UDF = "true")` inside of
`register_scalar_function()`? You're already opting-in to UDFs by calling this
function, and there's no reason you'd want to call this but not have
COLLECT_WITH_UDF working.
--
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]