Class WriterConfig.Builder
- Enclosing class:
WriterConfig
WriterConfig.-
Method Summary
Modifier and TypeMethodDescriptionbloomFilter(String columnPath) Writes a Bloom filter for one leaf column, atWriterConfig.DEFAULT_BLOOM_FILTER_FPP; must be non-null.bloomFilter(String columnPath, double fpp) Writes a Bloom filter for one leaf column, with the given false-positive probability; the path must be non-null and the probability strictly between 0 and 1.build()Builds the immutable configuration.compression(Compression compression) Sets how each page body is compressed; must be non-null.dataPageVersion(DataPageVersion dataPageVersion) Sets the header and layout every data page is written 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).pageTargetRows(int pageTargetRows) Sets the record count at which a data page is cut; must be positive.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.sortingColumns(SortingColumn... sortingColumns) Declares the order every row group's rows are sorted in; a second call replaces the first, and no columns declares none.sortingColumns(List<SortingColumn> sortingColumns) Declares the order every row group's rows are sorted in: by the first column, rows equal there by the second, and so on.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). -
pageTargetRows
Sets the record count at which a data page is cut; must be positive.
A page is cut at this count or at
pageTargetBytes, whichever is reached first. Each page's bounds are recorded in the file's page index, so the count sets how finely a reader can skip within a column chunk. It binds on columns whose values encode small, such as dictionary-encoded ones, which would otherwise hold a whole row group in a few pages. A page holds whole records, so on a repeated column it counts records rather than values. -
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 - 9records 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. -
bloomFilter
Writes a Bloom filter for one leaf column, atWriterConfig.DEFAULT_BLOOM_FILTER_FPP; must be non-null. SeebloomFilter(String, double). -
bloomFilter
Writes a Bloom filter for one leaf column, with the given false-positive probability; the path must be non-null and the probability strictly between 0 and 1.
Every row group gets a filter for the column, holding each distinct value its chunk holds. The filter is sized from the values the chunk turns out to hold, so a lower probability costs bytes in proportion to the chunk's distinct values. Naming the column again replaces the probability.
The column is named by its dotted leaf path, as for
encoding(String, ColumnEncoding). A path matching no leaf column of the schema, or naming aBOOLEANcolumn, 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. -
compression
Sets how each page body is compressed; must be non-null. See
Compressionfor the codecs and their levels.A codec's library is required when the writer is created rather than here.
-
dataPageVersion
Sets the header and layout every data page is written with; must be non-null. Defaults toDataPageVersion.V1. -
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. -
sortingColumns
Declares the order every row group's rows are sorted in; a second call replaces the first, and no columns declares none. SeesortingColumns(List). -
sortingColumns
Declares the order every row group's rows are sorted in: by the first column, rows equal there by the second, and so on. A second call replaces the first, and an empty list declares none. The list must be non-null, hold no
nulland name each column once.Each row group's metadata records the order. The writer checks it as rows arrive, within each row group: the first row that sorts before the row ahead of it fails the write with an
IllegalArgumentException.SortingColumndefines how each column's values compare.A column is named by its dotted leaf path, as for
encoding(String, ColumnEncoding). A path matching no leaf column, a column that is repeated or sits inside a list or map, and a column whose type has no defined order (INTERVAL,GEOMETRY,GEOGRAPHY,UNKNOWN) are rejected when the writer is created. -
build
Builds the immutable configuration.
-