Class WindowRankingProcessorBase

java.lang.Object
org.apache.druid.query.operator.window.ranking.WindowRankingProcessorBase
All Implemented Interfaces:
Processor
Direct Known Subclasses:
WindowCumeDistProcessor, WindowDenseRankProcessor, WindowRankProcessor

public abstract class WindowRankingProcessorBase extends Object implements Processor
This Processor assumes that data has already been sorted for it. It does not re-sort the data and if it is given data that is not in the correct sorted order, its operation is undefined.
  • Constructor Details

    • WindowRankingProcessorBase

      public WindowRankingProcessorBase(List<String> groupingCols, String outputColumn)
  • Method Details

    • getGroupingCols

      public List<String> getGroupingCols()
    • getOutputColumn

      public String getOutputColumn()
    • processInternal

      public RowsAndColumns processInternal(RowsAndColumns incomingPartition, Function<int[],Column> fn)
    • validateEquivalent

      public boolean validateEquivalent(Processor otherProcessor)
      Description copied from interface: Processor
      Validates the equivalence of the Processors. This is similar to @{code .equals} but is its own method so that it can ignore certain fields that would be important for a true equality check. Namely, two Processors defined the same way but with different output names can be considered equivalent even though they are not equal.

      This primarily exists to simplify tests, where this equivalence can be used to validate that the Processors created by the SQL planner are actually equivalent to what we expect without needing to be overly dependent on how the planner names the output columns

      Specified by:
      validateEquivalent in interface Processor
      Parameters:
      otherProcessor - the processor to test equivalence of
      Returns:
      boolean identifying if these processors should be considered equivalent to each other.
    • intervalValidation

      protected boolean intervalValidation(WindowRankingProcessorBase other)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • internalToString

      protected String internalToString()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getOutputColumnNames

      public List<String> getOutputColumnNames()
      Specified by:
      getOutputColumnNames in interface Processor
      Returns:
      List of output column names for the Processor.