You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes the default map_batches() behaviour lazy (i.e., the function is called once per batch as each batch arrives):
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>
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the default
map_batches()behaviour lazy (i.e., the function is called once per batch as each batch arrives):Created on 2022-10-26 with reprex v2.0.2
This was previously a confusing default since piping the resulting
RecordBatchReaderinto anExecPlanwould fail for some ExecPlans before ARROW-17178 (#13706). This PR commits to the (more optimal/expected) lazy behaviour.