Class ParquetParser.Builder

Enclosing class:
ParquetParser

Builder class.
  • Constructor Details

  • Method Details

    • nullKeyString

      The string used when parsing Parquet MAP keys that represent null.

      Must match ParquetSerializer.Builder.nullKeyString(String) for round-trip.

      Parameters:
      value - The placeholder string. Default is "<NULL>".
      Returns:
      This object.
    • maxLength

      public ParquetParser.Builder maxLength(int value)
      The maximum allowed wire-declared length (in bytes) for a single Parquet page (compressed or uncompressed).

      Guards against malformed or adversarial input where a small file declares a huge per-page byte size, which would otherwise trigger OutOfMemoryError. Malformed page headers are reported as a clean parse error instead.

      Parameters:
      value - The maximum length in bytes. Default is 256 MiB. Values ≤ 0 disable the cap.
      Returns:
      This object.
    • maxCount

      public ParquetParser.Builder maxCount(int value)
      The maximum allowed wire-declared element count (file/row-group row counts, column-chunk value counts).

      Guards against malformed or adversarial input where a small footer declares a huge row or value count, which would otherwise drive a huge ArrayList pre-allocation. Malformed counts are reported as a clean parse error instead.

      Parameters:
      value - The maximum count. Default is 10 million. Values ≤ 0 disable the cap.
      Returns:
      This object.
    • maxInputLength

      The maximum allowed size (in bytes) of the whole Parquet input buffered into memory before parsing.

      Parquet's end-of-file footer and column-major layout require the entire input to be buffered before any record can be reconstructed. This cap rejects an oversized input with a clean parse error instead of buffering an unbounded body into memory.

      Parameters:
      value - The maximum input size in bytes. Default is 256 MiB. Values ≤ 0 disable the cap.
      Returns:
      This object.
    • maxDecompressedBytes

      The maximum allowed aggregate decompressed-byte total across every Parquet page read during a single parse.

      Guards against a decompression bomb assembled from many pages that each individually pass the per-page maxLength(int) cap: this ceiling charges every page's declared uncompressed size against a running per-parse total, so a chunk (or a whole file) whose pages sum past the ceiling is rejected with a clean parse error instead of buffering the excess.

      Parameters:
      value - The maximum aggregate decompressed-byte total. Default is 64 MiB. Values ≤ 0 disable the cap.
      Returns:
      This object.
    • copy

      Description copied from class: Context.Builder
      Copy creator.
      Specified by:
      copy in class InputStreamParser.Builder<ParquetParser.Builder>
      Returns:
      A new mutable copy of this builder.
    • build

      public ParquetParser build()
      Description copied from class: Context.Builder
      Build the object.
      Overrides:
      build in class InputStreamParser.Builder<ParquetParser.Builder>
      Returns:
      The built object.
    • hashKey

      public HashKey hashKey()
      Description copied from class: Context.Builder
      Returns the hashkey of this builder.

      Used to return previously instantiated context beans that have matching hashkeys. The HashKey object is suitable for use as a hashmap key of a map of context beans. A context bean is considered equivalent if the HashKey.equals(Object) method is the same.

      Overrides:
      hashKey in class Parser.Builder<ParquetParser.Builder>
      Returns:
      The hashkey of this builder.