You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Kenneth Knowles (JIRA)" <ji...@apache.org> on 2017/01/17 17:41:26 UTC

[jira] [Commented] (BEAM-135) Utilities for "batching" elements in a DoFn

    [ https://issues.apache.org/jira/browse/BEAM-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15826462#comment-15826462 ] 

Kenneth Knowles commented on BEAM-135:
--------------------------------------

There are probably multiple use cases here that might deserve different treatment. The easiest way to achieve the abstract goal of "iterables of _n_ elements" is using the new state API, which allows buffering across bundles, which may be smaller than _n_. That API has preliminary support in the direct runner and Dataflow runner.

> Utilities for "batching" elements in a DoFn
> -------------------------------------------
>
>                 Key: BEAM-135
>                 URL: https://issues.apache.org/jira/browse/BEAM-135
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-java-core
>            Reporter: Ben Chambers
>            Assignee: Etienne Chauchot
>
> We regularly receive questions about how to write a {{DoFn}} that operates on batches of elements. Example answers include:
> http://stackoverflow.com/questions/35065109/can-datastore-input-in-google-dataflow-pipeline-be-processed-in-a-batch-of-n-ent/35068341#35068341
> http://stackoverflow.com/questions/30177812/partition-data-coming-from-csv-so-i-can-process-larger-patches-rather-then-indiv/30178170#30178170
> Possible APIs could be to wrap a {{DoFn}} and include a batch size, or to create a utility like {{Filter}}, {{Partition}}, etc. that takes a {{SerializableFunction}} or a {{SimpleFunction}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)