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:


Which notes: CASSANDRA-7351

It looks like you may use UNLOGGED batch.

Kind regards,

Reply via email to