Parquet.SourceGenerator
0.0.1-dev.2
This is a prerelease version of Parquet.SourceGenerator.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Parquet.SourceGenerator --version 0.0.1-dev.2
NuGet\Install-Package Parquet.SourceGenerator -Version 0.0.1-dev.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Parquet.SourceGenerator" Version="0.0.1-dev.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Parquet.SourceGenerator" Version="0.0.1-dev.2" />
<PackageReference Include="Parquet.SourceGenerator"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Parquet.SourceGenerator --version 0.0.1-dev.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Parquet.SourceGenerator, 0.0.1-dev.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Parquet.SourceGenerator@0.0.1-dev.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Parquet.SourceGenerator&version=0.0.1-dev.2&prerelease
#tool nuget:?package=Parquet.SourceGenerator&version=0.0.1-dev.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Parquet.SourceGenerator
A zero-reflection C# Roslyn source generator that emits Parquet serializers and deserializers at compile time, targeting Parquet.Net low-level primitives.
📦 Installation
dotnet add package Parquet.SourceGenerator
dotnet add package Parquet.Net
Parquet.SourceGenerator.Attributes is automatically included as a dependency. Parquet.Net must be referenced directly by your project.
📖 Quick Start Example
using System;
using Parquet.SourceGenerator;
[ParquetSerializable]
public partial record UserEvent
{
[ParquetColumn("event_id", Order = 1)]
public Guid Id { get; init; }
[ParquetColumn("username", Order = 2)]
public string Username { get; init; } = string.Empty;
[ParquetColumn("timestamp", Order = 3)]
[ParquetTimestamp(ParquetTimestampUnit.Microseconds)]
public DateTime Timestamp { get; init; }
[ParquetColumn("duration", Order = 4)]
public TimeSpan Duration { get; init; }
}
Writing Parquet Files
List<UserEvent> events = GetEvents();
using var stream = File.Create("events.parquet");
// Simple write
await events.WriteParquetAsync(stream);
// Chunked row-group streaming write
await events.WriteParquetBatchedAsync(stream, rowGroupSize: 10_000);
// Stream directly from IAsyncEnumerable<T>
IAsyncEnumerable<UserEvent> eventStream = GetAsyncEventStream();
await eventStream.WriteParquetAsync(stream, rowGroupSize: 10_000);
Reading Parquet Files (Sequential & Parallel)
using var stream = File.OpenRead("events.parquet");
// Sequential read
List<UserEvent> events = await UserEventParquetExtensions.ReadParquetAsync(stream);
// Multi-core parallel read across row groups
List<UserEvent> parallelEvents = await UserEventParquetExtensions.ReadParquetParallelAsync(stream, maxDegreeOfParallelism: 4);
// Read from in-memory byte buffer
ReadOnlyMemory<byte> buffer = File.ReadAllBytes("events.parquet");
List<UserEvent> memEvents = await UserEventParquetExtensions.ReadParquetAsync(buffer);
Custom Configuration (ParquetSerializerOptions)
var options = new ParquetSerializerOptions
{
RowGroupSize = 25_000,
MaxDegreeOfParallelism = 8,
CompressionMethod = ParquetCompressionMethod.Zstd
};
await events.WriteParquetBatchedAsync(stream, options: options);
Compression options: None, Snappy (default), Gzip, Lz4, Brotli, Zstd.
🛡️ Compiler Diagnostics
| Diagnostic ID | Severity | Description |
|---|---|---|
PARQ001 |
Error | Target type decorated with [ParquetSerializable] must be declared as partial. |
PARQ002 |
Error | Duplicate [ParquetColumn] column names detected on model. |
PARQ003 |
Warning | Target type has no valid public serializable properties or fields. |
PARQ004 |
Warning | Non-public property decorated with [ParquetColumn] will be ignored. |
PARQ005 |
Error | Invalid [ParquetDecimal] precision or scale parameters. |
🔗 Links & Resources
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Parquet.SourceGenerator.Attributes (>= 0.0.1-dev.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.3 | 105 | 9/5/2026 |
| 0.0.2 | 92 | 9/2/2026 |
| 0.0.1 | 119 | 8/5/2026 |
| 0.0.1-dev.2 | 66 | 8/6/2026 |
| 0.0.1-dev.1 | 65 | 8/5/2026 |