Class WriterConfig.Builder
- Enclosing class:
WriterConfig
WriterConfig.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the immutable configuration.codec(CompressionCodec codec) Sets the codec each page body is compressed with; must be non-null.encoding(ColumnEncoding encoding) Sets the encoding policy for every column without an override of its own; must be non-null.encoding(String columnPath, ColumnEncoding encoding) Sets the encoding policy for one leaf column, overriding the file-wide default; both arguments must be non-null.pageTargetBytes(int pageTargetBytes) Sets the page target; must be at least oneINT32(4 bytes).precisionLossPolicy(PrecisionLossPolicy precisionLossPolicy) rowGroupBufferTargetBytes(long rowGroupBufferTargetBytes) Sets the byte threshold at which a row group is cut; must be positive.rowGroupTargetRows(long rowGroupTargetRows) Sets the record count at which a row group is cut; must be positive.statisticsTruncationLength(int statisticsTruncationLength) Sets the maximumBYTE_ARRAYmin/maxstatistics bound length; must be positive.
-
Method Details
-
pageTargetBytes
Sets the page target; must be at least oneINT32(4 bytes). -
rowGroupBufferTargetBytes
Sets the byte threshold at which a row group is cut; must be positive.
The bytes counted are the bytes the writer holds for the open row group: the level streams, the dictionary indices, the value stores and the dictionaries. This is the writer's memory control, and peak heap follows it. Two things sit on top: the buffers hold more than they are charged for while they grow — the value stores by half again, the level streams and packed content and every dictionary's arrays by double — and a schema with enough columns that each one's share falls below the floor under a column's buffers opens at a multiple of the target. Neither grows with how much is written.
It is not the size the row group takes on disk. That is smaller by whatever the encoding and the codec win, which is a property of the data rather than of this setting. A row group passes this threshold by at most one record, a record not being divisible across row groups.
-
rowGroupTargetRows
Sets the record count at which a row group is cut; must be positive.
This is the control over how a file is banded, and the row groups it produces hold exactly this many records apart from the last. A row group is cut at this count or at
rowGroupBufferTargetBytes, whichever is reached first, so a row target set above what the buffer target allows has no effect beyond it.A structural ceiling sits under both: a chunk accumulates into
int-indexed buffers, so a row group holds at mostInteger.MAX_VALUE - 8records however many are asked for. A target above that is that ceiling, which is what makesLong.MAX_VALUEthe way to say "no row limit, cut on bytes alone". -
encoding
Sets the encoding policy for every column without an override of its own; must be non-null. Defaults to
ColumnEncoding.AUTO.A default that no column of the schema can carry is rejected when the writer is created, so a file-wide
BYTE_STREAM_SPLITover a schema holding aBYTE_ARRAYcolumn fails rather than quietly resolving that column to something else. -
encoding
Sets the encoding policy for one leaf column, overriding the file-wide default; both arguments must be non-null.
The column is named by its dotted leaf path as the schema spells it, synthetic
list.elementandkey_value.keysegments included —readings.list.element, notreadings. A path matching no leaf column of the schema, or a policy its physical type cannot carry, is rejected when the writer is created. -
statisticsTruncationLength
Sets the maximumBYTE_ARRAYmin/maxstatistics bound length; must be positive. A bound longer than this is truncated and flagged inexact. -
codec
Sets the codec each page body is compressed with; must be non-null.
UNCOMPRESSED,GZIP,SNAPPY,ZSTD,LZ4_RAWandBROTLIare written. Everything but the first two needs its library on the classpath, which is checked when the writer is created rather than here.The other two members of
CompressionCodecare not produced, and neither is waiting on a later release.LZ4names the Hadoop framing the format deprecated in favour ofLZ4_RAW; files already written with it are still read, so the refusal is on this side only.LZOhas no maintained JVM implementation and is refused in both directions. Asking for either fails when the writer is created. -
precisionLossPolicy
Sets whatRowWriterdoes with a value carrying more precision than its column can hold — anInstantwith microseconds written to aTIMESTAMP(MILLIS)column, say; must be non-null. Defaults toPrecisionLossPolicy.REJECT. -
build
Builds the immutable configuration.
-