Package org.apache.druid.segment.column
Class BaseTypeSignature<Type extends TypeDescriptor>
- java.lang.Object
-
- org.apache.druid.segment.column.BaseTypeSignature<Type>
-
- All Implemented Interfaces:
TypeSignature<Type>
- Direct Known Subclasses:
ColumnType,ExpressionType
@Immutable public abstract class BaseTypeSignature<Type extends TypeDescriptor> extends Object implements TypeSignature<Type>
-
-
Field Summary
Fields Modifier and Type Field Description protected StringcomplexTypeNameprotected TypeSignature<Type>elementTypeprotected Typetype
-
Constructor Summary
Constructors Constructor Description BaseTypeSignature(TypeFactory typeFactory, Type type, String complexTypeName, TypeSignature<Type> elementType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetComplexTypeName()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<Type>getElementType()<T> NullableTypeStrategy<T>getNullableStrategy()ANullableTypeStrategyis aTypeStrategywhich can handle reading and writing null values, at the very high cost of an additional byte per value, of which a single bit is used to storeNullHandling.IS_NULL_BYTEorNullHandling.IS_NOT_NULL_BYTEas appropriate.<T> TypeStrategy<T>getStrategy()ATypeStrategyprovides facilities to reading and writing values to buffers, as well as basic value comparators and byte size estimation.TypegetType()TypeDescriptorenumeration used to handle different classes of typesinthashCode()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.column.TypeSignature
anyOf, asTypeString, is, isArray, isNumeric, isPrimitive, isPrimitiveArray
-
-
-
-
Field Detail
-
type
protected final Type extends TypeDescriptor type
-
elementType
@Nullable protected final TypeSignature<Type extends TypeDescriptor> elementType
-
-
Constructor Detail
-
BaseTypeSignature
public BaseTypeSignature(TypeFactory typeFactory, Type type, @Nullable String complexTypeName, @Nullable TypeSignature<Type> elementType)
-
-
Method Detail
-
getType
public Type getType()
Description copied from interface:TypeSignatureTypeDescriptorenumeration used to handle different classes of types- Specified by:
getTypein interfaceTypeSignature<Type extends TypeDescriptor>- 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<Type extends TypeDescriptor>
-
getElementType
@Nullable public TypeSignature<Type> 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<Type extends TypeDescriptor>
-
getStrategy
public <T> TypeStrategy<T> 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<Type extends TypeDescriptor>
-
getNullableStrategy
public <T> NullableTypeStrategy<T> getNullableStrategy()
Description copied from interface:TypeSignatureANullableTypeStrategyis aTypeStrategywhich can handle reading and writing null values, at the very high cost of an additional byte per value, of which a single bit is used to storeNullHandling.IS_NULL_BYTEorNullHandling.IS_NOT_NULL_BYTEas appropriate. This pattern is common among buffer aggregators, which don't have access to an external memory location for more efficient tracking of null values and must store this information inline with the accumulated value.- Specified by:
getNullableStrategyin interfaceTypeSignature<Type extends TypeDescriptor>
-
-