parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
void writeColumnChunk(ColumnDescriptor descriptor,
      long valueCount,
      CompressionCodecName compressionCodecName,
      DictionaryPage dictionaryPage,
      BytesInput bytes,
      long uncompressedTotalPageSize,
      long compressedTotalPageSize,
      Statistics<?> totalStats,
      ColumnIndexBuilder columnIndexBuilder,
      OffsetIndexBuilder offsetIndexBuilder,
      Set<Encoding> rlEncodings,
      Set<Encoding> dlEncodings,
      List<Encoding> dataEncodings) throws IOException {
    startColumn(descriptor, valueCount, compressionCodecName);

    state = state.write();
    if (dictionaryPage != null) {
      writeDictionaryPage(dictionaryPage);
    }
    LOG.debug("{}: write data pages", out.getPos());
    long headersSize = bytes.size() - compressedTotalPageSize;
    this.uncompressedLength += uncompressedTotalPageSize + headersSize;
    this.compressedLength += compressedTotalPageSize + headersSize;
    LOG.debug("{}: write data pages content", out.getPos());
    firstPageOffset = out.getPos();
    bytes.writeAllTo(out);
    encodingStatsBuilder.addDataEncodings(dataEncodings);
    if (rlEncodings.isEmpty()) {
      encodingStatsBuilder.withV2Pages();
    }
    currentEncodings.addAll(rlEncodings);
    currentEncodings.addAll(dlEncodings);
    currentEncodings.addAll(dataEncodings);
    currentStatistics = totalStats;

    this.columnIndexBuilder = columnIndexBuilder;
    this.offsetIndexBuilder = offsetIndexBuilder;

    endColumn();
  }
void writeColumnChunk(ColumnDescriptor descriptor,
      long valueCount,
      CompressionCodecName compressionCodecName,
      DictionaryPage dictionaryPage,
      BytesInput bytes,
      long uncompressedTotalPageSize,
      long compressedTotalPageSize,
      Statistics<?> totalStats,
      ColumnIndexBuilder columnIndexBuilder,
      OffsetIndexBuilder offsetIndexBuilder,
      Set<Encoding> rlEncodings,
      Set<Encoding> dlEncodings,
      List<Encoding> dataEncodings) throws IOException {
    startColumn(descriptor, valueCount, compressionCodecName);

    state = state.write();
    if (dictionaryPage != null) {
      writeDictionaryPage(dictionaryPage);
    }
    LOG.debug("{}: write data pages", out.getPos());
    long headersSize = bytes.size() - compressedTotalPageSize;
    this.uncompressedLength += uncompressedTotalPageSize + headersSize;
    this.compressedLength += compressedTotalPageSize + headersSize;
    LOG.debug("{}: write data pages content", out.getPos());
    firstPageOffset = out.getPos();
    bytes.writeAllTo(out);
    encodingStatsBuilder.addDataEncodings(dataEncodings);
    if (rlEncodings.isEmpty()) {
      encodingStatsBuilder.withV2Pages();
    }
    currentEncodings.addAll(rlEncodings);
    currentEncodings.addAll(dlEncodings);
    currentEncodings.addAll(dataEncodings);
    currentStatistics = totalStats;

    this.columnIndexBuilder = columnIndexBuilder;
    this.offsetIndexBuilder = offsetIndexBuilder;

    endColumn();
  }
void writeColumnChunk ( ColumnDescriptor descriptor , long valueCount , CompressionCodecName compressionCodecName , DictionaryPage dictionaryPage , BytesInput bytes , long uncompressedTotalPageSize , long compressedTotalPageSize , Statistics < ? > totalStats , ColumnIndexBuilder columnIndexBuilder , OffsetIndexBuilder offsetIndexBuilder , Set < Encoding > rlEncodings , Set < Encoding > dlEncodings , List < Encoding > dataEncodings ) throws IOException { startColumn ( descriptor , valueCount , compressionCodecName ) ; state = state . write ( ) ; if ( dictionaryPage != null ) { writeDictionaryPage ( dictionaryPage ) ; } LOG . debug ( "{}: write data pages" , out . getPos ( ) ) ; long headersSize = bytes . size ( ) - compressedTotalPageSize ; this . uncompressedLength += uncompressedTotalPageSize + headersSize ; this . compressedLength += compressedTotalPageSize + headersSize ; LOG . debug ( "{}: write data pages content" , out . getPos ( ) ) ; firstPageOffset = out . getPos ( ) ; bytes . writeAllTo ( out ) ; encodingStatsBuilder . addDataEncodings ( dataEncodings ) ; if ( rlEncodings . isEmpty ( ) ) { encodingStatsBuilder . withV2Pages ( ) ; } currentEncodings . addAll ( rlEncodings ) ; currentEncodings . addAll ( dlEncodings ) ; currentEncodings . addAll ( dataEncodings ) ; currentStatistics = totalStats ; this . columnIndexBuilder = columnIndexBuilder ; this . offsetIndexBuilder = offsetIndexBuilder ; endColumn ( ) ; }
Writes a column chunk at once
@param descriptor the descriptor of the column
@param valueCount the value count in this column
@param compressionCodecName the name of the compression codec used for compressing the pages
@param dictionaryPage the dictionary page for this column chunk (might be null)
@param bytes the encoded pages including page headers to be written as is
@param uncompressedTotalPageSize total uncompressed size (without page headers)
@param compressedTotalPageSize total compressed size (without page headers)
@param totalStats accumulated statistics for the column chunk
@param columnIndexBuilder the builder object for the column index
@param offsetIndexBuilder the builder object for the offset index
@param rlEncodings the RL encodings used in this column chunk
@param dlEncodings the DL encodings used in this column chunk
@param dataEncodings the data encodings used in this column chunk
@throws IOException if there is an error while writing
Writes a column chunk at once