T - the type of each of the elements of the resulting
PCollectionpublic static class AvroIO.Read.Bound<T> extends PTransform<PInput,PCollection<T>>
PTransform that reads from an Avro file (or multiple Avro
files matching a pattern) and returns a bounded PCollection containing
the decoding of each record.name| Modifier and Type | Method and Description |
|---|---|
PCollection<T> |
apply(PInput input)
Applies this
PTransform on the given InputT, and returns its
Output. |
AvroIO.Read.Bound<T> |
from(String filepattern)
Returns a new AvroIO.Read PTransform that's like this one but
that reads from the file(s) with the given name or pattern.
|
protected Coder<T> |
getDefaultOutputCoder()
Returns the default
Coder to use for the output of this
single-output PTransform. |
String |
getFilepattern() |
org.apache.avro.Schema |
getSchema() |
AvroIO.Read.Bound<T> |
named(String name)
Returns a new AvroIO.Read PTransform that's like this one but
with the given step name.
|
boolean |
needsValidation() |
AvroIO.Read.Bound<T> |
withoutValidation()
Returns a new TextIO.Read PTransform that's like this one but
that has GCS input path validation on pipeline creation disabled.
|
<X> AvroIO.Read.Bound<X> |
withSchema(Class<X> type)
Returns a new AvroIO.Read PTransform that's like this one but
that reads Avro file(s) containing records whose type is the
specified Avro-generated class.
|
AvroIO.Read.Bound<org.apache.avro.generic.GenericRecord> |
withSchema(org.apache.avro.Schema schema)
Returns a new AvroIO.Read PTransform that's like this one but
that reads Avro file(s) containing records of the specified schema.
|
AvroIO.Read.Bound<org.apache.avro.generic.GenericRecord> |
withSchema(String schema)
Returns a new AvroIO.Read PTransform that's like this one but
that reads Avro file(s) containing records of the specified schema
in a JSON-encoded string form.
|
getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validatepublic AvroIO.Read.Bound<T> named(String name)
public AvroIO.Read.Bound<T> from(String filepattern)
AvroIO.Read.from(java.lang.String) for a description of
filepatterns.) Does not modify this object.public <X> AvroIO.Read.Bound<X> withSchema(Class<X> type)
X - the type of the decoded elements, and the elements of
the resulting PCollectionpublic AvroIO.Read.Bound<org.apache.avro.generic.GenericRecord> withSchema(org.apache.avro.Schema schema)
public AvroIO.Read.Bound<org.apache.avro.generic.GenericRecord> withSchema(String schema)
public AvroIO.Read.Bound<T> withoutValidation()
This can be useful in the case where the GCS input location does not exist at the pipeline creation time, but is expected to be available at execution time.
public PCollection<T> apply(PInput input)
PTransformPTransform on the given InputT, and returns its
Output.
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).
The default implementation throws an exception. A derived class must
either implement apply, or else each runner must supply a custom
implementation via
PipelineRunner.apply(com.google.cloud.dataflow.sdk.transforms.PTransform<InputT, OutputT>, InputT).
apply in class PTransform<PInput,PCollection<T>>protected Coder<T> getDefaultOutputCoder()
PTransformCoder to use for the output of this
single-output PTransform.
By default, always throws
getDefaultOutputCoder in class PTransform<PInput,PCollection<T>>public String getFilepattern()
public org.apache.avro.Schema getSchema()
public boolean needsValidation()