Kassandra: Failed to force "2016-04-06 13: 06: 11.534000" to the formatted date (long)

I am trying to UPDATE an existing item in my cassandra database using cqlsh:

$ > UPDATE allEvents SET "isLastEvent" = True WHERE "websiteId" = 'sd-8231'
AND "purchaser" = False
AND "currentTime" = '2016-04-06 13:06:11.534000';

And I got this:

InvalidRequest: code = 2200 [Invalid query] message = "Failed to force '2016-04-06 13: 06: 11.534000' to the formatted date (long)"

In case this may help:

$ > show version
[cqlsh 5.0.1 | Cassandra 3.0.2 | CQL spec 3.3.1 | Native protocol v4]
+4
source share
1 answer

This is because Cassandra timestamps only support milliseconds. Your currentTimeaccuracy is too high. Cut off the last three zeros and this should work:

UPDATE allEvents SET "isLastEvent" = True 
WHERE "websiteId" = 'sd-8231'
      AND "purchaser" = False 
      AND "currentTime" = '2016-04-06 13:06:11.534';
+9
source

All Articles