Class WindowValueProcessorBase
- java.lang.Object
-
- org.apache.druid.query.operator.window.value.WindowValueProcessorBase
-
- All Implemented Interfaces:
Processor
- Direct Known Subclasses:
WindowFirstProcessor
,WindowLastProcessor
,WindowOffsetProcessor
public abstract class WindowValueProcessorBase extends Object implements Processor
-
-
Constructor Summary
Constructors Constructor Description WindowValueProcessorBase(String inputColumn, String outputColumn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getInputColumn()
String
getOutputColumn()
protected String
internalToString()
protected boolean
intervalValidation(WindowValueProcessorBase other)
RowsAndColumns
processInternal(RowsAndColumns input, Function<Column,Column> fn)
This implements the common logic between the various value processors.String
toString()
boolean
validateEquivalent(Processor otherProcessor)
Validates the equivalence of the Processors.
-
-
-
Method Detail
-
getInputColumn
public String getInputColumn()
-
getOutputColumn
public String getOutputColumn()
-
processInternal
public RowsAndColumns processInternal(RowsAndColumns input, Function<Column,Column> fn)
This implements the common logic between the various value processors. It looks like it could be static, but if it is static then the lambda becomes polymorphic. We keep it as a member method of the base class so taht the JVM can inline it and specialize the lambda- Parameters:
input
- incoming RowsAndColumns, as in Processor.processfn
- function that converts the input column into the output column- Returns:
- RowsAndColumns, as in Processor.process
-
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 interfaceProcessor
- 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(WindowValueProcessorBase other)
-
internalToString
protected String internalToString()
-
-