Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8337

Add ReduceOperation and wire it into the ReducerStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      The current ReducerStream groups all documents that share the same key(s) into a list and emits a single Tuple that contains this list. There is no way to tell the ReducerStream to do something more interesting with groups, for example summing a column within a group, or joining tuples.

      This ticket adds a new type of operation called a ReduceOperation which is passed to the ReducerStream so that the reduce behavior can be specialized.

      The ReduceOperation has two methods:

      1) operate(Tuple) : This is called once for each Tuple in a group. This method can be used to aggregate Tuples as they added to a group.
      2) reduce() : This is called when the group keys change. This method returns a single Tuple which is output by the ReducerStream. The ReduceOperation must clear it's internal structures when reduce is called as well, to prepare for the next group.

      Attachments

        1. SOLR-8337.patch
          36 kB
          Joel Bernstein
        2. SOLR-8337.patch
          28 kB
          Joel Bernstein
        3. SOLR-8337.patch
          13 kB
          Joel Bernstein
        4. SOLR-8337.patch
          7 kB
          Joel Bernstein
        5. SOLR-8337.patch
          2 kB
          Joel Bernstein

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jbernste Joel Bernstein
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: