Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-6740

Combine.Globally translation is not called on URN based translation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.15.0
    • Component/s: runner-core
    • Labels:

      Description

      Beam translates Combine.Globally as a composite transform composed of:

      • Map that assigns Void keys
      • Combine.PerKey

      on spark: As Combine.Perkey uses a spark GBK inside it, the runner adds its own translation of Combine.Globally to avoid less performant GBK. This translation should be called in place of entering the composite transform translation.A pipeline like this: 

      PCollection<Integer> input = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
      input.apply(
       Combine.globally(new IntegerCombineFn()));
      
        private static class IntegerCombineFn extends Combine.CombineFn<Integer, Integer, Integer> {
      
          @Override
          public Integer createAccumulator() {
            return 0;
          }
      
          @Override
          public Integer addInput(Integer accumulator, Integer input) {
            return accumulator + input;
          }
      
          @Override
          public Integer mergeAccumulators(Iterable<Integer> accumulators) {
            Integer result = 0;
            for (Integer value : accumulators) {
              result += value;
            }
            return result;
          }
      
          @Override
          public Integer extractOutput(Integer accumulator) {
            return accumulator;
          }
        }
      
      
      

      is translated as the above composite.

        Attachments

          Activity

            People

            • Assignee:
              iemejia Ismaël Mejía
              Reporter:
              echauchot Etienne Chauchot
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 5.5h
                5.5h