Package org.apache.druid.segment.column
Interface ColumnCapabilities
-
- All Superinterfaces:
TypeSignature<ValueType>
- All Known Implementing Classes:
ColumnCapabilitiesImpl
public interface ColumnCapabilities extends TypeSignature<ValueType>
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:
ColumnType
,TypeSignature
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ColumnCapabilities.Capable
static interface
ColumnCapabilities.CoercionLogic
This interface defines the shape of a mechnism to allow for bespoke coercion ofColumnCapabilities.Capable.UNKNOWN
intoColumnCapabilities.Capable.TRUE
orColumnCapabilities.Capable.FALSE
for eachColumnCapabilities.Capable
of aColumnCapabilities
, as is appropriate for the situation of the caller.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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 directlyColumnCapabilities.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 lookupdefault <T> TypeStrategy<T>
getStrategy()
ATypeStrategy
provides facilities to reading and writing values to buffers, as well as basic value comparators and byte size estimation.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 filterColumnCapabilities.Capable
hasMultipleValues()
String columns are sneaky, and might have multiple values, this is to allow callers to know and appropriately prepare themselvesColumnCapabilities.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 accordinglyboolean
hasSpatialIndexes()
Does the column have spatial indexes available to allow use with spatial filtering?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 valuesdefault ColumnType
toColumnType()
-
Methods inherited from interface org.apache.druid.segment.column.TypeSignature
anyOf, asTypeString, getComplexTypeName, getElementType, getNullableStrategy, getType, is, isArray, isNumeric, isPrimitive, isPrimitiveArray
-
-
-
-
Method Detail
-
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
default ColumnType toColumnType()
-
getStrategy
default <T> TypeStrategy<T> getStrategy()
Description copied from interface:TypeSignature
ATypeStrategy
provides 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:
getStrategy
in interfaceTypeSignature<ValueType>
-
-