Class OperatorBindingCallContext
- java.lang.Object
-
- org.apache.flink.table.planner.functions.inference.AbstractSqlCallContext
-
- org.apache.flink.table.planner.functions.inference.OperatorBindingCallContext
-
- All Implemented Interfaces:
CallContext
@Internal public final class OperatorBindingCallContext extends AbstractSqlCallContext
ACallContext
backed bySqlOperatorBinding
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.table.planner.functions.inference.AbstractSqlCallContext
AbstractSqlCallContext.LiteralValueAccessor
-
-
Constructor Summary
Constructors Constructor Description OperatorBindingCallContext(DataTypeFactory dataTypeFactory, FunctionDefinition definition, org.apache.calcite.sql.SqlOperatorBinding binding, org.apache.calcite.rel.type.RelDataType returnRelDataType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DataType>
getArgumentDataTypes()
Returns 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.Optional<DataType>
getOutputDataType()
Returns the inferred output data type of the function call.boolean
isArgumentLiteral(int pos)
Returns whether the argument at the given position is a value literal.boolean
isArgumentNull(int pos)
Returnstrue
if the argument at the given position is a literal andnull
,false
otherwise.-
Methods inherited from class org.apache.flink.table.planner.functions.inference.AbstractSqlCallContext
getDataTypeFactory, getFunctionDefinition, getLiteralValueAs, getName, isGroupedAggregation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.types.inference.CallContext
fail, newValidationError
-
-
-
-
Constructor Detail
-
OperatorBindingCallContext
public OperatorBindingCallContext(DataTypeFactory dataTypeFactory, FunctionDefinition definition, org.apache.calcite.sql.SqlOperatorBinding binding, org.apache.calcite.rel.type.RelDataType returnRelDataType)
-
-
Method Detail
-
isArgumentLiteral
public boolean isArgumentLiteral(int pos)
Description copied from interface:CallContext
Returns whether the argument at the given position is a value literal.
-
isArgumentNull
public boolean isArgumentNull(int pos)
Description copied from interface:CallContext
Returnstrue
if the argument at the given position is a literal andnull
,false
otherwise.Use
CallContext.isArgumentLiteral(int)
before to check if the argument is actually a literal.
-
getArgumentValue
public <T> Optional<T> getArgumentValue(int pos, Class<T> clazz)
Description copied from interface:CallContext
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.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.
-
getArgumentDataTypes
public List<DataType> getArgumentDataTypes()
Description copied from interface:CallContext
Returns a resolved list of the call's argument types. It also includes a type for every argument in a vararg function call.
-
getOutputDataType
public Optional<DataType> getOutputDataType()
Description copied from interface:CallContext
Returns 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.
-
-