Package org.apache.beam.sdk.io.parquet
Class ParquetIO.Sink
java.lang.Object
org.apache.beam.sdk.io.parquet.ParquetIO.Sink
- All Implemented Interfaces:
Serializable
,FileIO.Sink<GenericRecord>
- Enclosing class:
ParquetIO
Implementation of
ParquetIO.sink(org.apache.avro.Schema)
.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
Flushes the buffered state (if any) before the channel is closed.void
open
(WritableByteChannel channel) Initializes writing to the given channel.withAvroDataModel
(GenericData model) Define the Avro data model; seeAvroParquetWriter.Builder.withDataModel(GenericData)
.withCompressionCodec
(org.apache.parquet.hadoop.metadata.CompressionCodecName compressionCodecName) Specifies compression codec.withConfiguration
(Map<String, String> configuration) Specify Hadoop configuration for ParquetWriter.withConfiguration
(org.apache.hadoop.conf.Configuration configuration) Specify Hadoop configuration for ParquetWriter.withRowGroupSize
(int rowGroupSize) Specify row-group size; if not set or zero, a default is used by the underlying writer.void
write
(GenericRecord element) Appends a single element to the file.
-
Constructor Details
-
Sink
public Sink()
-
-
Method Details
-
withCompressionCodec
public ParquetIO.Sink withCompressionCodec(org.apache.parquet.hadoop.metadata.CompressionCodecName compressionCodecName) Specifies compression codec. By default, CompressionCodecName.SNAPPY. -
withConfiguration
Specify Hadoop configuration for ParquetWriter. -
withConfiguration
Specify Hadoop configuration for ParquetWriter. -
withRowGroupSize
Specify row-group size; if not set or zero, a default is used by the underlying writer. -
withAvroDataModel
Define the Avro data model; seeAvroParquetWriter.Builder.withDataModel(GenericData)
. -
open
Description copied from interface:FileIO.Sink
Initializes writing to the given channel. Will be invoked once on a givenFileIO.Sink
instance.- Specified by:
open
in interfaceFileIO.Sink<GenericRecord>
- Throws:
IOException
-
write
Description copied from interface:FileIO.Sink
Appends a single element to the file. May be invoked zero or more times.- Specified by:
write
in interfaceFileIO.Sink<GenericRecord>
- Throws:
IOException
-
flush
Description copied from interface:FileIO.Sink
Flushes the buffered state (if any) before the channel is closed. Does not need to close the channel. Will be invoked once.- Specified by:
flush
in interfaceFileIO.Sink<GenericRecord>
- Throws:
IOException
-