fmgoncalves/p5-cassandra-simple — Issue #8: bulk update counters (compared to pycassa)
Author: neonknight
Created: 2012-02-28 12:32:49+00:00
State: open

I am currently writing an application that makes heavy use of counter columns, often requiring to bulk update counters. __pycassa__ offers to use *insert()* just the same as *add()*, so does *batch_insert()*:

```
mycolfam.batch_insert({'foobar': {'ccol': {'count': 1}}, 'barfoo': {'ccol': {'count': 1}}})
```

In __cassandra-simple__ this seems not to work:

```
$conn->batch_insert('mycolfam', {'foobar' => {'ccol' => {'count' => 1}}, 'barfoo' => {'ccol' => {'count' => 1}}});
$VAR1 = 'invalid operation for commutative columnfamily mycolfam at /usr/local/share/perl5/Cassandra/Cassandra.pm line 7022, line 3.
';
```
Instead I need to loop over all keys that need to be updated and do individual add() calls. Therefore the same procedure takes much more time in Perl compared to Python. It would be great if __cassandra-simple__ could support *insert()*/*batch_insert()* on counter columns.