CLASSSEALEDAssembly: Parquet.SourceGenerator.Attributes

ParquetSerializerOptions

Namespace: Parquet.SourceGenerator

Configurable options for Parquet source generator serialization and deserialization operations.

Inheritance:
object
Parquet.SourceGenerator.ParquetSerializerOptions

Syntax

ParquetSerializerOptions

UML Class Diagram

ParquetSerializerOptions Class Diagram

Rendering diagram...

Properties17

ColumnEncodingHints: System.Collections.Generic.IDictionary<string, Parquet.SourceGenerator.ParquetColumnEncoding>
IDictionary<string, ParquetColumnEncoding> ParquetSerializerOptions.ColumnEncodingHints

Specifies runtime encoding hints to the writer for specific columns by column path or name. Precedence with <c>[ParquetColumn(Encoding = ...)]</c>: the attribute is applied first and an entry here for the same column name replaces it, so this wins when both are set (an explicit <see cref="ParquetColumnEncoding.Default"/> removes the attribute's hint). Columns without an entry keep their attribute hint. Applies to writes only, and to top-level columns: an <c>Encoding</c> on a member inside a nested struct or list element is not emitted today.

CompressionLevel: Parquet.SourceGenerator.ParquetCompressionLevel?
ParquetCompressionLevel? ParquetSerializerOptions.CompressionLevel

Gets or sets how hard the compression method should work. Null leaves Parquet.Net's own default in place, which is <c>SmallestSize</c>.

Remarks: Nullable rather than defaulted so that "not specified" stays distinguishable from any legal value — the same mistake the row group size sentinel used to make.
CompressionMethod: Parquet.SourceGenerator.ParquetCompressionMethod
ParquetCompressionMethod ParquetSerializerOptions.CompressionMethod

Gets or sets the compression method to apply when creating Parquet files (default is Snappy).

DeduplicateStrings: bool
bool ParquetSerializerOptions.DeduplicateStrings

Gets or sets whether to deduplicate string instances during deserialization (default is false). When enabled, identical string values within a row group share the same object reference, dramatically reducing managed heap allocations and memory footprint for low-cardinality columns. <para> Precedence with <c>[ParquetColumn(Deduplicate = true)]</c>: the two are combined with "or". The attribute deduplicates its column even when this is <c>false</c>; this set to <c>true</c> deduplicates every string column. Applies to reads only. </para>

DefaultSTATIC: Parquet.SourceGenerator.ParquetSerializerOptions
ParquetSerializerOptions ParquetSerializerOptions.Default

Gets a new configuration instance carrying the default values.

Remarks: Deliberately a fresh instance per access rather than a shared singleton. The properties below are settable, so a shared instance let any caller rewrite the defaults for every serializer in the process — <c>ParquetSerializerOptions.Default.RowGroupSize = 1;</c> in one library silently reconfigured every other one. The allocation is negligible beside the megabytes a Parquet read or write moves, and it is only taken when a caller omits options entirely. <para> The properties are not <c>init</c>-only because this assembly targets netstandard2.0 and netstandard2.1, neither of which carries <c>IsExternalInit</c>; making them init-only would break object-initializer use for exactly the .NET Framework consumers this package is meant to keep serving. </para>
DictionaryEncodingSampleSize: int?
int? ParquetSerializerOptions.DictionaryEncodingSampleSize

Gets or sets the number of values to sample before attempting full dictionary encoding. When positive, a quick uniqueness check is performed on the first sample to determine if dictionary encoding should be applied, avoiding expensive full-column scans on high-cardinality data. Default is null (leaving Parquet.Net's default of 0 / full scan).

DictionaryEncodingThreshold: double?
double? ParquetSerializerOptions.DictionaryEncodingThreshold

Gets or sets the dictionary uniqueness threshold, which is a value from 0 (no unique values) to 1 (all values are unique) indicating when dictionary encoding is applied. Uniqueness factor needs to be less than or equal to this threshold. Null leaves Parquet.Net's default in place (0.8).

MaxAllocationBytes: long
long ParquetSerializerOptions.MaxAllocationBytes

Gets or sets the maximum number of bytes a read may allocate for one row group's column buffers, computed from the row and value counts the file declares before any of them is allocated (default is 268,435,456, which is 256 MiB).

Remarks: <see cref="MaxAllocationValues"/> bounds a count, and a count is the same number for a <c>bool</c> column and a <c>Guid</c> column, so on its own it lets a small file with a lying footer reserve about a gigabyte. This bounds the bytes: the generated reader multiplies the row group's row count by the model's per-row buffer size (an upper estimate of the pooled arrays, not of the objects built from them) and throws <see cref="System.IO.InvalidDataException"/> naming this option when the product exceeds the budget. Repeated (list) columns are checked as their chunks are read, for the growth of their buffers beyond the row-sized estimate, and that growth is added to the row group's running total. The budget applies to each row group and, in a parallel read, to each worker. <para> The default admits any realistic row group (a million rows of a ten column model is on the order of 100 MiB) while refusing the ten million rows a hostile footer can declare for a few hundred bytes. A file with genuinely larger row groups needs this raised, for example <c>MaxAllocationBytes = 1_073_741_824</c>. </para>
MaxAllocationValues: int
int ParquetSerializerOptions.MaxAllocationValues

Gets or sets the maximum number of values permitted in a single column chunk allocation or total collection size (default is 10,000,000).

MaxDecompressedPageSize: int
int ParquetSerializerOptions.MaxDecompressedPageSize

Gets or sets the maximum uncompressed size of an individual page read from a Parquet file (default is 67,108,864 bytes / 64 MiB).

Remarks: This limit is enforced before Parquet.Net allocates a page decompression buffer. It applies to generated deserialization paths only; writing is unaffected.
MaxDecompressionExpansionRatio: int
int ParquetSerializerOptions.MaxDecompressionExpansionRatio

Gets or sets the maximum uncompressed-to-compressed size ratio permitted for an individual compressed page (default is 500).

Remarks: This limit is enforced before Parquet.Net decompresses a page. It applies to generated deserialization paths only; writing is unaffected.
MaxDegreeOfParallelism: int
int ParquetSerializerOptions.MaxDegreeOfParallelism

Gets or sets the maximum degree of parallelism for parallel row group reading (default is -1, using <c>Environment.ProcessorCount</c>).

Remarks: <para> Applies to the generated <c>From(ReadOnlyMemory&lt;byte&gt;).Parallel()</c> read, where each worker gets its own reader over its own view of the buffer. Stream reads are sequential and ignore this: a stream cannot be shared between readers, so <c>Parallel()</c> on a stream source throws <see cref="System.NotSupportedException"/>. The effective worker count is capped at the file's row-group count. </para> <para> This is the only place the degree of parallelism can be set. The parallel read methods carried a duplicate <c>maxDegreeOfParallelism</c> parameter until <c>0.0.x</c>; it was removed so the setting has one home. </para>
MaxDictionaryEntries: int
int ParquetSerializerOptions.MaxDictionaryEntries

Gets or sets the maximum number of values permitted in a dictionary page before the reader rejects the column (default is 1,000,000).

MaxNestingDepth: int
int ParquetSerializerOptions.MaxNestingDepth

Gets or sets the maximum compound schema nesting depth permitted (default is 64).

MaxRowGroupCount: int
int ParquetSerializerOptions.MaxRowGroupCount

Gets or sets the maximum number of row groups permitted in a single Parquet file (default is 100,000).

MaxStringLengthBytes: int
int ParquetSerializerOptions.MaxStringLengthBytes

Gets or sets the maximum UTF-8 byte length permitted for a decoded string value before the reader materializes it (default is 1,048,576 bytes).

RowGroupSize: int
int ParquetSerializerOptions.RowGroupSize

Gets or sets the target row group size for batched writing operations (default is 50,000 rows).

Remarks: This is the only place the row group size can be set. <c>WriteParquetBatchedAsync</c> and the <c>IAsyncEnumerable</c> overload of <c>WriteParquetAsync</c> carried a duplicate <c>rowGroupSize</c> parameter until <c>0.0.x</c>; it was removed so the setting has one home. <para> It does not apply to the columnar <c>&lt;Model&gt;Batch.WriteParquetAsync</c>: a batch is written as one complete row group. </para>