Commits


Dewey Dunnington authored and GitHub committed 97076308d07
ARROW-18012: [R] Make map_batches .lazy = TRUE by default (#14521) This makes the default `map_batches()` behaviour lazy (i.e., the function is called once per batch as each batch arrives): ``` r library(arrow, warn.conflicts = FALSE) #> Some features are not enabled in this build of Arrow. Run `arrow_info()` for more information. source <- RecordBatchReader$create( record_batch(a = 1:10), record_batch(a = 11:20) ) mapped <- map_batches(source, function(x) { message("Hi! I'm being evaluated!") x }, .schema = source$schema) as_arrow_table(mapped) #> Hi! I'm being evaluated! #> Hi! I'm being evaluated! #> Table #> 20 rows x 1 columns #> $a <int32> ``` <sup>Created on 2022-10-26 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup> This was previously a confusing default since piping the resulting `RecordBatchReader` into an `ExecPlan` would fail for some ExecPlans before ARROW-17178 (#13706). This PR commits to the (more optimal/expected) lazy behaviour. Authored-by: Dewey Dunnington <dewey@voltrondata.com> Signed-off-by: Dewey Dunnington <dewey@fishandwhistle.net>