public class UserDefinedFunctionUtils$ extends Object
Modifier and Type | Field and Description |
---|---|
static UserDefinedFunctionUtils$ |
MODULE$
Static reference to the singleton instance of this Scala object.
|
Constructor and Description |
---|
UserDefinedFunctionUtils$() |
Modifier and Type | Method and Description |
---|---|
Method[] |
checkAndExtractMethods(UserDefinedFunction function,
String methodName)
Extracts methods and throws a
ValidationException if no implementation
can be found, or implementation does not match the requirements. |
void |
checkForInstantiation(Class<?> clazz)
Checks if a user-defined function can be easily instantiated.
|
void |
checkNotSingleton(Class<?> clazz)
Check whether this is a Scala object.
|
org.apache.calcite.sql.SqlFunction |
createAggregateSqlFunction(String name,
AggregateFunction<?,?> aggFunction,
TypeInformation<?> typeInfo,
FlinkTypeFactory typeFactory)
Create
SqlFunction for an AggregateFunction |
LogicalTableFunctionCall |
createLogicalFunctionCall(TableEnvironment tableEnv,
String udtf)
Creates a
LogicalTableFunctionCall by parsing a String expression. |
org.apache.calcite.sql.SqlFunction |
createScalarSqlFunction(String name,
ScalarFunction function,
FlinkTypeFactory typeFactory)
Create
SqlFunction for a ScalarFunction |
scala.collection.Seq<org.apache.calcite.sql.SqlFunction> |
createTableSqlFunctions(String name,
TableFunction<?> tableFunction,
TypeInformation<?> resultType,
FlinkTypeFactory typeFactory)
Create
SqlFunction s for a TableFunction 's every eval method |
UserDefinedFunction |
deserialize(String data) |
scala.Option<Class<?>[]> |
getAccumulateMethodSignature(AggregateFunction<?,?> function,
scala.collection.Seq<TypeInformation<?>> signature)
Returns signatures of accumulate methods matching the given signature of
TypeInformation . |
scala.Option<Class<?>[]> |
getEvalMethodSignature(UserDefinedFunction function,
scala.collection.Seq<TypeInformation<?>> signature)
Returns signatures of eval methods matching the given signature of
TypeInformation . |
scala.Tuple3<String[],int[],TypeInformation<?>[]> |
getFieldInfo(TypeInformation<?> inputType)
Returns field names and field positions for a given
TypeInformation . |
Class<?>[][] |
getMethodSignatures(UserDefinedFunction function,
String methodName) |
scala.collection.Seq<TypeInformation<?>> |
getOperandTypeInfo(org.apache.calcite.sql.SqlCallBinding callBinding) |
TypeInformation<?>[] |
getParameterTypes(UserDefinedFunction function,
Class<?>[] signature) |
Class<?> |
getResultTypeClassOfScalarFunction(ScalarFunction function,
Class<?>[] signature)
Returns the return type of the evaluation method matching the given signature.
|
TypeInformation<?> |
getResultTypeOfAggregateFunction(AggregateFunction<?,?> aggregateFunction,
TypeInformation<?> extractedType)
Internal method of AggregateFunction#getResultType() that does some pre-checking and uses
TypeExtractor as default return type inference. |
TypeInformation<?> |
getResultTypeOfScalarFunction(ScalarFunction function,
Class<?>[] signature)
Internal method of
ScalarFunction#getResultType() that does some pre-checking and uses
TypeExtractor as default return type inference. |
scala.Option<Method> |
getUserDefinedMethod(UserDefinedFunction function,
String methodName,
Class<?>[] methodSignature)
Returns user defined method matching the given name and signature.
|
boolean |
ifMethodExistInFunction(String method,
UserDefinedFunction function)
Check if a given method exists in the given function
|
String |
serialize(UserDefinedFunction function) |
String |
signaturesToString(UserDefinedFunction function,
String name)
Prints all signatures of methods with given name in a class.
|
String |
signatureToString(Class<?>[] signature)
Prints one signature consisting of classes.
|
String |
signatureToString(scala.collection.Seq<TypeInformation<?>> signature)
Prints one signature consisting of TypeInformation.
|
Class<?>[] |
typeInfoToClass(scala.collection.Seq<TypeInformation<?>> typeInfos)
Extracts type classes of
TypeInformation in a null-aware way. |
public static final UserDefinedFunctionUtils$ MODULE$
public void checkForInstantiation(Class<?> clazz)
clazz
- (undocumented)public void checkNotSingleton(Class<?> clazz)
TableFunction
implemented
by a Scala object, since concurrent risks.clazz
- (undocumented)public scala.Option<Class<?>[]> getEvalMethodSignature(UserDefinedFunction function, scala.collection.Seq<TypeInformation<?>> signature)
TypeInformation
.
Elements of the signature can be null (act as a wildcard).function
- (undocumented)signature
- (undocumented)public scala.Option<Class<?>[]> getAccumulateMethodSignature(AggregateFunction<?,?> function, scala.collection.Seq<TypeInformation<?>> signature)
TypeInformation
.
Elements of the signature can be null (act as a wildcard).function
- (undocumented)signature
- (undocumented)public TypeInformation<?>[] getParameterTypes(UserDefinedFunction function, Class<?>[] signature)
public scala.Option<Method> getUserDefinedMethod(UserDefinedFunction function, String methodName, Class<?>[] methodSignature)
function
- function instancemethodName
- method namemethodSignature
- an array of raw Java classes. We compare the raw Java classes not the
TypeInformation. TypeInformation does not matter during runtime (e.g.
within a MapFunction)public boolean ifMethodExistInFunction(String method, UserDefinedFunction function)
method
- (undocumented)function
- (undocumented)public Method[] checkAndExtractMethods(UserDefinedFunction function, String methodName)
ValidationException
if no implementation
can be found, or implementation does not match the requirements.function
- (undocumented)methodName
- (undocumented)public Class<?>[][] getMethodSignatures(UserDefinedFunction function, String methodName)
public org.apache.calcite.sql.SqlFunction createScalarSqlFunction(String name, ScalarFunction function, FlinkTypeFactory typeFactory)
SqlFunction
for a ScalarFunction
name
- function namefunction
- scalar functiontypeFactory
- type factorypublic scala.collection.Seq<org.apache.calcite.sql.SqlFunction> createTableSqlFunctions(String name, TableFunction<?> tableFunction, TypeInformation<?> resultType, FlinkTypeFactory typeFactory)
SqlFunction
s for a TableFunction
's every eval method
name
- function nametableFunction
- table functionresultType
- the type information of returned tabletypeFactory
- type factorypublic org.apache.calcite.sql.SqlFunction createAggregateSqlFunction(String name, AggregateFunction<?,?> aggFunction, TypeInformation<?> typeInfo, FlinkTypeFactory typeFactory)
SqlFunction
for an AggregateFunction
name
- function nameaggFunction
- aggregate functiontypeFactory
- type factorytypeInfo
- (undocumented)public TypeInformation<?> getResultTypeOfAggregateFunction(AggregateFunction<?,?> aggregateFunction, TypeInformation<?> extractedType)
TypeExtractor
as default return type inference.aggregateFunction
- (undocumented)extractedType
- (undocumented)public TypeInformation<?> getResultTypeOfScalarFunction(ScalarFunction function, Class<?>[] signature)
ScalarFunction#getResultType()
that does some pre-checking and uses
TypeExtractor
as default return type inference.function
- (undocumented)signature
- (undocumented)public Class<?> getResultTypeClassOfScalarFunction(ScalarFunction function, Class<?>[] signature)
function
- (undocumented)signature
- (undocumented)public scala.Tuple3<String[],int[],TypeInformation<?>[]> getFieldInfo(TypeInformation<?> inputType)
TypeInformation
.
Field names are automatically extracted for
CompositeType
.
inputType
- The TypeInformation to extract the field names and positions from.public String signatureToString(Class<?>[] signature)
signature
- (undocumented)public String signatureToString(scala.collection.Seq<TypeInformation<?>> signature)
signature
- (undocumented)public String signaturesToString(UserDefinedFunction function, String name)
function
- (undocumented)name
- (undocumented)public Class<?>[] typeInfoToClass(scala.collection.Seq<TypeInformation<?>> typeInfos)
TypeInformation
in a null-aware way.typeInfos
- (undocumented)public String serialize(UserDefinedFunction function) throws Exception
Exception
public UserDefinedFunction deserialize(String data) throws Exception
Exception
public LogicalTableFunctionCall createLogicalFunctionCall(TableEnvironment tableEnv, String udtf)
LogicalTableFunctionCall
by parsing a String expression.
tableEnv
- The table environmenent to lookup the function.udtf
- a String expression of a TableFunctionCall, such as "split(c)"public scala.collection.Seq<TypeInformation<?>> getOperandTypeInfo(org.apache.calcite.sql.SqlCallBinding callBinding)
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.