You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by th...@apache.org on 2022/08/09 12:19:18 UTC

[arrow] branch master updated: MINOR: [R][Docs] Use query that cannot be executed by arrow alone as a example of `to_duckdb`

This is an automated email from the ASF dual-hosted git repository.

thisisnic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 3eb54e2e62 MINOR: [R][Docs] Use query that cannot be executed by arrow alone as a example of `to_duckdb`
3eb54e2e62 is described below

commit 3eb54e2e620a1388064b9a85b855b9823f8b3f80
Author: SHIMA Tatsuya <ts...@gmail.com>
AuthorDate: Tue Aug 9 13:18:57 2022 +0100

    MINOR: [R][Docs] Use query that cannot be executed by arrow alone as a example of `to_duckdb`
    
    Since `dplyr::summarize` can currently be executed with arrow alone, it makes more sense to use the slice function, as an example of the usefulness of the combination with duckdb.
    
    Closes #13711 from eitsupi/r-duckdb-example
    
    Authored-by: SHIMA Tatsuya <ts...@gmail.com>
    Signed-off-by: Nic Crane <th...@gmail.com>
---
 r/R/duckdb.R       | 4 ++--
 r/man/to_duckdb.Rd | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/r/R/duckdb.R b/r/R/duckdb.R
index b924dafcab..379062ce3a 100644
--- a/r/R/duckdb.R
+++ b/r/R/duckdb.R
@@ -47,9 +47,9 @@
 #'
 #' ds %>%
 #'   filter(mpg < 30) %>%
-#'   to_duckdb() %>%
 #'   group_by(cyl) %>%
-#'   summarize(mean_mpg = mean(mpg, na.rm = TRUE))
+#'   to_duckdb() %>%
+#'   slice_min(disp)
 to_duckdb <- function(.data,
                       con = arrow_duck_connection(),
                       table_name = unique_arrow_tablename(),
diff --git a/r/man/to_duckdb.Rd b/r/man/to_duckdb.Rd
index 79c089239b..0ff2aa4404 100644
--- a/r/man/to_duckdb.Rd
+++ b/r/man/to_duckdb.Rd
@@ -47,8 +47,8 @@ ds <- InMemoryDataset$create(mtcars)
 
 ds \%>\%
   filter(mpg < 30) \%>\%
-  to_duckdb() \%>\%
   group_by(cyl) \%>\%
-  summarize(mean_mpg = mean(mpg, na.rm = TRUE))
+  to_duckdb() \%>\%
+  slice_min(disp)
 \dontshow{\}) # examplesIf}
 }