Class TextIO.Write
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<PCollection<java.lang.String>,PDone>
-
- org.apache.beam.sdk.io.TextIO.Write
-
- All Implemented Interfaces:
java.io.Serializable
,HasDisplayData
- Enclosing class:
- TextIO
public static class TextIO.Write extends PTransform<PCollection<java.lang.String>,PDone>
This class is used as the default return value ofTextIO.write()
.All methods in this class delegate to the appropriate method of
TextIO.TypedWrite
. This class exists for backwards compatibility, and will be removed in Beam 3.0.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
name, resourceHints
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PDone
expand(PCollection<java.lang.String> input)
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.void
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.TextIO.Write
to(java.lang.String filenamePrefix)
TextIO.Write
to(FileBasedSink.DynamicDestinations<java.lang.String,?,java.lang.String> dynamicDestinations)
Deprecated.TextIO.Write
to(FileBasedSink.FilenamePolicy filenamePolicy)
TextIO.Write
to(ResourceId filenamePrefix)
TextIO.Write
to(ValueProvider<java.lang.String> outputPrefix)
TextIO.Write
to(SerializableFunction<java.lang.String,DefaultFilenamePolicy.Params> destinationFunction, DefaultFilenamePolicy.Params emptyDestination)
Deprecated.TextIO.Write
toResource(ValueProvider<ResourceId> filenamePrefix)
TextIO.Write
withCompression(Compression compression)
TextIO.Write
withDelimiter(char[] delimiter)
TextIO.Write
withFooter(@Nullable java.lang.String footer)
TextIO.Write
withHeader(@Nullable java.lang.String header)
TextIO.Write
withNoSpilling()
TextIO.Write
withNumShards(int numShards)
TextIO.Write
withNumShards(@Nullable ValueProvider<java.lang.Integer> numShards)
<DestinationT>
TextIO.TypedWrite<java.lang.String,DestinationT>withOutputFilenames()
Specify that output filenames are wanted.TextIO.Write
withoutSharding()
TextIO.Write
withShardNameTemplate(java.lang.String shardTemplate)
TextIO.Write
withSuffix(java.lang.String filenameSuffix)
TextIO.Write
withTempDirectory(ResourceId tempDirectory)
TextIO.Write
withTempDirectory(ValueProvider<ResourceId> tempDirectory)
TextIO.Write
withWindowedWrites()
TextIO.Write
withWritableByteChannelFactory(FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
to
public TextIO.Write to(java.lang.String filenamePrefix)
-
to
@Experimental(FILESYSTEM) public TextIO.Write to(ResourceId filenamePrefix)
-
to
public TextIO.Write to(ValueProvider<java.lang.String> outputPrefix)
-
toResource
@Experimental(FILESYSTEM) public TextIO.Write toResource(ValueProvider<ResourceId> filenamePrefix)
-
to
@Experimental(FILESYSTEM) public TextIO.Write to(FileBasedSink.FilenamePolicy filenamePolicy)
-
to
@Experimental(FILESYSTEM) @Deprecated public TextIO.Write to(FileBasedSink.DynamicDestinations<java.lang.String,?,java.lang.String> dynamicDestinations)
Deprecated.
-
to
@Experimental(FILESYSTEM) @Deprecated public TextIO.Write to(SerializableFunction<java.lang.String,DefaultFilenamePolicy.Params> destinationFunction, DefaultFilenamePolicy.Params emptyDestination)
Deprecated.
-
withTempDirectory
@Experimental(FILESYSTEM) public TextIO.Write withTempDirectory(ValueProvider<ResourceId> tempDirectory)
-
withTempDirectory
@Experimental(FILESYSTEM) public TextIO.Write withTempDirectory(ResourceId tempDirectory)
-
withShardNameTemplate
public TextIO.Write withShardNameTemplate(java.lang.String shardTemplate)
-
withSuffix
public TextIO.Write withSuffix(java.lang.String filenameSuffix)
-
withNumShards
public TextIO.Write withNumShards(int numShards)
-
withNumShards
public TextIO.Write withNumShards(@Nullable ValueProvider<java.lang.Integer> numShards)
-
withoutSharding
public TextIO.Write withoutSharding()
-
withDelimiter
public TextIO.Write withDelimiter(char[] delimiter)
-
withHeader
public TextIO.Write withHeader(@Nullable java.lang.String header)
-
withFooter
public TextIO.Write withFooter(@Nullable java.lang.String footer)
-
withWritableByteChannelFactory
public TextIO.Write withWritableByteChannelFactory(FileBasedSink.WritableByteChannelFactory writableByteChannelFactory)
-
withCompression
public TextIO.Write withCompression(Compression compression)
-
withWindowedWrites
public TextIO.Write withWindowedWrites()
-
withNoSpilling
public TextIO.Write withNoSpilling()
-
withOutputFilenames
public <DestinationT> TextIO.TypedWrite<java.lang.String,DestinationT> withOutputFilenames()
Specify that output filenames are wanted.The nested
TextIO.TypedWrite
transform always has access to output filenames, however due to backwards-compatibility concerns,TextIO.Write
cannot return them. This method simply returns the innerTextIO.TypedWrite
transform which hasWriteFilesResult
as its output type, allowing access to output files.The supplied
DestinationT
type must be: the same as that supplied into(DynamicDestinations)
if that method was used;DefaultFilenamePolicy.Params
ifto(SerializableFunction, Params)
was used, orVoid
otherwise.
-
populateDisplayData
public void populateDisplayData(DisplayData.Builder builder)
Description copied from class:PTransform
Register display data for the given transform or component.populateDisplayData(DisplayData.Builder)
is invoked by Pipeline runners to collect display data viaDisplayData.from(HasDisplayData)
. Implementations may callsuper.populateDisplayData(builder)
in order to register display data in the current namespace, but should otherwise usesubcomponent.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.
- Specified by:
populateDisplayData
in interfaceHasDisplayData
- Overrides:
populateDisplayData
in classPTransform<PCollection<java.lang.String>,PDone>
- Parameters:
builder
- The builder to populate with display data.- See Also:
HasDisplayData
-
expand
public PDone expand(PCollection<java.lang.String> input)
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
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).
- Specified by:
expand
in classPTransform<PCollection<java.lang.String>,PDone>
-
-