On 10/13/2016 08:11 PM, Alexei Levashov wrote:
> Previously I did it in a logged batch without any issues but upgrading
> from Cassandra 1.2.x to 2.1 brings the following Exception message:
> "Error executing batch. Message: Cannot include a counter statement in a
> logged batch"
> 
> Question: 
> It looks like exception thrown from this line:
> 
> if (isLogged() && statement.isCounter()) throw new
> InvalidRequestException("Cannot include a counter statement in a logged
> batch");
> <https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java#L172>
> Why does DELETE statement for the table containing counter field return
> isCounter() == true? 
> Is it a bug or expected behavior?

This appears to be expected behavior.

If you look at blame on the line you linked, it was commit ee401cf8
which you can follow to the commit:

https://github.com/apache/cassandra/commit/ee401cf8131a779069805cbe9ef4ab05d4a63b9a

Which notes: CASSANDRA-7351
 https://issues.apache.org/jira/browse/CASSANDRA-7351

It looks like you may use UNLOGGED batch.

-- 
Kind regards,
Michael

Reply via email to