Package org.apache.druid.segment.column
Class ColumnCapabilitiesImpl
java.lang.Object
org.apache.druid.segment.column.ColumnCapabilitiesImpl
- All Implemented Interfaces:
ColumnCapabilities,TypeSignature<ValueType>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.segment.column.ColumnCapabilities
ColumnCapabilities.Capable, ColumnCapabilities.CoercionLogic -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIf the column is dictionary encoded, are those values sorted? Useful to know for optimizations that can defer looking up values and allowing sorting with the dictionary ids directly.If the column is dictionary encoded, is there a 1:1 mapping of dictionary ids to values? If this is true, it unlocks optimizations such as allowing for things like grouping directly on dictionary ids and deferred value lookup.static ColumnCapabilitiesImplcopyOf(ColumnCapabilities other) static ColumnCapabilitiesImplCreates aColumnCapabilitiesImplwhere allColumnCapabilities.Capablethat default to unknown instead are coerced to true or falsestatic ColumnCapabilitiesImplSimilar tocreateSimpleNumericColumnCapabilities(org.apache.druid.segment.column.TypeSignature<org.apache.druid.segment.column.ValueType>)excepthasNullsis not setstatic ColumnCapabilitiesImplCreate a no frills, simple column withValueTypeset and everything else falsestatic ColumnCapabilitiesImplSimple, single valued, non dictionary encoded string without bitmap index or anything fancyType name of 'complex' types (ValueType.COMPLEX,ExprType.COMPLEX), which are 'registered' by their name, acting as a key to get the correct set of serialization, deserialization, and other type specific handling facilties.getType()TypeDescriptorenumeration used to handle different classes of typesbooleanDoes the column have an inverted index bitmap for each value? If so, these may be employed to 'pre-filter' the column by examining if the values match the filter and intersecting the bitmaps, to avoid having to scan and evaluate if every row matches the filter.String columns are sneaky, and might have multiple values, this is to allow callers to know and appropriately prepare themselves.hasNulls()Does this column contain null values? If so, callers, especially for primitive numeric columns, will need to check for null value rows and act accordingly.booleanDoes the column have spatial indexes available to allow use with spatial filtering?Is the column dictionary encoded? If so, a DimensionDictionarySelector may be used instead of using a value selector, allowing algorithms to operate on primitive integer dictionary ids rather than the looked up dictionary values.setDictionaryEncoded(boolean dictionaryEncoded) setDictionaryValuesSorted(boolean dictionaryValuesSorted) setDictionaryValuesUnique(boolean dictionaryValuesUnique) setHasBitmapIndexes(boolean hasInvertedIndexes) setHasMultipleValues(boolean hasMultipleValues) setHasMultipleValues(ColumnCapabilities.Capable hasMultipleValues) setHasNulls(boolean hasNulls) setHasNulls(ColumnCapabilities.Capable hasNulls) setHasSpatialIndexes(boolean hasSpatialIndexes) setType(ColumnType type) setType(TypeSignature<ValueType> type) static ColumnCapabilitiesImplsnapshot(ColumnCapabilities capabilities, ColumnCapabilities.CoercionLogic coerce) Copy aColumnCapabilitiesand coerce allColumnCapabilities.Capable.UNKNOWNtoColumnCapabilities.Capable.TRUEorColumnCapabilities.Capable.FALSEas specified byColumnCapabilities.CoercionLogicMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.segment.column.ColumnCapabilities
getStrategy, toColumnTypeMethods inherited from interface org.apache.druid.segment.column.TypeSignature
anyOf, asTypeString, getNullableStrategy, is, isArray, isNumeric, isPrimitive, isPrimitiveArray
-
Field Details
-
ALL_FALSE
-
-
Constructor Details
-
ColumnCapabilitiesImpl
public ColumnCapabilitiesImpl()
-
-
Method Details
-
copyOf
-
snapshot
@Nullable public static ColumnCapabilitiesImpl snapshot(@Nullable ColumnCapabilities capabilities, ColumnCapabilities.CoercionLogic coerce) Copy aColumnCapabilitiesand coerce allColumnCapabilities.Capable.UNKNOWNtoColumnCapabilities.Capable.TRUEorColumnCapabilities.Capable.FALSEas specified byColumnCapabilities.CoercionLogic -
createDefault
Creates aColumnCapabilitiesImplwhere allColumnCapabilities.Capablethat default to unknown instead are coerced to true or false -
createSimpleNumericColumnCapabilities
public static ColumnCapabilitiesImpl createSimpleNumericColumnCapabilities(TypeSignature<ValueType> valueType) Create a no frills, simple column withValueTypeset and everything else false -
createSimpleSingleValueStringColumnCapabilities
Simple, single valued, non dictionary encoded string without bitmap index or anything fancy -
createSimpleArrayColumnCapabilities
public static ColumnCapabilitiesImpl createSimpleArrayColumnCapabilities(TypeSignature<ValueType> valueType) Similar tocreateSimpleNumericColumnCapabilities(org.apache.druid.segment.column.TypeSignature<org.apache.druid.segment.column.ValueType>)excepthasNullsis not set -
getType
Description copied from interface:TypeSignatureTypeDescriptorenumeration used to handle different classes of types- Specified by:
getTypein interfaceTypeSignature<ValueType>- See Also:
-
getComplexTypeName
Description copied from interface:TypeSignatureType name of 'complex' types (ValueType.COMPLEX,ExprType.COMPLEX), which are 'registered' by their name, acting as a key to get the correct set of serialization, deserialization, and other type specific handling facilties. For other types, this value will be null.- Specified by:
getComplexTypeNamein interfaceTypeSignature<ValueType>
-
getElementType
Description copied from interface:TypeSignatureTypeSignaturefor the elements contained in an array type (ValueType.ARRAY,ExprType.ARRAY). For non-array types, this value will be null.- Specified by:
getElementTypein interfaceTypeSignature<ValueType>
-
setType
-
setType
-
isDictionaryEncoded
Description copied from interface:ColumnCapabilitiesIs the column dictionary encoded? If so, a DimensionDictionarySelector may be used instead of using a value selector, allowing algorithms to operate on primitive integer dictionary ids rather than the looked up dictionary values.- Specified by:
isDictionaryEncodedin interfaceColumnCapabilities
-
setDictionaryEncoded
-
areDictionaryValuesSorted
Description copied from interface:ColumnCapabilitiesIf the column is dictionary encoded, are those values sorted? Useful to know for optimizations that can defer looking up values and allowing sorting with the dictionary ids directly.- Specified by:
areDictionaryValuesSortedin interfaceColumnCapabilities
-
setDictionaryValuesSorted
-
areDictionaryValuesUnique
Description copied from interface:ColumnCapabilitiesIf the column is dictionary encoded, is there a 1:1 mapping of dictionary ids to values? If this is true, it unlocks optimizations such as allowing for things like grouping directly on dictionary ids and deferred value lookup.- Specified by:
areDictionaryValuesUniquein interfaceColumnCapabilities
-
setDictionaryValuesUnique
-
hasBitmapIndexes
public boolean hasBitmapIndexes()Description copied from interface:ColumnCapabilitiesDoes the column have an inverted index bitmap for each value? If so, these may be employed to 'pre-filter' the column by examining if the values match the filter and intersecting the bitmaps, to avoid having to scan and evaluate if every row matches the filter.- Specified by:
hasBitmapIndexesin interfaceColumnCapabilities
-
setHasBitmapIndexes
-
hasSpatialIndexes
public boolean hasSpatialIndexes()Description copied from interface:ColumnCapabilitiesDoes the column have spatial indexes available to allow use with spatial filtering?- Specified by:
hasSpatialIndexesin interfaceColumnCapabilities
-
setHasSpatialIndexes
-
hasMultipleValues
Description copied from interface:ColumnCapabilitiesString columns are sneaky, and might have multiple values, this is to allow callers to know and appropriately prepare themselves.- Specified by:
hasMultipleValuesin interfaceColumnCapabilities
-
setHasMultipleValues
-
setHasMultipleValues
-
hasNulls
Description copied from interface:ColumnCapabilitiesDoes this column contain null values? If so, callers, especially for primitive numeric columns, will need to check for null value rows and act accordingly.- Specified by:
hasNullsin interfaceColumnCapabilities
-
setHasNulls
-
setHasNulls
-