Package org.apache.druid.segment.column
Class ColumnCapabilitiesImpl
- java.lang.Object
-
- org.apache.druid.segment.column.ColumnCapabilitiesImpl
-
- All Implemented Interfaces:
ColumnCapabilities,TypeSignature<ValueType>
public class ColumnCapabilitiesImpl extends Object implements ColumnCapabilities
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.segment.column.ColumnCapabilities
ColumnCapabilities.Capable, ColumnCapabilities.CoercionLogic
-
-
Field Summary
Fields Modifier and Type Field Description static ColumnCapabilities.CoercionLogicALL_FALSE
-
Constructor Summary
Constructors Constructor Description ColumnCapabilitiesImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnCapabilities.CapableareDictionaryValuesSorted()If 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 directlyColumnCapabilities.CapableareDictionaryValuesUnique()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 lookupstatic ColumnCapabilitiesImplcopyOf(ColumnCapabilities other)static ColumnCapabilitiesImplcreateDefault()Creates aColumnCapabilitiesImplwhere allColumnCapabilities.Capablethat default to unknown instead are coerced to true or falsestatic ColumnCapabilitiesImplcreateSimpleArrayColumnCapabilities(TypeSignature<ValueType> valueType)static ColumnCapabilitiesImplcreateSimpleNumericColumnCapabilities(TypeSignature<ValueType> valueType)Create a no frills, simple column withValueTypeset and everything else falsestatic ColumnCapabilitiesImplcreateSimpleSingleValueStringColumnCapabilities()Simple, single valued, non dictionary encoded string without bitmap index or anything fancyStringgetComplexTypeName()Type 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.TypeSignature<ValueType>getElementType()ValueTypegetType()TypeDescriptorenumeration used to handle different classes of typesbooleanhasBitmapIndexes()Does 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 filterColumnCapabilities.CapablehasMultipleValues()String columns are sneaky, and might have multiple values, this is to allow callers to know and appropriately prepare themselvesColumnCapabilities.CapablehasNulls()Does this column contain null values? If so, callers, especially for primitive numeric columns, will need to check for null value rows and act accordinglybooleanhasSpatialIndexes()Does the column have spatial indexes available to allow use with spatial filtering?ColumnCapabilities.CapableisDictionaryEncoded()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 valuesColumnCapabilitiesImplsetDictionaryEncoded(boolean dictionaryEncoded)ColumnCapabilitiesImplsetDictionaryValuesSorted(boolean dictionaryValuesSorted)ColumnCapabilitiesImplsetDictionaryValuesUnique(boolean dictionaryValuesUnique)ColumnCapabilitiesImplsetHasBitmapIndexes(boolean hasInvertedIndexes)ColumnCapabilitiesImplsetHasMultipleValues(boolean hasMultipleValues)ColumnCapabilitiesImplsetHasMultipleValues(ColumnCapabilities.Capable hasMultipleValues)ColumnCapabilitiesImplsetHasNulls(boolean hasNulls)ColumnCapabilitiesImplsetHasNulls(ColumnCapabilities.Capable hasNulls)ColumnCapabilitiesImplsetHasSpatialIndexes(boolean hasSpatialIndexes)ColumnCapabilitiesImplsetType(ColumnType type)ColumnCapabilitiesImplsetType(TypeSignature<ValueType> type)static ColumnCapabilitiesImplsnapshot(ColumnCapabilities capabilities, ColumnCapabilities.CoercionLogic coerce)Copy aColumnCapabilitiesand coerce allColumnCapabilities.Capable.UNKNOWNtoColumnCapabilities.Capable.TRUEorColumnCapabilities.Capable.FALSEas specified byColumnCapabilities.CoercionLogic-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.column.ColumnCapabilities
getStrategy, toColumnType
-
Methods inherited from interface org.apache.druid.segment.column.TypeSignature
anyOf, asTypeString, getNullableStrategy, is, isArray, isNumeric, isPrimitive, isPrimitiveArray
-
-
-
-
Field Detail
-
ALL_FALSE
public static final ColumnCapabilities.CoercionLogic ALL_FALSE
-
-
Method Detail
-
copyOf
public static ColumnCapabilitiesImpl copyOf(@Nullable ColumnCapabilities other)
-
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
public static ColumnCapabilitiesImpl 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
public static ColumnCapabilitiesImpl createSimpleSingleValueStringColumnCapabilities()
Simple, single valued, non dictionary encoded string without bitmap index or anything fancy
-
createSimpleArrayColumnCapabilities
public static ColumnCapabilitiesImpl createSimpleArrayColumnCapabilities(TypeSignature<ValueType> valueType)
-
getType
@Nullable public ValueType getType()
Description copied from interface:TypeSignatureTypeDescriptorenumeration used to handle different classes of types- Specified by:
getTypein interfaceTypeSignature<ValueType>- See Also:
ValueType,ExprType
-
getComplexTypeName
@Nullable public String 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
@Nullable public TypeSignature<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
public ColumnCapabilitiesImpl setType(ColumnType type)
-
setType
public ColumnCapabilitiesImpl setType(TypeSignature<ValueType> type)
-
isDictionaryEncoded
public ColumnCapabilities.Capable 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
public ColumnCapabilitiesImpl setDictionaryEncoded(boolean dictionaryEncoded)
-
areDictionaryValuesSorted
public ColumnCapabilities.Capable 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
public ColumnCapabilitiesImpl setDictionaryValuesSorted(boolean dictionaryValuesSorted)
-
areDictionaryValuesUnique
public ColumnCapabilities.Capable 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
public ColumnCapabilitiesImpl setDictionaryValuesUnique(boolean dictionaryValuesUnique)
-
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
public ColumnCapabilitiesImpl setHasBitmapIndexes(boolean hasInvertedIndexes)
-
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
public ColumnCapabilitiesImpl setHasSpatialIndexes(boolean hasSpatialIndexes)
-
hasMultipleValues
public ColumnCapabilities.Capable 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
public ColumnCapabilitiesImpl setHasMultipleValues(boolean hasMultipleValues)
-
setHasMultipleValues
public ColumnCapabilitiesImpl setHasMultipleValues(ColumnCapabilities.Capable hasMultipleValues)
-
hasNulls
public ColumnCapabilities.Capable 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
public ColumnCapabilitiesImpl setHasNulls(boolean hasNulls)
-
setHasNulls
public ColumnCapabilitiesImpl setHasNulls(ColumnCapabilities.Capable hasNulls)
-
-