You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/10/13 16:55:13 UTC

[GitHub] [beam] robertwb commented on pull request #13081: [BEAM-3376] Adds possibility to customize of default_value evaluation in CombineFn.

robertwb commented on pull request #13081:
URL: https://github.com/apache/beam/pull/13081#issuecomment-707877140


   Note that one can always override `CombineFn.apply()`, so this seems more about setup/teardown, right? 
   
   The disadvantage of a special method means that the semantics are unclear of whether one is allowed to call apply() with an empty iterable... or is one forced to check if the iterable is empty to choose to call apply or default_value? I'm thinking about other places CombineFns may be used used, for example, in CombiningStates. 
   
   If the goal is just to avoid calling setup/teardown in the main program, we can rewrite the `InjectDefault` inside `CombineGlobally` to take an iterable side input and invoke `apply([])` manually (with the setup and teardown) iff the iterable is empty. 


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

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