public abstract static class CsvIO.Write<T> extends PTransform<PCollection<T>,WriteFilesResult<java.lang.String>> implements HasDisplayData
PTransform
for writing CSV files.annotations, displayData, name, resourceHints
Constructor and Description |
---|
Write() |
Modifier and Type | Method and Description |
---|---|
WriteFilesResult<java.lang.String> |
expand(PCollection<T> input)
Override this method to specify how this
PTransform should be expanded on the given
InputT . |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
CsvIO.Write<T> |
withCompression(Compression compression)
Specifies the
Compression of all generated shard files. |
CsvIO.Write<T> |
withNoSpilling()
Whether to skip the spilling of data.
|
CsvIO.Write<T> |
withNumShards(java.lang.Integer numShards)
Specifies to use a given fixed number of shards per window.
|
CsvIO.Write<T> |
withoutSharding()
Forces a single file as output and empty shard name template.
|
CsvIO.Write<T> |
withShardTemplate(java.lang.String shardTemplate)
Uses the given
ShardNameTemplate for naming output files. |
CsvIO.Write<T> |
withSuffix(java.lang.String suffix)
Configures the filename suffix for written files.
|
CsvIO.Write<T> |
withTempDirectory(ResourceId tempDirectory)
Set the base directory used to generate temporary files.
|
CsvIO.Write<T> |
withWindowedWrites()
Preserves windowing of input elements and writes them to files based on the element's window.
|
CsvIO.Write<T> |
withWritableByteChannelFactory(FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
Returns a transform for writing to text files like this one but that has the given
FileBasedSink.WritableByteChannelFactory to be used by the FileBasedSink during
output. |
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, toString, validate, validate
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<PCollection<T>,WriteFilesResult<java.lang.String>>
builder
- The builder to populate with display data.HasDisplayData
public CsvIO.Write<T> withCompression(Compression compression)
Compression
of all generated shard files.public CsvIO.Write<T> withNoSpilling()
WriteFiles.withNoSpilling()
.public CsvIO.Write<T> withNumShards(java.lang.Integer numShards)
TextIO.Write#withNumShards
.public CsvIO.Write<T> withoutSharding()
TextIO.Write#withoutSharding
.public CsvIO.Write<T> withShardTemplate(java.lang.String shardTemplate)
ShardNameTemplate
for naming output files. See TextIO.Write#withShardNameTemplate
.public CsvIO.Write<T> withSuffix(java.lang.String suffix)
TextIO.Write#withSuffix
.public CsvIO.Write<T> withTempDirectory(ResourceId tempDirectory)
TextIO.Write#withTempDirectory
.public CsvIO.Write<T> withWindowedWrites()
TextIO.Write#withWindowedWrites
.public CsvIO.Write<T> withWritableByteChannelFactory(FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
FileBasedSink.WritableByteChannelFactory
to be used by the FileBasedSink
during
output. See TextIO.Write#withWritableByteChannelFactory
.public WriteFilesResult<java.lang.String> expand(PCollection<T> 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<PCollection<T>,WriteFilesResult<java.lang.String>>