Package org.apache.beam.sdk.io.csv
Class CsvIO.Write<T>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.io.WriteFilesResult<java.lang.String>>
-
- org.apache.beam.sdk.io.csv.CsvIO.Write<T>
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- CsvIO
public abstract static class CsvIO.Write<T> extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.io.WriteFilesResult<java.lang.String>> implements org.apache.beam.sdk.transforms.display.HasDisplayDataPTransformfor writing CSV files.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Write()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.beam.sdk.io.WriteFilesResult<java.lang.String>expand(org.apache.beam.sdk.values.PCollection<T> input)voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)CsvIO.Write<T>withCompression(org.apache.beam.sdk.io.Compression compression)Specifies theCompressionof all generated shard files.CsvIO.Write<T>withMaxNumWritersPerBundle(@Nullable java.lang.Integer maxNumWritersPerBundle)Set the maximum number of writers created in a bundle before spilling to shuffle.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 givenShardNameTemplatefor naming output files.CsvIO.Write<T>withSuffix(java.lang.String suffix)Configures the filename suffix for written files.CsvIO.Write<T>withTempDirectory(org.apache.beam.sdk.io.fs.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(org.apache.beam.sdk.io.FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)Returns a transform for writing to text files like this one but that has the givenFileBasedSink.WritableByteChannelFactoryto be used by theFileBasedSinkduring output.-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
populateDisplayData
public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
- Specified by:
populateDisplayDatain interfaceorg.apache.beam.sdk.transforms.display.HasDisplayData- Overrides:
populateDisplayDatain classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.io.WriteFilesResult<java.lang.String>>
-
withCompression
public CsvIO.Write<T> withCompression(org.apache.beam.sdk.io.Compression compression)
Specifies theCompressionof all generated shard files.
-
withNoSpilling
public CsvIO.Write<T> withNoSpilling()
Whether to skip the spilling of data. SeeWriteFiles.withNoSpilling().
-
withMaxNumWritersPerBundle
public CsvIO.Write<T> withMaxNumWritersPerBundle(@Nullable java.lang.Integer maxNumWritersPerBundle)
Set the maximum number of writers created in a bundle before spilling to shuffle. SeeWriteFiles#withMaxNumWritersPerBundle().
-
withNumShards
public CsvIO.Write<T> withNumShards(java.lang.Integer numShards)
Specifies to use a given fixed number of shards per window. SeeTextIO.Write.withNumShards(int).
-
withoutSharding
public CsvIO.Write<T> withoutSharding()
Forces a single file as output and empty shard name template. SeeTextIO.Write.withoutSharding().
-
withShardTemplate
public CsvIO.Write<T> withShardTemplate(java.lang.String shardTemplate)
Uses the givenShardNameTemplatefor naming output files. SeeTextIO.Write.withShardNameTemplate(java.lang.String).
-
withSuffix
public CsvIO.Write<T> withSuffix(java.lang.String suffix)
Configures the filename suffix for written files. SeeTextIO.Write.withSuffix(java.lang.String).
-
withTempDirectory
public CsvIO.Write<T> withTempDirectory(org.apache.beam.sdk.io.fs.ResourceId tempDirectory)
Set the base directory used to generate temporary files. SeeTextIO.Write.withTempDirectory(org.apache.beam.sdk.options.ValueProvider<org.apache.beam.sdk.io.fs.ResourceId>).
-
withWindowedWrites
public CsvIO.Write<T> withWindowedWrites()
Preserves windowing of input elements and writes them to files based on the element's window. SeeTextIO.Write.withWindowedWrites().
-
withWritableByteChannelFactory
public CsvIO.Write<T> withWritableByteChannelFactory(org.apache.beam.sdk.io.FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
Returns a transform for writing to text files like this one but that has the givenFileBasedSink.WritableByteChannelFactoryto be used by theFileBasedSinkduring output. SeeTextIO.Write.withWritableByteChannelFactory(org.apache.beam.sdk.io.FileBasedSink.WritableByteChannelFactory).
-
expand
public org.apache.beam.sdk.io.WriteFilesResult<java.lang.String> expand(org.apache.beam.sdk.values.PCollection<T> input)
- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.io.WriteFilesResult<java.lang.String>>
-
-