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/08/29 13:31:53 UTC

[GitHub] [arrow] paleolimbot commented on a diff in pull request #13706: ARROW-17178: [R] Support head() in arrow_dplyr_query with user-defined function

paleolimbot commented on code in PR #13706:
URL: https://github.com/apache/arrow/pull/13706#discussion_r957341060


##########
r/R/query-engine.R:
##########
@@ -238,18 +227,13 @@ ExecPlan <- R6Class("ExecPlan",
         slice_size <- node$extras$head %||% node$extras$tail
         if (!is.null(slice_size)) {
           out <- head(out, slice_size)
-          # We already have everything we need for the head, so StopProducing
-          self$Stop()

Review Comment:
   Because of the change to `head.RecordBatchReader()`, no batches get pulled when `head(out)` is called (which is need to make sure that the ExecPlan can continue to defer StartProducing()). The C++ implementation of `head.RecordBatchReader()` takes care of calling `Close()` on the upstream reader (which, if it's an ExecPlanReader, will call `StopProducing()`. I should add a test to make sure that's the case though!



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