Octonica / ClickHouseClient

ClickHouse .NET Core driver
Apache License 2.0
138 stars 23 forks source link

Extend supported ranges for Date32 and DateTime64 types #66

Closed MaceWindu closed 6 months ago

MaceWindu commented 2 years ago

ClickHouse 22.8 extended value range for Date32 and DateTime64 types to [1900-01-01, 2299-12-31] : https://github.com/ClickHouse/ClickHouse/pull/39425

Currently provider gives following errors:

Date32:

ClickHouseHandledException : The value must be in range [1925-01-01, 2283-11-11].

DateTime64

OverflowException : The value 0xFFB1855D28A1C000 is greater than the maximal value of the type "System.DateTime". It is only possible to read this value as "System.UInt64".
   at Octonica.ClickHouseClient.Types.DateTime64TableColumn.GetValue(Int32 index)
   at Octonica.ClickHouseClient.ClickHouseDataReader.GetFieldValue[T](Int32 ordinal)

PS: Personally I think provider shouldn't validate date/time values and leave it to database.

MrDoe commented 6 months ago

I submitted a pull request for this issue. If you can't wait, you can use my fork: https://github.com/MrDoe/ClickHouseClient

victor-sushko commented 6 months ago

The range was extended in the version 3.1.2.