Cassandra gives timestamp less than DateTimeOffset.MinValue unix time millisecond
Description
as known, people started to use Gregorian calendar on 14.09.1752. Some articls say that, dates before 14 september 1752 (pre-Gregorian calendar) are not accurate.
lets get to the point i have a table on cassandra as below
i inserted a row to the table data with -56957231417000 by the way ->> -56957231417000 = ‘0165-02-04 18:49:43’
and then i select the data and it seems as below
date value row that came from selection is correct as timestamp, but incorrect as date, it has extra 1 day. and then i inserted a row to the table data with '0165-02-04 18:49:43'
and it seems as below, it is correct as date but incorrect as timestamp.
i understand that dates before pre-Gregorian calendar, value of timestamp column is unreliable in cassandra. because when i add the row to the table with '0001-01-01 00:00:00', cassandra gives timestamp value as -62135780400000.
That value an invalid date.
Deserialize method in DateTimeOffsetSerializer throws exception.
because that timestamp value is less than DateTimeOffset.MinValue.
i think we need to add a if block that set min value of DateTimeOffset if timestamp less than the min value, because cassandra supports it and someone can add the date ('0001-01-01 00:00:00')
Environment
None
Attachments
2
Activity
Show:
okan lodos
July 29, 2022 at 8:39 PM
(edited)
@Joao Reis The data is our production data unfortunately, this is a blocker for us, because we have a table that its size is big data, also data model of table has complex types.
Updating the data that contains invalid timestamp is really hard because of size, In fact we don't want to update them.
Another applications like java can still insert data with invalid timestamp to the table.
Joao Reis
July 29, 2022 at 3:01 PM
(edited)
Hi, thanks for opening this ticket and submitting a PR!
We just recently released a new minor version of the C# driver and we don’t have plans for a C# driver release during the next couple of months so it might take a while for us to take a look at this ticket and your PR.
Is this a blocker or was this something that you ran into while doing some testing with unrealistic data?
as known, people started to use Gregorian calendar on 14.09.1752.
Some articls say that, dates before 14 september 1752 (pre-Gregorian calendar) are not accurate.
lets get to the point
i have a table on cassandra as below
i inserted a row to the table data with -56957231417000
by the way ->> -56957231417000 = ‘0165-02-04 18:49:43’
and then i select the data and it seems as below
date value row that came from selection is correct as timestamp, but incorrect as date, it has extra 1 day.
and then i inserted a row to the table data with '0165-02-04 18:49:43'
and it seems as below, it is correct as date but incorrect as timestamp.
i understand that dates before pre-Gregorian calendar, value of timestamp column is unreliable in cassandra.
because when i add the row to the table with '0001-01-01 00:00:00', cassandra gives timestamp value as -62135780400000.
That value an invalid date.
Deserialize method in DateTimeOffsetSerializer throws exception.
because that timestamp value is less than DateTimeOffset.MinValue.
i think we need to add a if block that set min value of DateTimeOffset if timestamp less than the min value, because cassandra supports it and someone can add the date ('0001-01-01 00:00:00')