PTransform

PTransform<PInput, POutput> is an abstraction of transformations (operations or simply functions) with PInput input and POutput output.

PTransform: PInput => POutput

Creating Instance

PTransform takes an optional name to be created.

PTransform is an abstract class and cannot be created directly. It is created indirectly for the concrete PTransforms.

Contract

expand Method

OutputT expand(
  InputT input)

Used when Pipeline is requested to applyInternal and applyReplacement.

Subset of Available PTransforms

Table 1. PTransforms (Direct Implementations and Extensions Only)
PTransform Description

GroupByKey

MapElements

ParDo.SingleOutput

others

Root PTransform

Root PTransform (Source PTransform) is a PTransform that takes no input (conventionally marked as PBegin input type) and produces a PCollection (of values of type T).

PTransform<PBegin, PCollection<T>>

Examples of root PTransforms: AvroIO.Read, TextIO.Read, Create, KafkaIO.Read.

Output PTransform

Output PTransform (Sink PTransform) is a PTransform that has no output (conventionally marked as PDone output type).

PTransform<PCollection<T>, PDone>

Examples of output PTransforms: AvroIO.Write, TextIO.Write, KafkaIO.Write.