Class CallExpression
- java.lang.Object
-
- org.apache.flink.table.expressions.CallExpression
-
- All Implemented Interfaces:
Expression
,ResolvedExpression
@PublicEvolving public final class CallExpression extends Object implements ResolvedExpression
Resolved and validated call expression for calling a function.A call contains:
- an output type
- a
FunctionDefinition
that identifies the function to be called - an optional
ObjectIdentifier
that tracks the origin of a function - whether the called function is temporary
-
-
Constructor Summary
Constructors Constructor Description CallExpression(boolean isTemporary, FunctionIdentifier functionIdentifier, FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
CallExpression(FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
Deprecated.Useanonymous(FunctionDefinition, List, DataType)
instead.CallExpression(FunctionIdentifier functionIdentifier, FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
accept(ExpressionVisitor<R> visitor)
static CallExpression
anonymous(FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
Creates aCallExpression
to an anonymous function that has been declared inline without aFunctionIdentifier
.String
asSerializableString()
Returns a string that fully serializes this instance.String
asSummaryString()
Returns a string that summarizes this expression for printing to a console.boolean
equals(Object o)
List<Expression>
getChildren()
FunctionDefinition
getFunctionDefinition()
Optional<FunctionIdentifier>
getFunctionIdentifier()
String
getFunctionName()
Returns a string representation of the call's function for logging or printing to a console.DataType
getOutputDataType()
Returns the data type of the computation result.List<ResolvedExpression>
getResolvedChildren()
int
hashCode()
boolean
isTemporary()
static CallExpression
permanent(BuiltInFunctionDefinition builtInFunctionDefinition, List<ResolvedExpression> args, DataType dataType)
Creates aCallExpression
to a resolved built-in function.static CallExpression
permanent(FunctionIdentifier functionIdentifier, FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
CallExpression
replaceArgs(List<ResolvedExpression> args, DataType dataType)
static CallExpression
temporary(FunctionIdentifier functionIdentifier, FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
Creates aCallExpression
to a temporary function (potentially shadowing aCatalog
function or providing a system function).String
toString()
-
-
-
Constructor Detail
-
CallExpression
@Internal public CallExpression(boolean isTemporary, @Nullable FunctionIdentifier functionIdentifier, FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
-
CallExpression
@Deprecated public CallExpression(FunctionIdentifier functionIdentifier, FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
-
CallExpression
@Deprecated public CallExpression(FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
Deprecated.Useanonymous(FunctionDefinition, List, DataType)
instead.
-
-
Method Detail
-
permanent
public static CallExpression permanent(FunctionIdentifier functionIdentifier, FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
-
permanent
@Internal public static CallExpression permanent(BuiltInFunctionDefinition builtInFunctionDefinition, List<ResolvedExpression> args, DataType dataType)
Creates aCallExpression
to a resolved built-in function. It assumes that theBuiltInFunctionDefinition
instance is provided by the framework (usually the core module).
-
temporary
public static CallExpression temporary(FunctionIdentifier functionIdentifier, FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
Creates aCallExpression
to a temporary function (potentially shadowing aCatalog
function or providing a system function).
-
anonymous
public static CallExpression anonymous(FunctionDefinition functionDefinition, List<ResolvedExpression> args, DataType dataType)
Creates aCallExpression
to an anonymous function that has been declared inline without aFunctionIdentifier
.
-
isTemporary
public boolean isTemporary()
-
getFunctionIdentifier
public Optional<FunctionIdentifier> getFunctionIdentifier()
-
getFunctionDefinition
public FunctionDefinition getFunctionDefinition()
-
getFunctionName
public String getFunctionName()
Returns a string representation of the call's function for logging or printing to a console.
-
replaceArgs
public CallExpression replaceArgs(List<ResolvedExpression> args, DataType dataType)
-
getOutputDataType
public DataType getOutputDataType()
Description copied from interface:ResolvedExpression
Returns the data type of the computation result.- Specified by:
getOutputDataType
in interfaceResolvedExpression
-
getResolvedChildren
public List<ResolvedExpression> getResolvedChildren()
- Specified by:
getResolvedChildren
in interfaceResolvedExpression
-
asSummaryString
public String asSummaryString()
Description copied from interface:Expression
Returns a string that summarizes this expression for printing to a console. An implementation might skip very specific properties.- Specified by:
asSummaryString
in interfaceExpression
- Returns:
- summary string of this expression for debugging purposes
-
asSerializableString
public String asSerializableString()
Description copied from interface:ResolvedExpression
Returns a string that fully serializes this instance. The serialized string can be used for storing the query in, for example, aCatalog
as a view.- Specified by:
asSerializableString
in interfaceResolvedExpression
- Returns:
- detailed string for persisting in a catalog
-
getChildren
public List<Expression> getChildren()
- Specified by:
getChildren
in interfaceExpression
-
accept
public <R> R accept(ExpressionVisitor<R> visitor)
- Specified by:
accept
in interfaceExpression
-
-