Class PythonMap<InputT,OutputT>
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<? extends InputT>,PCollection<OutputT>>
org.apache.beam.sdk.extensions.python.transforms.PythonMap<InputT,OutputT>
- All Implemented Interfaces:
Serializable
,HasDisplayData
public class PythonMap<InputT,OutputT>
extends PTransform<PCollection<? extends InputT>,PCollection<OutputT>>
Wrapper for invoking external Python
Map
transforms..- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Method Summary
Modifier and TypeMethodDescriptionexpand
(PCollection<? extends InputT> input) Override this method to specify how thisPTransform
should be expanded on the givenInputT
.static <InputT,
OutputT>
PythonMap<InputT, OutputT> viaFlatMapFn
(String pythonFunction, Coder<?> outputCoder) static <InputT,
OutputT>
PythonMap<InputT, OutputT> withExpansionService
(String expansionService) withExtraPackages
(List<String> extraPackages) Specifies any extra packages required by the Python function.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Method Details
-
viaMapFn
-
viaFlatMapFn
-
withExpansionService
-
withExtraPackages
Specifies any extra packages required by the Python function.This should only be specified when using the default expansion service, i.e. when not using
withExpansionService(String)
to provide an expansion service.The package can either be a PyPi package or the path to a locally available Python package.
- Parameters:
extraPackages
- a list of PyPi packages. May include the version.- Returns:
- A
PythonMap
with extra packages.
-
expand
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
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).
- Specified by:
expand
in classPTransform<PCollection<? extends InputT>,
PCollection<OutputT>>
-