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>
The type system used to process Druid expressions. This is basically
ColumnType, but without
ColumnType.FLOAT because the expression processing system does not currently directly support them.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ExpressionTypestatic final ExpressionTypestatic final ExpressionTypestatic final ExpressionTypestatic final ExpressionTypestatic final ExpressionTypestatic final ExpressionTypestatic final ExpressionTypeFields inherited from class org.apache.druid.segment.column.BaseTypeSignature
complexTypeName, elementType, type -
Constructor Summary
ConstructorsConstructorDescriptionExpressionType(ExprType exprType, String complexTypeName, ExpressionType elementType) -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 correspondingColumnTypeMethods inherited from class org.apache.druid.segment.column.BaseTypeSignature
equals, getComplexTypeName, getElementType, getNullableStrategy, getStrategy, getType, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.segment.column.TypeSignature
anyOf, asTypeString, is, isArray, isNumeric, isPrimitive, isPrimitiveArray
-
Field Details
-
STRING
-
LONG
-
DOUBLE
-
STRING_ARRAY
-
LONG_ARRAY
-
DOUBLE_ARRAY
-
NESTED_DATA
-
UNKNOWN_COMPLEX
-
-
Constructor Details
-
ExpressionType
public ExpressionType(ExprType exprType, @Nullable String complexTypeName, @Nullable ExpressionType elementType)
-
-
Method Details
-
fromString
-
elementType
If anExpressionTypeis an array, returnBaseTypeSignature.getElementType(), otherwise the type is returned unchanged. -
asArrayType
Convert a primitiveExpressionTypeinto an array of that type. Non-primitive types are passed through, even if they are not arrays. -
fromColumnTypeStrict
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
The expression system does not distinguish betweenValueType.FLOATandValueType.DOUBLE, so this method will convertValueType.FLOATtoDOUBLE. -
toColumnType
ConvertExpressionTypeto the correspondingColumnType
-