Package org.apache.druid.math.expr
Class ExpressionType
- java.lang.Object
-
- org.apache.druid.segment.column.BaseTypeSignature<ExprType>
-
- org.apache.druid.math.expr.ExpressionType
-
- All Implemented Interfaces:
TypeSignature<ExprType>
@Immutable public class ExpressionType extends BaseTypeSignature<ExprType>
The type system used to process Druid expressions. This is basicallyColumnType, but withoutColumnType.FLOATbecause the expression processing system does not currently directly support them.
-
-
Field Summary
Fields Modifier and Type Field Description static ExpressionTypeDOUBLEstatic ExpressionTypeDOUBLE_ARRAYstatic ExpressionTypeLONGstatic ExpressionTypeLONG_ARRAYstatic ExpressionTypeNESTED_DATAstatic ExpressionTypeSTRINGstatic ExpressionTypeSTRING_ARRAYstatic ExpressionTypeUNKNOWN_COMPLEX-
Fields inherited from class org.apache.druid.segment.column.BaseTypeSignature
complexTypeName, elementType, type
-
-
Constructor Summary
Constructors Constructor Description ExpressionType(ExprType exprType, String complexTypeName, ExpressionType elementType)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExpressionTypeasArrayType(ExpressionType elementType)Convert a primitiveExpressionTypeinto an array of that type.static ExpressionTypeelementType(ExpressionType type)If anExpressionTypeis an array, returnBaseTypeSignature.getElementType(), otherwise the type is returned unchanged.static ExpressionTypefromColumnType(TypeSignature<ValueType> valueType)The expression system does not distinguish betweenValueType.FLOATandValueType.DOUBLE, so this method will convertValueType.FLOATtoDOUBLE.static ExpressionTypefromColumnTypeStrict(TypeSignature<ValueType> valueType)The expression system does not distinguish betweenValueType.FLOATandValueType.DOUBLE, so, this method will convertValueType.FLOATtoDOUBLE.static ExpressionTypefromString(String typeName)static ColumnTypetoColumnType(ExpressionType exprType)ConvertExpressionTypeto the correspondingColumnType-
Methods inherited from class org.apache.druid.segment.column.BaseTypeSignature
equals, getComplexTypeName, getElementType, getNullableStrategy, getStrategy, getType, hashCode, toString
-
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
-
STRING
public static final ExpressionType STRING
-
LONG
public static final ExpressionType LONG
-
DOUBLE
public static final ExpressionType DOUBLE
-
STRING_ARRAY
public static final ExpressionType STRING_ARRAY
-
LONG_ARRAY
public static final ExpressionType LONG_ARRAY
-
DOUBLE_ARRAY
public static final ExpressionType DOUBLE_ARRAY
-
NESTED_DATA
public static final ExpressionType NESTED_DATA
-
UNKNOWN_COMPLEX
public static final ExpressionType UNKNOWN_COMPLEX
-
-
Constructor Detail
-
ExpressionType
public ExpressionType(ExprType exprType, @Nullable String complexTypeName, @Nullable ExpressionType elementType)
-
-
Method Detail
-
fromString
@Nullable public static ExpressionType fromString(@Nullable String typeName)
-
elementType
@Nullable public static ExpressionType elementType(@Nullable ExpressionType type)
If anExpressionTypeis an array, returnBaseTypeSignature.getElementType(), otherwise the type is returned unchanged.
-
asArrayType
@Nullable public static ExpressionType asArrayType(@Nullable ExpressionType elementType)
Convert a primitiveExpressionTypeinto an array of that type. Non-primitive types are passed through, even if they are not arrays.
-
fromColumnTypeStrict
public static ExpressionType fromColumnTypeStrict(@Nullable TypeSignature<ValueType> valueType)
The expression system does not distinguish betweenValueType.FLOATandValueType.DOUBLE, so, this method will convertValueType.FLOATtoDOUBLE. Null values are not allowed in this method, and will result in anIllegalStateException- Throws:
IllegalStateException
-
fromColumnType
@Nullable public static ExpressionType fromColumnType(@Nullable TypeSignature<ValueType> valueType)
The expression system does not distinguish betweenValueType.FLOATandValueType.DOUBLE, so this method will convertValueType.FLOATtoDOUBLE.
-
toColumnType
public static ColumnType toColumnType(ExpressionType exprType)
ConvertExpressionTypeto the correspondingColumnType
-
-