FT
- Type of the user function@Internal public abstract class AbstractUdfOperator<OUT,FT extends Function> extends Operator<OUT>
Modifier and Type | Field and Description |
---|---|
protected Map<String,Operator<?>> |
broadcastInputs
The extra inputs which parameterize the user function.
|
protected UserCodeWrapper<FT> |
userFunction
The object or class containing the user function.
|
compilerHints, name, operatorInfo, parameters
Modifier | Constructor and Description |
---|---|
protected |
AbstractUdfOperator(UserCodeWrapper<FT> function,
OperatorInformation<OUT> operatorInfo,
String name)
Creates a new abstract operator with the given name wrapping the given user function.
|
Modifier and Type | Method and Description |
---|---|
protected static <U> Class<U>[] |
asArray(Class<U> clazz)
Generic utility function that wraps a single class object into an array of that class type.
|
protected static <U> Class<U>[] |
emptyClassArray()
Generic utility function that returns an empty class array.
|
Map<String,Operator<?>> |
getBroadcastInputs()
Returns the input, or null, if none is set.
|
abstract int[] |
getKeyColumns(int inputNum)
Gets the column numbers of the key fields in the input records for the given input.
|
abstract int |
getNumberOfInputs()
Gets the number of inputs for this operator.
|
UserCodeWrapper<FT> |
getUserCodeWrapper()
Gets the function that is held by this operator.
|
void |
setBroadcastVariable(String name,
Operator<?> root)
Binds the result produced by a plan rooted at
root to a variable
used by the UDF wrapped in this operator. |
<T> void |
setBroadcastVariables(Map<String,Operator<T>> inputs)
Clears all previous broadcast inputs and binds the given inputs as
broadcast variables of this operator.
|
createUnionCascade, createUnionCascade, createUnionCascade, getCompilerHints, getMinResources, getName, getOperatorInfo, getParallelism, getParameters, getPreferredResources, setName, setParallelism, setParameter, setParameter, setParameter, setResources, toString
protected final UserCodeWrapper<FT extends Function> userFunction
protected AbstractUdfOperator(UserCodeWrapper<FT> function, OperatorInformation<OUT> operatorInfo, String name)
function
- The wrapper object containing the user function.name
- The given name for the operator, used in plans, logs and progress messages.public UserCodeWrapper<FT> getUserCodeWrapper()
getUserCodeWrapper
in class Operator<OUT>
Operator.getUserCodeWrapper()
public Map<String,Operator<?>> getBroadcastInputs()
public void setBroadcastVariable(String name, Operator<?> root)
root
to a variable
used by the UDF wrapped in this operator.root
- The root of the plan producing this input.public <T> void setBroadcastVariables(Map<String,Operator<T>> inputs)
inputs
- The pairs to be set as broadcast inputs.public abstract int getNumberOfInputs()
public abstract int[] getKeyColumns(int inputNum)
protected static <U> Class<U>[] asArray(Class<U> clazz)
U
- The type of the classes.clazz
- The class object to be wrapped.protected static <U> Class<U>[] emptyClassArray()
U
- The type of the classes.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.