-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-15271: [R] Refactor do_exec_plan to return a RecordBatchReader #13170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e5a28c3
f613afb
0b4c06f
c839f96
e12c633
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,11 +123,7 @@ duckdb_disconnector <- function(con, tbl_name) { | |
| #' other processes (like DuckDB). | ||
| #' | ||
| #' @param .data the object to be converted | ||
| #' @param as_arrow_query should the returned object be wrapped as an | ||
| #' `arrow_dplyr_query`? (logical, default: `TRUE`) | ||
| #' | ||
| #' @return a `RecordBatchReader` object, wrapped as an arrow dplyr query which | ||
| #' can be used in dplyr pipelines. | ||
| #' @return A `RecordBatchReader`. | ||
| #' @export | ||
| #' | ||
| #' @examplesIf getFromNamespace("run_duckdb_examples", "arrow")() | ||
|
|
@@ -142,7 +138,7 @@ duckdb_disconnector <- function(con, tbl_name) { | |
| #' summarize(mean_mpg = mean(mpg, na.rm = TRUE)) %>% | ||
| #' to_arrow() %>% | ||
| #' collect() | ||
| to_arrow <- function(.data, as_arrow_query = TRUE) { | ||
| to_arrow <- function(.data) { | ||
| # If this is an Arrow object already, return quickly since we're already Arrow | ||
| if (inherits(.data, c("arrow_dplyr_query", "ArrowObject"))) { | ||
| return(.data) | ||
|
|
@@ -161,9 +157,5 @@ to_arrow <- function(.data, as_arrow_query = TRUE) { | |
| # Run the query | ||
| res <- DBI::dbSendQuery(dbplyr::remote_con(.data), dbplyr::remote_query(.data), arrow = TRUE) | ||
|
|
||
| if (as_arrow_query) { | ||
| arrow_dplyr_query(duckdb::duckdb_fetch_record_batch(res)) | ||
| } else { | ||
| duckdb::duckdb_fetch_record_batch(res) | ||
| } | ||
| duckdb::duckdb_fetch_record_batch(res) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jonkeane FYI. See also #11730 (comment) for historical context
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm glad we can get this cleaned up 🎉 |
||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 that would be nice.