@@ -12,13 +12,11 @@ internal sealed class DateTimeVectorDataReader : VectorDataReaderBase
1212 private static readonly Type DateTimeOffsetType = typeof ( DateTimeOffset ) ;
1313 private static readonly Type DateTimeOffsetNullableType = typeof ( DateTimeOffset ? ) ;
1414
15- #if NET6_0_OR_GREATER
1615 private static readonly Type DateOnlyType = typeof ( DateOnly ) ;
1716 private static readonly Type DateOnlyNullableType = typeof ( DateOnly ? ) ;
1817
1918 private static readonly Type TimeOnlyType = typeof ( TimeOnly ) ;
2019 private static readonly Type TimeOnlyNullableType = typeof ( TimeOnly ? ) ;
21- #endif
2220
2321 internal unsafe DateTimeVectorDataReader ( void * dataPointer , ulong * validityMaskPointer , DuckDBType columnType , string columnName ) : base ( dataPointer , validityMaskPointer , columnType , columnName )
2422 {
@@ -37,12 +35,10 @@ protected override T GetValidValue<T>(ulong offset, Type targetType)
3735 ThrowInfinityDateException ( ) ;
3836 }
3937
40- #if NET6_0_OR_GREATER
4138 if ( targetType == DateOnlyType || targetType == DateOnlyNullableType )
4239 {
4340 ThrowInfinityDateException ( ) ;
4441 }
45- #endif
4642 return ( T ) ( object ) dateOnly ;
4743 }
4844
@@ -52,13 +48,11 @@ protected override T GetValidValue<T>(ulong offset, Type targetType)
5248 return ( T ) ( object ) dateTime ;
5349 }
5450
55- #if NET6_0_OR_GREATER
5651 if ( targetType == DateOnlyType || targetType == DateOnlyNullableType )
5752 {
5853 var dateTime = ( DateOnly ) dateOnly ;
5954 return ( T ) ( object ) dateTime ;
6055 }
61- #endif
6256 return ( T ) ( object ) dateOnly ;
6357 }
6458
@@ -72,13 +66,11 @@ protected override T GetValidValue<T>(ulong offset, Type targetType)
7266 return ( T ) ( object ) dateTime ;
7367 }
7468
75- #if NET6_0_OR_GREATER
7669 if ( targetType == TimeOnlyType || targetType == TimeOnlyNullableType )
7770 {
7871 var dateTime = ( TimeOnly ) timeOnly ;
7972 return ( T ) ( object ) dateTime ;
8073 }
81- #endif
8274 return ( T ) ( object ) timeOnly ;
8375 }
8476
@@ -186,12 +178,10 @@ private object GetDate(ulong offset, Type targetType)
186178 ThrowInfinityDateException ( ) ;
187179 }
188180
189- #if NET6_0_OR_GREATER
190181 if ( targetType == DateOnlyType )
191182 {
192183 ThrowInfinityDateException ( ) ;
193184 }
194- #endif
195185
196186 return dateOnly ;
197187 }
@@ -201,12 +191,10 @@ private object GetDate(ulong offset, Type targetType)
201191 return ( DateTime ) dateOnly ;
202192 }
203193
204- #if NET6_0_OR_GREATER
205194 if ( targetType == DateOnlyType )
206195 {
207196 return ( DateOnly ) dateOnly ;
208197 }
209- #endif
210198
211199 return dateOnly ;
212200 }
@@ -219,12 +207,10 @@ private object GetTime(ulong offset, Type targetType)
219207 return ( DateTime ) timeOnly ;
220208 }
221209
222- #if NET6_0_OR_GREATER
223210 if ( targetType == TimeOnlyType )
224211 {
225212 return ( TimeOnly ) timeOnly ;
226213 }
227- #endif
228214
229215 return timeOnly ;
230216 }
0 commit comments