Package org.apache.druid.segment
Interface ColumnProcessorFactory<T>
- All Known Implementing Classes:
EqualityFilter.TypedConstantValueMatcherFactory,PredicateValueMatcherFactory,StringConstantValueMatcherFactory
public interface ColumnProcessorFactory<T>
Class that encapsulates knowledge about how to create "column processors", which are... objects that process columns
and want to have type-specific logic. Used by
ColumnProcessors.makeProcessor(java.lang.String, org.apache.druid.segment.ColumnProcessorFactory<T>, org.apache.druid.segment.ColumnSelectorFactory).
Column processors can be any type "T". The idea is that a ColumnProcessorFactory embodies the logic for wrapping
and processing selectors of various types, and so enables nice code design, where type-dependent code is not
sprinkled throughout.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionThis default type will be used when the underlying column has an unknown type.makeArrayProcessor(BaseObjectColumnValueSelector<?> selector, ColumnCapabilities columnCapabilities) makeComplexProcessor(BaseObjectColumnValueSelector<?> selector) Create a processor for a complex column.makeDimensionProcessor(DimensionSelector selector, boolean multiValue) Create a processor for a string column.Create a processor for a double column.Create a processor for a float column.makeLongProcessor(BaseLongColumnValueSelector selector) Create a processor for a long column.
-
Method Details
-
defaultType
ColumnType defaultType()This default type will be used when the underlying column has an unknown type. This allows a column processor factory to specify what type it prefers to deal with (the most 'natural' type for whatever it is doing) when all else is equal. -
makeDimensionProcessor
Create a processor for a string column.- Parameters:
selector- dimension selectormultiValue- whether the selector *might* have multiple values
-
makeFloatProcessor
Create a processor for a float column.- Parameters:
selector- float selector
-
makeDoubleProcessor
Create a processor for a double column.- Parameters:
selector- double selector
-
makeLongProcessor
Create a processor for a long column.- Parameters:
selector- long selector
-
makeArrayProcessor
T makeArrayProcessor(BaseObjectColumnValueSelector<?> selector, @Nullable ColumnCapabilities columnCapabilities) - Parameters:
selector- array selectorcolumnCapabilities- information about the underlying column to match. Null here just means the capabilities are unknown, and not necessarily indicative that the column doesn't exist
-
makeComplexProcessor
Create a processor for a complex column.- Parameters:
selector- object selector
-