Package org.apache.druid.query.dimension
Class DefaultDimensionSpec
java.lang.Object
org.apache.druid.query.dimension.DefaultDimensionSpec
- All Implemented Interfaces:
Cacheable,DimensionSpec
- Direct Known Subclasses:
LegacyDimensionSpec
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDimensionSpec(String dimension, String outputName) DefaultDimensionSpec(String dimension, String outputName, ColumnType outputType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDoes this DimensionSpec have workingDimensionSpec.decorate(SingleValueDimensionVectorSelector)andDimensionSpec.decorate(MultiValueDimensionVectorSelector)methods?decorate(DimensionSelector selector) Decorate aDimensionSelector, allowing custom transformation of underlying behavior (e.g.decorate(MultiValueDimensionVectorSelector selector) decorate(SingleValueDimensionVectorSelector selector) Vectorized analog ofDimensionSpec.decorate(DimensionSelector)forSingleValueDimensionVectorSelector, most likely produced withVectorColumnSelectorFactory.makeSingleValueDimensionSelector(DimensionSpec)Decoration allows aDimensionSpecto customize the behavior of the underlying selector, for example transforming or filtering values.booleanbyte[]Get a byte array used as a cache key.inthashCode()booleanDoes this DimensionSpec require that decorate() be called to produce correct results?static DefaultDimensionSpecstatic DefaultDimensionSpecof(String dimensionName, ColumnType columnType) booleanIf theDimensionSpec.decorate(org.apache.druid.segment.DimensionSelector)methods alter the underlying behavior of the dimension selector, does this alteration preserve the original ordering?toString()withDimension(String newDimension) Returns a copy of this DimensionSpec with the underlying dimension (the value ofDimensionSpec.getDimension()) replaced by "newDimension".
-
Constructor Details
-
DefaultDimensionSpec
public DefaultDimensionSpec(String dimension, @Nullable String outputName, @Nullable ColumnType outputType) -
DefaultDimensionSpec
-
-
Method Details
-
of
-
of
-
getDimension
- Specified by:
getDimensionin interfaceDimensionSpec
-
getOutputName
- Specified by:
getOutputNamein interfaceDimensionSpec
-
getOutputType
- Specified by:
getOutputTypein interfaceDimensionSpec
-
getExtractionFn
- Specified by:
getExtractionFnin interfaceDimensionSpec
-
decorate
Description copied from interface:DimensionSpecDecorate aDimensionSelector, allowing custom transformation of underlying behavior (e.g. performing extraction functions in the case ofExtractionDimensionSpec, regex filtering in the case ofRegexFilteredDimensionSpec, and so on).- Specified by:
decoratein interfaceDimensionSpec
-
decorate
Description copied from interface:DimensionSpecVectorized analog ofDimensionSpec.decorate(DimensionSelector)forSingleValueDimensionVectorSelector, most likely produced withVectorColumnSelectorFactory.makeSingleValueDimensionSelector(DimensionSpec)Decoration allows aDimensionSpecto customize the behavior of the underlying selector, for example transforming or filtering values.- Specified by:
decoratein interfaceDimensionSpec
-
decorate
Description copied from interface:DimensionSpec- Specified by:
decoratein interfaceDimensionSpec
-
canVectorize
public boolean canVectorize()Description copied from interface:DimensionSpecDoes this DimensionSpec have workingDimensionSpec.decorate(SingleValueDimensionVectorSelector)andDimensionSpec.decorate(MultiValueDimensionVectorSelector)methods?- Specified by:
canVectorizein interfaceDimensionSpec
-
mustDecorate
public boolean mustDecorate()Description copied from interface:DimensionSpecDoes this DimensionSpec require that decorate() be called to produce correct results?- Specified by:
mustDecoratein interfaceDimensionSpec
-
getCacheKey
public byte[] getCacheKey()Description copied from interface:CacheableGet a byte array used as a cache key.- Specified by:
getCacheKeyin interfaceCacheable- Returns:
- bytes to be used as cache key - or null if this object should not be cached.
-
preservesOrdering
public boolean preservesOrdering()Description copied from interface:DimensionSpecIf theDimensionSpec.decorate(org.apache.druid.segment.DimensionSelector)methods alter the underlying behavior of the dimension selector, does this alteration preserve the original ordering?- Specified by:
preservesOrderingin interfaceDimensionSpec
-
withDimension
Description copied from interface:DimensionSpecReturns a copy of this DimensionSpec with the underlying dimension (the value ofDimensionSpec.getDimension()) replaced by "newDimension".- Specified by:
withDimensionin interfaceDimensionSpec
-
toString
-
equals
-
hashCode
public int hashCode()
-