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:
[email protected]


Reply via email to