T - the type of each of the elements of the resulting
PCollection. By default, each line is returned as a String, however you
may use withCoder(Coder) to supply a Coder<T> to produce a
PCollection<T> instead.public static class TextIO.Read.Bound<T> extends PTransform<PInput,PCollection<T>>
PTransform that reads from one or more text files and returns a bounded
PCollection containing one element for each line of the input files.name| Modifier and Type | Method and Description |
|---|---|
PCollection<T> |
apply(PInput input)
Applies this
PTransform on the given InputT, and returns its
Output. |
TextIO.Read.Bound<T> |
from(String filepattern)
Returns a new transform for reading from text files that's like this one but
that reads from the file(s) with the given name or pattern.
|
TextIO.CompressionType |
getCompressionType() |
protected Coder<T> |
getDefaultOutputCoder()
Returns the default
Coder to use for the output of this
single-output PTransform. |
String |
getFilepattern() |
boolean |
needsValidation() |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
<X> TextIO.Read.Bound<X> |
withCoder(Coder<X> coder)
Returns a new transform for reading from text files that's like this one but
that uses the given
Coder to decode each of the
lines of the file into a value of type X. |
TextIO.Read.Bound<T> |
withCompressionType(TextIO.CompressionType compressionType)
Returns a new transform for reading from text files that's like this one but
reads from input sources using the specified compression type.
|
TextIO.Read.Bound<T> |
withoutValidation()
Returns a new transform for reading from text files that's like this one but
that has GCS path validation on pipeline creation disabled.
|
getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validatepublic TextIO.Read.Bound<T> from(String filepattern)
TextIO.Read.from(java.lang.String)
for a description of filepatterns.
Does not modify this object.
public <X> TextIO.Read.Bound<X> withCoder(Coder<X> coder)
Coder to decode each of the
lines of the file into a value of type X.
Does not modify this object.
X - the type of the decoded elements, and the
elements of the resulting PCollectionpublic TextIO.Read.Bound<T> withoutValidation()
This can be useful in the case where the GCS input does not exist at the pipeline creation time, but is expected to be available at execution time.
Does not modify this object.
public TextIO.Read.Bound<T> withCompressionType(TextIO.CompressionType compressionType)
If no compression type is specified, the default is TextIO.CompressionType.AUTO.
See TextIO.Read.withCompressionType(org.apache.beam.sdk.io.TextIO.CompressionType) for more details.
Does not modify this object.
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).
apply in class PTransform<PInput,PCollection<T>>public void populateDisplayData(DisplayData.Builder builder)
PTransformpopulateDisplayData(DisplayData.Builder) is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData). Implementations may call
super.populateDisplayData(builder) in order to register display data in the current
namespace, but should otherwise use subcomponent.populateDisplayData(builder) to use
the namespace of the subcomponent.
By default, does not register any display data. Implementors may override this method to provide their own display data.
populateDisplayData in interface HasDisplayDatapopulateDisplayData in class PTransform<PInput,PCollection<T>>builder - The builder to populate with display data.HasDisplayDataprotected 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 boolean needsValidation()
public TextIO.CompressionType getCompressionType()