You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2020/08/10 17:08:22 UTC

[jira] [Updated] (BEAM-6511) AbstractGlobalCombineFn hierarchy is inconsistent

     [ https://issues.apache.org/jira/browse/BEAM-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Beam JIRA Bot updated BEAM-6511:
--------------------------------
    Labels: stale-P2  (was: )

> AbstractGlobalCombineFn hierarchy is inconsistent
> -------------------------------------------------
>
>                 Key: BEAM-6511
>                 URL: https://issues.apache.org/jira/browse/BEAM-6511
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-dataflow
>    Affects Versions: 2.9.0
>            Reporter: Nahuel Lofeudo
>            Priority: P2
>              Labels: stale-P2
>         Attachments: combineFn-hierarchy.png
>
>
> Subclasses of AbstractGlobalCombineFn seem to be arranged in a way that prevents them from being used with the DataflowRunner. 
> Subclasses of AbstractGlobalCombineFn are under either CombineFn or CombineFnWithContext, which seems to be in itself a CombineFn which has access to PipelineOptions and Side Inputs.
> However, the DataflowRunner casts all combiners passed from user code to CombineFn (see [1]) which prevents combiners that extend CombineFnWithContext from being used there. 
>  
> For example: 
> public class CustomCombinerFn extends CombineWithContext.CombineFnWithContext<...> \{...}
>  
> final PCollectionView<SomeObject<String>> newCollection = oldCollection
>   .apply("Custom Combiner", Combine.globally(new CustomCombinerFn(filter)) 
>   .withSideInputs(filter)
>   .withoutDefaults()
>   .asSingletonView());
>  
> IMHO either CombineFnWithContext should be a subclass of CombineFn or DataflowRunner should cast the combiner to AbstractGlobalCombineFn. 
>  
> [1] https://github.com/apache/beam/blob/b83b302ef97767e4ca245ea24e8bd40a6692e72c/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java#L514



--
This message was sent by Atlassian Jira
(v8.3.4#803005)