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[] |
checkAndExtractEvalMethods(UserDefinedFunction function)
Extracts "eval" methods and throws a
ValidationException if no implementation
can be found. |
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 |
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 |
scala.Option<Method> |
getEvalMethod(UserDefinedFunction function,
scala.collection.Seq<TypeInformation<?>> signature)
Returns eval method matching the given signature of
TypeInformation . |
scala.Tuple3<String[],int[],TypeInformation<?>[]> |
getFieldInfo(TypeInformation<?> inputType)
Returns field names and field positions for a given
TypeInformation . |
TypeInformation<?> |
getResultType(ScalarFunction function,
Class<?>[] signature)
Internal method of
ScalarFunction#getResultType() that does some pre-checking and uses
TypeExtractor as default return type inference. |
Class<?> |
getResultTypeClass(ScalarFunction function,
Class<?>[] signature)
Returns the return type of the evaluation method matching the given signature.
|
scala.Option<Class<?>[]> |
getSignature(UserDefinedFunction function,
scala.collection.Seq<TypeInformation<?>> signature)
Returns signatures matching the given signature of
TypeInformation . |
Class<?>[][] |
getSignatures(UserDefinedFunction function) |
<T extends UserDefinedFunction> |
instantiate(Class<T> clazz)
Instantiates a user-defined function.
|
String |
signaturesToString(UserDefinedFunction function)
Prints all eval methods signatures of 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.
|
public static final UserDefinedFunctionUtils$ MODULE$
public <T extends UserDefinedFunction> T instantiate(Class<T> clazz)
public void checkForInstantiation(Class<?> clazz)
public void checkNotSingleton(Class<?> clazz)
TableFunction
implemented
by a Scala object, since concurrent risks.public scala.Option<Class<?>[]> getSignature(UserDefinedFunction function, scala.collection.Seq<TypeInformation<?>> signature)
TypeInformation
.
Elements of the signature can be null (act as a wildcard).public scala.Option<Method> getEvalMethod(UserDefinedFunction function, scala.collection.Seq<TypeInformation<?>> signature)
TypeInformation
.public Method[] checkAndExtractEvalMethods(UserDefinedFunction function)
ValidationException
if no implementation
can be found.public Class<?>[][] getSignatures(UserDefinedFunction function)
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 TypeInformation<?> getResultType(ScalarFunction function, Class<?>[] signature)
ScalarFunction#getResultType()
that does some pre-checking and uses
TypeExtractor
as default return type inference.public Class<?> getResultTypeClass(ScalarFunction function, Class<?>[] signature)
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)
public String signatureToString(scala.collection.Seq<TypeInformation<?>> signature)
public String signaturesToString(UserDefinedFunction function)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.