Skip to content

Commit

Permalink
Throw exception for unsupported types.
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgi committed May 8, 2024
1 parent 18a5ce8 commit 668c65e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions DuckDB.NET.Data/Internal/Writer/VectorDataWriterFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using DuckDB.NET.Data.Internal.Reader;
using DuckDB.NET.Native;

namespace DuckDB.NET.Data.Internal.Writer;
Expand All @@ -16,14 +15,20 @@ public static unsafe VectorDataWriterBase CreateWriter(IntPtr vector, DuckDBLogi
DuckDBType.Uuid => new GuidVectorDataWriter(vector, dataPointer, columnType),
DuckDBType.Date => new DateTimeVectorDataWriter(vector, dataPointer, columnType),
DuckDBType.Time => new DateTimeVectorDataWriter(vector, dataPointer, columnType),
DuckDBType.TimeTz => throw new NotImplementedException($"Writing {columnType} to data chunk is not yet supported"),
DuckDBType.Interval => new IntervalVectorDataWriter(vector, dataPointer, columnType),
DuckDBType.Timestamp => new DateTimeVectorDataWriter(vector, dataPointer, columnType),

DuckDBType.Boolean => new BooleanVectorDataWriter(vector, dataPointer, columnType),

DuckDBType.Map => throw new NotImplementedException($"Writing {columnType} to data chunk is not yet supported"),
DuckDBType.List => throw new NotImplementedException($"Writing {columnType} to data chunk is not yet supported"),
DuckDBType.Array => throw new NotImplementedException($"Writing {columnType} to data chunk is not yet supported"),
DuckDBType.Blob => new StringVectorDataWriter(vector, dataPointer, columnType),
DuckDBType.Varchar => new StringVectorDataWriter(vector, dataPointer, columnType),

DuckDBType.Bit => throw new NotImplementedException($"Writing {columnType} to data chunk is not yet supported"),
DuckDBType.Enum => throw new NotImplementedException($"Writing {columnType} to data chunk is not yet supported"),
DuckDBType.Struct => throw new NotImplementedException($"Writing {columnType} to data chunk is not yet supported"),
DuckDBType.Decimal => new DecimalVectorDataWriter(vector, dataPointer, logicalType, columnType),
DuckDBType.TimestampS => new DateTimeVectorDataWriter(vector, dataPointer, columnType),
DuckDBType.TimestampMs => new DateTimeVectorDataWriter(vector, dataPointer, columnType),
Expand Down

0 comments on commit 668c65e

Please sign in to comment.