Class ParquetSerializer.Builder

Enclosing class:
ParquetSerializer

Builder class.
  • Constructor Details

    • Builder

      protected Builder()
      Constructor, default settings.
    • Builder

      protected Builder(ParquetSerializer.Builder copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The builder to copy from.
      Cannot be null.
    • Builder

      protected Builder(ParquetSerializer copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The serializer to copy from.
      Cannot be null.
  • Method Details

    • compressionCodec

      Sets the compression codec.
      Parameters:
      value - UNCOMPRESSED or GZIP. null resets to UNCOMPRESSED.
      Returns:
      This object.
      Throws:
      IllegalArgumentException - If the codec cannot be written (e.g. SNAPPY, which is decode-only).
    • rowGroupSize

      Sets the target row group size in bytes.
      Parameters:
      value - Size in bytes.
      Returns:
      This object.
    • pageSize

      public ParquetSerializer.Builder pageSize(int value)
      Sets the target page size in bytes.
      Parameters:
      value - Size in bytes.
      Returns:
      This object.
    • addBeanTypesParquet

      Adds _type column for polymorphic beans.
      Parameters:
      value - Whether to add the column.
      Returns:
      This object.
    • writeDatesAsTimestamp

      Sets whether dates are written as TIMESTAMP(MILLIS).
      Parameters:
      value - If true, use INT64+TIMESTAMP_MILLIS; else use ISO 8601 string.
      Returns:
      This object.
    • emitLogicalTypes

      Emits explicit logical-type discriminator metadata for ambiguous physical representations.

      Disabled by default, which preserves the current Parquet wire shape (physical type plus convertedType only). Modeled on JSON's optional _type discriminator: when enabled, the serializer additionally writes the Parquet LogicalType union into the file footer for columns whose physical encoding is otherwise ambiguous.

      First-pass scope is UUID only — the one type whose round-trip relies on the FIXED_LEN_BYTE_ARRAY physical-type signal. The legacy convertedType field is still emitted alongside the union, so readers that consume only the legacy field (including older Juneau versions) continue to work unchanged, while modern readers can route on logicalType.

      Parameters:
      value - Whether to emit logical-type discriminator metadata.
      Returns:
      This object.
    • nativeLogicalTypes

      Emits binary-native logical types (DECIMAL, DATE, TIME, TIMESTAMP-micros) on write instead of the default string / TIMESTAMP-millis normalization.

      Disabled by default, which preserves the current wire shape (and lossless Juneau↔Juneau round-trips). When enabled, BigDecimal columns are written as DECIMAL with scale/precision, LocalDate as DATE, LocalTime/OffsetTime as TIME(MICROS), and date/instant temporals as TIMESTAMP(MICROS) — interoperable with parquet-mr / Spark and sub-millisecond precise. Read-side decode of these types is always on regardless of this flag.

      Parameters:
      value - Whether to emit binary-native logical types on write.
      Returns:
      This object.
    • cycleHandling

      Sets how to handle cyclic references during serialization.
      Parameters:
      value - THROW to fail with SerializeException; NULL to serialize cycles as null.
      Returns:
      This object.
    • maxRecursionDepth

      Sets the maximum expansion depth for self-referential (recursive) bean types.

      A self-referential type (e.g. class Node { String val; Node next; }) is expanded into this many nested column levels so acyclic data (trees, linked lists) up to this depth round-trips losslessly instead of degrading to a toString representation (GAP-13). Structure deeper than this is truncated to null (documented-lossy). Larger values support deeper structures at the cost of a wider schema; the schema is expanded structurally regardless of the actual data depth, so keep this modest for recursive types with high fan-out.

      Parameters:
      value - The maximum recursion expansion depth. Values below 1 are clamped to 1.
      Returns:
      This object.
    • nullKeyString

      The string used to represent null map keys in Parquet MAP key_value format.

      Parquet MAP keys are UTF8; null keys cannot be stored directly. When serializing a Map with a null key, this string is used. When parsing, a key equal to this string is restored as null.

      Parameters:
      value - The placeholder string for null keys. Default is "<NULL>".
      Returns:
      This object.
    • copy

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

      Description copied from class: Context.Builder
      Build the object.
      Overrides:
      build in class OutputStreamSerializer.Builder<ParquetSerializer.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 Serializer.Builder<ParquetSerializer.Builder>
      Returns:
      The hashkey of this builder.