public abstract static class TextIO.Read extends PTransform<PBegin,PCollection<java.lang.String>>
TextIO.read()
.name
Constructor and Description |
---|
Read() |
Modifier and Type | Method and Description |
---|---|
PCollection<java.lang.String> |
expand(PBegin input)
Override this method to specify how this
PTransform should be expanded
on the given InputT . |
TextIO.Read |
from(java.lang.String filepattern)
Reads text files that reads from the file(s) with the given filename or filename pattern.
|
TextIO.Read |
from(ValueProvider<java.lang.String> filepattern)
Same as
from(filepattern) , but accepting a ValueProvider . |
protected Coder<java.lang.String> |
getDefaultOutputCoder()
Returns the default
Coder to use for the output of this
single-output PTransform . |
protected FileBasedSource<java.lang.String> |
getSource() |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
TextIO.Read |
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.
|
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toString, validate
public TextIO.Read from(java.lang.String filepattern)
This can be a local path (if running locally), or a Google Cloud Storage filename or
filename pattern of the form "gs://<bucket>/<filepath>"
(if running locally or using
remote execution service).
Standard Java Filesystem glob patterns ("*", "?", "[..]") are supported.
public TextIO.Read from(ValueProvider<java.lang.String> filepattern)
from(filepattern)
, but accepting a ValueProvider
.public TextIO.Read withCompressionType(TextIO.CompressionType compressionType)
If no compression type is specified, the default is TextIO.CompressionType.AUTO
.
public PCollection<java.lang.String> expand(PBegin 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).
expand
in class PTransform<PBegin,PCollection<java.lang.String>>
protected FileBasedSource<java.lang.String> getSource()
public void populateDisplayData(DisplayData.Builder builder)
PTransform
populateDisplayData(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 HasDisplayData
populateDisplayData
in class PTransform<PBegin,PCollection<java.lang.String>>
builder
- The builder to populate with display data.HasDisplayData
protected Coder<java.lang.String> getDefaultOutputCoder()
PTransform
Coder
to use for the output of this
single-output PTransform
.
By default, always throws
getDefaultOutputCoder
in class PTransform<PBegin,PCollection<java.lang.String>>