Class ParquetSerializer.Builder
- Enclosing class:
- ParquetSerializer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor, default settings.protectedBuilder(ParquetSerializer copyFrom) Copy constructor.protectedBuilder(ParquetSerializer.Builder copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddBeanTypesParquet(boolean value) Adds_type column for polymorphic beans.build()Build the object.compressionCodec(CompressionCodec value) Sets the compression codec.copy()Copy creator.Sets how to handle cyclic references during serialization.emitLogicalTypes(boolean value) Emits explicit logical-type discriminator metadata for ambiguous physical representations.hashKey()Returns the hashkey of this builder.maxRecursionDepth(int value) Sets the maximum expansion depth for self-referential (recursive) bean types.nativeLogicalTypes(boolean value) Emits binary-native logical types (DECIMAL, DATE, TIME, TIMESTAMP-micros) on write instead of the default string / TIMESTAMP-millis normalization.nullKeyString(String value) The string used to representnull map keys in Parquet MAP key_value format.pageSize(int value) Sets the target page size in bytes.rowGroupSize(int value) Sets the target row group size in bytes.writeDatesAsTimestamp(boolean value) Sets whether dates are written as TIMESTAMP(MILLIS).Methods inherited from class org.apache.juneau.marshall.serializer.Serializer.Builder
accept, addBeanTypes, addBeanTypes, addRootType, addRootType, getAccept, getProduces, keepNullProperties, keepNullProperties, listener, nonDefault, nonDefault, produces, sortCollections, sortCollections, sortMaps, sortMaps, trimEmptyCollections, trimEmptyCollections, trimEmptyMaps, trimEmptyMaps, trimStrings, trimStrings, uriContext, uriRelativity, uriResolutionMethods inherited from class org.apache.juneau.marshall.MarshallingTraverseContext.Builder
detectRecursions, detectRecursions, ignoreRecursions, ignoreRecursions, initialDepth, maxDepthMethods inherited from class org.apache.juneau.marshall.MarshallingContextable.Builder
activeView, annotations, beanClassVisibility, beanConstructorVisibility, beanDictionary, beanFieldVisibility, beanInterceptor, beanMapPutReturnsOldValue, beanMethodVisibility, beanProperties, beanProperties, beanProperties, beanPropertiesExcludes, beanPropertiesExcludes, beanPropertiesExcludes, beanPropertiesReadOnly, beanPropertiesReadOnly, beanPropertiesReadOnly, beanPropertiesWriteOnly, beanPropertiesWriteOnly, beanPropertiesWriteOnly, beansRequireDefaultConstructor, beansRequireSerializable, beansRequireSettersForGetters, bigNumberFormat, binaryFormat, bitSetFormat, booleanFormat, calendarFormat, classFormat, classLoader, currencyFormat, dateFormat, debug, dictionaryOn, disableBeansRequireSomeProperties, disableDefaultViewInclusion, disableIgnoreMissingSetters, disableIgnoreTransientFields, disableIgnoreUnknownNullBeanProperties, disableInterfaceProxies, durationFormat, enumFormat, example, example, findFluentSetters, findFluentSetters, floatFormat, ignoreInvocationExceptionsOnGetters, ignoreInvocationExceptionsOnSetters, ignoreUnknownBeanProperties, ignoreUnknownEnumValues, implClass, implClasses, interfaceClass, interfaces, locale, localeFormat, marshallingContext, marshallingContext, marshallingContext, marshallingContext, mediaType, notBeanClasses, notBeanPackages, periodFormat, propertyNamer, propertyNamer, recordComponentOrder, stopClass, swap, swap, swaps, swaps, temporalFormat, timeZone, timeZoneFormat, typeName, typePropertyName, typePropertyName, unsortedProperties, unsortedProperties, useJavaBeanIntrospector, uuidFormat, validateSchema, validateSchemaMethods inherited from class org.apache.juneau.marshall.Context.Builder
annotations, apply, applyAnnotations, applyAnnotations, asSubtype, build, cache, canApply, copyOrNull, debug, getApplied, getType, impl, isDebug, registerBuilders, self, type
-
Constructor Details
-
Builder
protected Builder()Constructor, default settings. -
Builder
Copy constructor.- Parameters:
copyFrom- The builder to copy from.
Cannot benull .
-
Builder
Copy constructor.- Parameters:
copyFrom- The serializer to copy from.
Cannot benull .
-
-
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
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
convertedTypeonly). Modeled on JSON's optional_type discriminator: when enabled, the serializer additionally writes the ParquetLogicalType 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_ARRAYphysical-type signal. The legacyconvertedTypefield 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 onlogicalType.- 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,
BigDecimalcolumns are written as DECIMAL with scale/precision,LocalDateas DATE,LocalTime/OffsetTimeas 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 withSerializeException; NULL to serialize cycles asnull .- 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 atoStringrepresentation (GAP-13). Structure deeper than this is truncated tonull (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 representnull map keys in Parquet MAP key_value format.Parquet MAP keys are UTF8;
null keys cannot be stored directly. When serializing aMapwith anull key, this string is used. When parsing, a key equal to this string is restored asnull .- Parameters:
value- The placeholder string for null keys. Default is"<NULL>" .- Returns:
- This object.
-
copy
Description copied from class:Context.BuilderCopy creator.- Specified by:
copyin classOutputStreamSerializer.Builder<ParquetSerializer.Builder>- Returns:
- A new mutable copy of this builder.
-
build
Description copied from class:Context.BuilderBuild the object.- Overrides:
buildin classOutputStreamSerializer.Builder<ParquetSerializer.Builder>- Returns:
- The built object.
-
hashKey
Description copied from class:Context.BuilderReturns the hashkey of this builder.Used to return previously instantiated context beans that have matching hashkeys. The
HashKeyobject is suitable for use as a hashmap key of a map of context beans. A context bean is considered equivalent if theHashKey.equals(Object)method is the same.- Overrides:
hashKeyin classSerializer.Builder<ParquetSerializer.Builder>- Returns:
- The hashkey of this builder.
-