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 with ParquetOutputFormat to convert incoming records
  • Constructor Details

    • WriteSupport

      public WriteSupport()
  • Method Details

    • init

      @Deprecated public abstract WriteSupport.WriteContext init(org.apache.hadoop.conf.Configuration configuration)
      Deprecated.
      called first in the task
      Parameters:
      configuration - the job's configuration
      Returns:
      the information needed to write the file
    • init

      public WriteSupport.WriteContext init(org.apache.parquet.conf.ParquetConfiguration 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(org.apache.parquet.io.api.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