lpiep opened a new issue, #15055:
URL: https://github.com/apache/arrow/issues/15055

   ### Describe the usage question you have. Please include as many useful 
details as  possible.
   
   
   What aggregate functions are available in the R dplyr interface? Is there 
documentation of what aggregates can be used in the `summarize` dplyr verb? 
   
   I ran into an issue trying to count unique values in a data set. 
`length(unique(n()))` is my usual go-to in dplyr which gave an error. However, 
when I read into the documentation on aggregate functions, the `call_function` 
docs suggest looking to 
https://arrow.apache.org/docs/cpp/compute.html#aggregations for the list of 
available Arrow functions (this makes sense as R functions are often built on 
C++). `count_distinct` is included there, but also is rejected as being 
unsupported by Arrow. 
   
   Reprex: 
   
   ```
   > tf <- tempfile()
   > dir.create(tf)
   > 
   > write_dataset(mtcars, tf, partitioning="cyl")
   > 
   > open_dataset(tf) %>% 
   +   summarize(length(unique((mpg)))) 
   Error: Error in summarize_eval(names(exprs)[i], exprs[[i]], ctx, 
length(.data$group_by_vars) >  : 
     Expression length(unique((mpg))) is not an aggregate expression or is not 
supported in Arrow
   Call collect() first to pull data into R.
   > 
   > open_dataset(tf) %>% 
   +   summarize(count_distinct(mpg)) 
   Error: Error in summarize_eval(names(exprs)[i], exprs[[i]], ctx, 
length(.data$group_by_vars) >  : 
     Expression count_distinct(mpg) is not an aggregate expression or is not 
supported in Arrow
   Call collect() first to pull data into R.
   ```
   
   
   ### Component(s)
   
   R


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