Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-12097

Sort within a by group for Aggregator plugins

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Pipeline Plugins
    • Labels:
    • Rank:
      1|i004w7:

      Description

      Aggregator plugins can group records together and then aggregate each group. The interface looks like:

      public interface Aggregator<GROUP_KEY, GROUP_VALUE, OUT> {
      
        void groupBy(GROUP_VALUE groupValue, Emitter<GROUP_KEY> emitter) throws Exception;
      
        void aggregate(GROUP_KEY groupKey, Iterator<GROUP_VALUE> groupValues, Emitter<OUT> emitter) throws Exception;
      
      }
      

      We have seen use cases where there is a need to sort the values within a group before aggregating them. In other words, the Iterator in aggregate should return values in a sorted order. To support this, we should think about adding a sortBy() method to the aggregator, that would logically sort all GROUP_VALUE objects within a GROUP_KEY before aggregate() is called.

        Attachments

          Activity

            People

            • Assignee:
              bhooshan Bhooshan Mogal
              Reporter:
              ashau Albert Shau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: