Class ValueLiteralExpression
- All Implemented Interfaces:
Expression,ResolvedExpression
By design, this class can take any value described by a DataType. However, it is
recommended to use instances with default conversion (see DataType.getConversionClass().
Equals/hashCode support of this expression depends on the equals/hashCode support of the value.
The data type can be extracted automatically from non-null values using value-based extraction
(see ValueDataTypeConverter).
Symbols (enums extending from TableSymbol) are considered as literal values.
-
Constructor Summary
ConstructorsConstructorDescriptionValueLiteralExpression(Object value) ValueLiteralExpression(Object value, DataType dataType) -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(ExpressionVisitor<R> visitor) Returns a string that fully serializes this instance.Returns a string that summarizes this expression for printing to a console.booleanReturns the data type of the computation result.<T> Optional<T>getValueAs(Class<T> clazz) Returns the value (excluding null) as an instance of the given class.inthashCode()booleanisNull()toString()
-
Constructor Details
-
ValueLiteralExpression
-
ValueLiteralExpression
-
-
Method Details
-
isNull
public boolean isNull() -
getValueAs
Returns the value (excluding null) as an instance of the given class.It supports conversions to default conversion classes of
LogicalTypesand additionally toBigDecimalfor all types ofLogicalTypeFamily.NUMERIC. This method should not be called with other classes.Note to implementers: Whenever we add a new class here, make sure to also update the planner for supporting the class via
CallContext.getArgumentValue(int, Class). -
getOutputDataType
Description copied from interface:ResolvedExpressionReturns the data type of the computation result.- Specified by:
getOutputDataTypein interfaceResolvedExpression
-
getResolvedChildren
- Specified by:
getResolvedChildrenin interfaceResolvedExpression
-
asSummaryString
Description copied from interface:ExpressionReturns a string that summarizes this expression for printing to a console. An implementation might skip very specific properties.- Specified by:
asSummaryStringin interfaceExpression- Returns:
- summary string of this expression for debugging purposes
-
asSerializableString
Description copied from interface:ResolvedExpressionReturns a string that fully serializes this instance. The serialized string can be used for storing the query in, for example, aCatalogas a view.- Specified by:
asSerializableStringin interfaceResolvedExpression- Returns:
- detailed string for persisting in a catalog
-
getChildren
- Specified by:
getChildrenin interfaceExpression
-
accept
- Specified by:
acceptin interfaceExpression
-
equals
-
hashCode
public int hashCode() -
toString
-