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

Add Equalitors to Streaming Expressions

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: None
    • Component/s: clients - java
    • Labels:
      None

      Description

      Right now all streams use the Comparator<Tuple> interface to compare tuples. The Comparator interface will tell you if tupleA is before, after, or equal to tupleB. This is great for most streams as they use this logic when combining multiple streams together. However, some streams only care about the equality of two tuples and the less/greater than logic is unnecessary.

      This depends on SOLR-7377.

      This patch is to introduce a new interface into streaming expressions called Equalitor<Tuple> which will return if two tuples are equal. The benefit here is that the expressions for streams using Equalitor instead of Comparator can omit the ordering part.

      unique(somestream, over="fieldA asc, fieldB desc")
      

      can become

      unique(somestream, over="fieldA,fieldB")
      

      The added benefit is that this will set us up with simplier expressions for joins (hash, merge, inner, outer, etc...) as those only care about equality.

      By adding this as an interface we make no assumptions about what it means to be equal, just that some implementation needs to exist adhering to the Equalitor<Tuple> interface which will determine if two tuples are logically equal.

      We do define at least one concrete class which checks for equality but that does not preclude others from adding additional concrete classes with their own logic in place.

        Attachments

        1. SOLR-7513.patch
          73 kB
          Joel Bernstein
        2. SOLR-7513.patch
          70 kB
          Joel Bernstein
        3. SOLR-7513.patch
          19 kB
          Dennis Gove
        4. SOLR-7513.patch
          19 kB
          Dennis Gove

          Activity

            People

            • Assignee:
              joel.bernstein Joel Bernstein
              Reporter:
              dpgove Dennis Gove
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: