Package org.apache.druid.segment.column
Interface ColumnCapabilities
- All Superinterfaces:
TypeSignature<ValueType>
- All Known Implementing Classes:
ColumnCapabilitiesImpl
This interface is used to expose information about columns that is interesting to know for all matters dealing with
reading from columns, including query planning and optimization, creating readers to merge segments at ingestion
time, and probably nearly anything else you can imagine.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic interfaceThis interface defines the shape of a mechanism to allow for bespoke coercion ofColumnCapabilities.Capable.UNKNOWNintoColumnCapabilities.Capable.TRUEorColumnCapabilities.Capable.FALSEfor eachColumnCapabilities.Capableof aColumnCapabilities, as is appropriate for the situation of the caller. -
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.default <T> TypeStrategy<T> ATypeStrategyprovides facilities to reading and writing values to buffers, as well as basic value comparators and byte size estimation.booleanDoes 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.default ColumnTypeMethods inherited from interface org.apache.druid.segment.column.TypeSignature
anyOf, asTypeString, getComplexTypeName, getElementType, getNullableStrategy, getType, is, isArray, isNumeric, isPrimitive, isPrimitiveArray
-
Method Details
-
isDictionaryEncoded
ColumnCapabilities.Capable isDictionaryEncoded()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. -
areDictionaryValuesSorted
ColumnCapabilities.Capable areDictionaryValuesSorted()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 directly. -
areDictionaryValuesUnique
ColumnCapabilities.Capable areDictionaryValuesUnique()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. -
hasMultipleValues
ColumnCapabilities.Capable hasMultipleValues()String columns are sneaky, and might have multiple values, this is to allow callers to know and appropriately prepare themselves. -
hasBitmapIndexes
boolean hasBitmapIndexes()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 filter. -
hasSpatialIndexes
boolean hasSpatialIndexes()Does the column have spatial indexes available to allow use with spatial filtering? -
hasNulls
ColumnCapabilities.Capable 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. -
toColumnType
-
getStrategy
Description copied from interface:TypeSignatureATypeStrategyprovides facilities to reading and writing values to buffers, as well as basic value comparators and byte size estimation. UseTypeSignature.getNullableStrategy()if you need to read and write values which might possibly be null and aren't handling this in a different (probably better) way.- Specified by:
getStrategyin interfaceTypeSignature<ValueType>
-