Package org.apache.parquet.hadoop.api
Class WriteSupport<T>
- java.lang.Object
-
- org.apache.parquet.hadoop.api.WriteSupport<T>
-
- Type Parameters:
T
- the type of the incoming records
- Direct Known Subclasses:
DelegatingWriteSupport
,GroupWriteSupport
public abstract class WriteSupport<T> extends Object
Abstraction to use withParquetOutputFormat
to convert incoming records
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WriteSupport.FinalizedWriteContext
Information to be added in the file once all the records have been writtenstatic class
WriteSupport.WriteContext
information to be persisted in the file
-
Constructor Summary
Constructors Constructor Description WriteSupport()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description WriteSupport.FinalizedWriteContext
finalizeWrite()
called once in the end after the last record was writtenString
getName()
Called to get a name to identify the WriteSupport object model.abstract WriteSupport.WriteContext
init(org.apache.hadoop.conf.Configuration configuration)
called first in the taskabstract void
prepareForWrite(RecordConsumer recordConsumer)
This will be called once per row groupabstract void
write(T record)
called once per record
-
-
-
Method Detail
-
init
public abstract WriteSupport.WriteContext init(org.apache.hadoop.conf.Configuration configuration)
called first in the task- Parameters:
configuration
- the job's configuration- Returns:
- the information needed to write the file
-
prepareForWrite
public abstract void prepareForWrite(RecordConsumer recordConsumer)
This will be called once per row group- Parameters:
recordConsumer
- the recordConsumer to write to
-
write
public abstract void write(T record)
called once per record- Parameters:
record
- one record to write to the previously provided record consumer
-
getName
public String getName()
Called to get a name to identify the WriteSupport object model. If not null, this is added to the file footer metadata.Defining this method will be required in a future API version.
- Returns:
- a String name for file metadata.
-
finalizeWrite
public WriteSupport.FinalizedWriteContext finalizeWrite()
called once in the end after the last record was written- Returns:
- information to be added in the file
-
-