paleolimbot commented on code in PR #15278:
URL: https://github.com/apache/arrow/pull/15278#discussion_r1069552289
##########
r/R/table.R:
##########
@@ -339,7 +339,10 @@ as_arrow_table.Dataset <- function(x, ...) {
#' @rdname as_arrow_table
#' @export
as_arrow_table.arrow_dplyr_query <- function(x, ...) {
- out <- as_arrow_table(as_record_batch_reader(x))
+ reader <- as_record_batch_reader(x)
+ on.exit(reader$.unsafe_delete())
Review Comment:
Good catch! I added an `on.exit()` for the first one...for the second one
the input is very specifically a `Table` which we have no mechanism for
cleaning up (and probably don't need to?). If you think it's easier to wrap
one's head around if the rule is "temporary record batch readers are always
deleted with `on.exit()`" I'm game (otherwise I'm inclined to constrain this
type of deleting to ExecPlan-related things).
--
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]