Class UnknownCallContext
- All Implemented Interfaces:
CallContext
CallContext with unknown data types.-
Constructor Summary
ConstructorsConstructorDescriptionUnknownCallContext(DataTypeFactory typeFactory, String name, FunctionDefinition functionDefinition, int argumentCount, boolean isGroupedAggregation) -
Method Summary
Modifier and TypeMethodDescriptionReturns a resolved list of the call's argument types.<T> Optional<T>getArgumentValue(int pos, Class<T> clazz) Returns the literal value of the argument at the given position, given that the argument is a literal, is not null, and can be expressed as an instance of the provided class.Enables to lookup types in a catalog and resolve RAW types.Returns the function definition that defines the function currently being called.getName()Returns the function's name usually referencing the function in a catalog.Returns the inferred output data type of the function call.booleanisArgumentLiteral(int pos) Returns whether the argument at the given position is a value literal.booleanisArgumentNull(int pos) Returnstrueif the argument at the given position is a literal andnull,falseotherwise.booleanReturns whether the function call happens as part of an aggregation that defines grouping columns.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.table.types.inference.CallContext
fail, getTableSemantics, newValidationError
-
Constructor Details
-
UnknownCallContext
public UnknownCallContext(DataTypeFactory typeFactory, String name, FunctionDefinition functionDefinition, int argumentCount, boolean isGroupedAggregation)
-
-
Method Details
-
getDataTypeFactory
Description copied from interface:CallContextEnables to lookup types in a catalog and resolve RAW types.- Specified by:
getDataTypeFactoryin interfaceCallContext
-
getFunctionDefinition
Description copied from interface:CallContextReturns the function definition that defines the function currently being called.- Specified by:
getFunctionDefinitionin interfaceCallContext
-
isArgumentLiteral
public boolean isArgumentLiteral(int pos) Description copied from interface:CallContextReturns whether the argument at the given position is a value literal.- Specified by:
isArgumentLiteralin interfaceCallContext
-
isArgumentNull
public boolean isArgumentNull(int pos) Description copied from interface:CallContextReturnstrueif the argument at the given position is a literal andnull,falseotherwise. If the argument is declared as optional and has no value, true is returned.Use
CallContext.isArgumentLiteral(int)before to check if the argument is actually a literal.- Specified by:
isArgumentNullin interfaceCallContext
-
getArgumentValue
Description copied from interface:CallContextReturns the literal value of the argument at the given position, given that the argument is a literal, is not null, and can be expressed as an instance of the provided class.It supports conversions to default conversion classes of
LogicalTypes. This method should not be called with other classes.Use
CallContext.isArgumentLiteral(int)before to check if the argument is actually a literal.- Specified by:
getArgumentValuein interfaceCallContext
-
getName
Description copied from interface:CallContextReturns the function's name usually referencing the function in a catalog.Note: The name is meant for debugging purposes only.
- Specified by:
getNamein interfaceCallContext
-
getArgumentDataTypes
Description copied from interface:CallContextReturns a resolved list of the call's argument types. It also includes a type for every argument in a vararg function call.- Specified by:
getArgumentDataTypesin interfaceCallContext
-
getOutputDataType
Description copied from interface:CallContextReturns the inferred output data type of the function call.It does this by inferring the input argument data type using
ArgumentTypeStrategy.inferArgumentType(CallContext, int, boolean)of a wrapping call (if available) where this function call is an argument. For example,takes_string(this_function(NULL))would lead to aDataTypes.STRING()because the wrapping call expects a string argument.- Specified by:
getOutputDataTypein interfaceCallContext
-
isGroupedAggregation
public boolean isGroupedAggregation()Description copied from interface:CallContextReturns whether the function call happens as part of an aggregation that defines grouping columns.E.g.
SELECT COUNT(*) FROM tis not a grouped aggregation butSELECT COUNT(*) FROM t GROUP BY kis.- Specified by:
isGroupedAggregationin interfaceCallContext
-