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


##########
r/R/query-engine.R:
##########
@@ -81,8 +82,8 @@ ExecPlan <- R6Class("ExecPlan",
           # head and tail are not ExecNodes; at best we can handle them via
           # SinkNode, so if there are any steps done after head/tail, we need 
to
           # evaluate the query up to then and then do a new query for the rest.
-          # as_record_batch_reader() will build and run an ExecPlan
-          node <- self$SourceNode(as_record_batch_reader(.data$.data))
+          # as_arrow_table() will build and run an ExecPlan
+          node <- self$SourceNode(as_arrow_table(.data$.data))

Review Comment:
   I see...it was indeed very very bad! I reverted this change...unfortunately 
it means that `%>% head() %>% collect()` doesn't work with a UDF in the 
preceeding pipeline. The workarounds are `%>% head() %>% (then something with a 
udf) %>% collect() %>% head()` and `%>% collect() %>% head()`. I think it's 
probably better to keep that explicit rather than magically ingest the whole 
query (or wait until we can properly figure out how to execute UDFs in a 
R-level record batch reader to merge this).



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to