-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow specifying column definitions for a ParquetRowWriter (#284)
* Allow providing an array of Column instances to CreateRowWriter This gives users more control over the logical type mappings for columns, eg. to specify IsAdjustedToUtc for Timestamps, and works when using a tuple type where we can't add attributes to fields. * Move column mapping out of write delegate cache This prevents getting the incorrect columns when re-using the write delegate and columns have been manually specified. Introduces a new MappedField struct to replace the previous tuple to make this more manageable. * Comment fixes
- Loading branch information
Showing
4 changed files
with
251 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace ParquetSharp.RowOriented | ||
{ | ||
/// <summary> | ||
/// Represents a field or property of a type that is to be mapped to a Parquet column | ||
/// </summary> | ||
internal struct MappedField | ||
{ | ||
public readonly string Name; | ||
public readonly string? MappedColumn; | ||
public readonly Type Type; | ||
public readonly MemberInfo Info; | ||
|
||
public MappedField(string name, string? mappedColumn, Type type, MemberInfo info) | ||
{ | ||
Name = name; | ||
MappedColumn = mappedColumn; | ||
Type = type; | ||
Info = info; | ||
} | ||
} | ||
} |
Oops, something went wrong.