public class PythonExternalTransform<InputT extends PInput,OutputT extends POutput> extends PTransform<InputT,OutputT>
name, resourceHints
Modifier and Type | Method and Description |
---|---|
OutputT |
expand(InputT input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
static <InputT extends PInput,OutputT extends POutput> |
from(java.lang.String tranformName)
Instantiates a cross-language wrapper for a Python transform with a given transform name.
|
static <InputT extends PInput,OutputT extends POutput> |
from(java.lang.String tranformName,
java.lang.String expansionService)
Instantiates a cross-language wrapper for a Python transform with a given transform name.
|
PythonExternalTransform<InputT,OutputT> |
withArgs(java.lang.Object... args)
Positional arguments for the Python cross-language transform.
|
PythonExternalTransform<InputT,OutputT> |
withKwarg(java.lang.String name,
java.lang.Object value)
Specifies a single keyword argument for the Python cross-language transform.
|
PythonExternalTransform<InputT,OutputT> |
withKwargs(java.util.Map<java.lang.String,java.lang.Object> kwargs)
Specifies keyword arguments for the Python cross-language transform.
|
PythonExternalTransform<InputT,OutputT> |
withKwargs(Row kwargs)
Specifies keyword arguments as a Row objects.
|
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate
public static <InputT extends PInput,OutputT extends POutput> PythonExternalTransform<InputT,OutputT> from(java.lang.String tranformName)
InputT
- Input PCollection
typeOutputT
- Output PCollection
typetranformName
- fully qualified transform name.PythonExternalTransform
for the given transform name.public static <InputT extends PInput,OutputT extends POutput> PythonExternalTransform<InputT,OutputT> from(java.lang.String tranformName, java.lang.String expansionService)
InputT
- Input PCollection
typeOutputT
- Output PCollection
typetranformName
- fully qualified transform name.expansionService
- address and port number for externally launched expansion servicePythonExternalTransform
for the given transform name.public PythonExternalTransform<InputT,OutputT> withArgs(java.lang.Object... args)
args
- list of arguments.public PythonExternalTransform<InputT,OutputT> withKwarg(java.lang.String name, java.lang.Object value)
name
- argument name.value
- argument valuepublic PythonExternalTransform<InputT,OutputT> withKwargs(java.util.Map<java.lang.String,java.lang.Object> kwargs)
public PythonExternalTransform<InputT,OutputT> withKwargs(Row kwargs)
kwargs
- keyword arguments as a Row
objects. An empty Row represents zero keyword
arguments.public OutputT expand(InputT input)
PTransform
PTransform
should be expanded on the given
InputT
.
NOTE: This method should not be called directly. Instead apply the PTransform
should
be applied to the InputT
using the apply
method.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).