You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/23 02:22:07 UTC

[GitHub] [arrow] eitsupi commented on a diff in pull request #13641: ARROW-12693: [R] add unique() methods for ArrowTabular, datasets

eitsupi commented on code in PR #13641:
URL: https://github.com/apache/arrow/pull/13641#discussion_r928066536


##########
r/R/dplyr.R:
##########
@@ -184,6 +184,29 @@ dim.arrow_dplyr_query <- function(x) {
   c(rows, cols)
 }
 
+#' @export
+unique.arrow_dplyr_query <- function(x, incomparables = FALSE, fromLast = FALSE, ...) {
+
+  if (incomparables == TRUE) {
+    arrow_not_supported("`unique()` with `incomparables = TRUE`")
+  }
+
+  if (fromLast == TRUE) {
+    arrow_not_supported("`unique()` with `fromLast = TRUE`")
+  }
+
+  x <- dplyr::distinct(x)
+  dplyr::collect(x)

Review Comment:
   Since dtplyr does not do collect, perhaps it would be more consistent to not do collect here as well.
   https://github.com/tidyverse/dtplyr/blob/2181de14668fdad46f5068b56bd34e440b3b6749/R/step-call.R#L208-L214



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org