Class LogicalTypeFactory
- Namespace
- ParquetSharp
- Assembly
- ParquetSharp.dll
Defines the mapping between .NET types and Parquet logical types, allowing for custom type handling.
public class LogicalTypeFactory
- Inheritance
-
LogicalTypeFactory
- Inherited Members
Constructors
LogicalTypeFactory()
Create a new LogicalTypeFactory with the default primitive mapping.
public LogicalTypeFactory()
LogicalTypeFactory(IReadOnlyDictionary<Type, (LogicalType? logicalType, Repetition repetition, PhysicalType physicalType)>)
Create a new LogicalTypeFactory with a custom primitive mapping.
public LogicalTypeFactory(IReadOnlyDictionary<Type, (LogicalType? logicalType, Repetition repetition, PhysicalType physicalType)> primitiveMapping)
Parameters
primitiveMapping
IReadOnlyDictionary<Type, (LogicalType logicalType, Repetition repetition, PhysicalType physicalType)>The mapping from .NET types to Parquet logical and physical types
Fields
Default
The default LogicalTypeFactory instance.
public static readonly LogicalTypeFactory Default
Field Value
DefaultPhysicalTypeMapping
public static readonly IReadOnlyDictionary<PhysicalType, Type> DefaultPhysicalTypeMapping
Field Value
DefaultPrimitiveMapping
List of default mapping for each supported C# type.
public static readonly IReadOnlyDictionary<Type, (LogicalType? logicalType, Repetition repetition, PhysicalType physicalType)> DefaultPrimitiveMapping
Field Value
- IReadOnlyDictionary<Type, (LogicalType logicalType, Repetition repetition, PhysicalType physicalType)>
Properties
DateAsDateOnly
Whether the Parquet Date logical type should be mapped to the .NET DateOnly type by default. If false (the default), then the ParquetSharp.Date type is used.
public bool DateAsDateOnly { get; set; }
Property Value
TimeAsTimeOnly
Whether the Parquet Time logical type should be mapped to the .NET TimeOnly type by default, for millisecond and microsecond precision. If false (the default), then the TimeSpan type is used. For nanosecond precision, ParquetSharp.TimeSpanNanos is always used.
public bool TimeAsTimeOnly { get; set; }
Property Value
Methods
GetSystemTypes(ColumnDescriptor)
Get the mapping from a column descriptor to the actual C# physical and logical element types.
public virtual (Type physicalType, Type logicalType) GetSystemTypes(ColumnDescriptor descriptor)
Parameters
descriptor
ColumnDescriptor
Returns
GetSystemTypes(ColumnDescriptor, Type?)
Get the mapping from a column descriptor to the actual C# physical and logical element types. If we know the exact column logical type, use that instead (i.e. user custom types).
public virtual (Type physicalType, Type logicalType) GetSystemTypes(ColumnDescriptor descriptor, Type? columnLogicalTypeOverride)
Parameters
descriptor
ColumnDescriptorcolumnLogicalTypeOverride
Type
Returns
GetTypesOverride(LogicalType?, LogicalType?, PhysicalType)
Get a new pair of (LogicalType, PhysicalType) taking into account an optional logical type override.
public virtual (LogicalType logicalType, PhysicalType physicalType) GetTypesOverride(LogicalType? logicalTypeOverride, LogicalType? logicalType, PhysicalType physicalType)
Parameters
logicalTypeOverride
LogicalTypelogicalType
LogicalTypephysicalType
PhysicalType
Returns
IsSupported(Type)
Query whether the given C# type is supported and a schema node can potentially be created.
public virtual bool IsSupported(Type type)
Parameters
type
Type
Returns
TryGetParquetTypes(Type, out (LogicalType? logicalType, Repetition repetition, PhysicalType physicalType))
Get the mapping from the C# types to the Parquet logical and physical types.
public virtual bool TryGetParquetTypes(Type logicalSystemType, out (LogicalType? logicalType, Repetition repetition, PhysicalType physicalType) entry)
Parameters
logicalSystemType
Typeentry
(LogicalType logicalType, Repetition repetition, PhysicalType physicalType)