You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Beier Cai <be...@gmail.com> on 2010/05/13 23:04:07 UTC

Increment and Decrement operation

Is it possible to increment/decrement a column value directly without
reading it first and then do the operation on client side? In mysql you can
do "UPDATE mytable SET counter=counter+1", any equivalent in Cassandra?

Beier, Cai
beiercai@gmail.com

Re: Increment and Decrement operation

Posted by gabriele renzi <rf...@gmail.com>.
On Fri, May 14, 2010 at 12:43 AM, Paul Prescod <pa...@prescod.net> wrote:
> I'm curious what the relevance of CASSANDRA-1016 is.

I guess if you had "operations" moved to the data you could implement
incr/decr easily: read the previous value, add one, write the new
value. This does not yet seem what 1016 is for though :)

Re: Increment and Decrement operation

Posted by Paul Prescod <pa...@prescod.net>.
I'm curious what the relevance of CASSANDRA-1016 is.

On Thu, May 13, 2010 at 2:24 PM, Tobias Jungen <to...@gmail.com> wrote:
> I don't think this is currently possible. There is some work underway to add
> it in the future, however:
>
> https://issues.apache.org/jira/browse/CASSANDRA-721
> https://issues.apache.org/jira/browse/CASSANDRA-1016
>
> On Thu, May 13, 2010 at 4:04 PM, Beier Cai <be...@gmail.com> wrote:
>>
>> Is it possible to increment/decrement a column value directly without
>> reading it first and then do the operation on client side? In mysql you can
>> do "UPDATE mytable SET counter=counter+1", any equivalent in Cassandra?
>>
>> Beier, Cai
>> beiercai@gmail.com
>
>

Re: Increment and Decrement operation

Posted by Tobias Jungen <to...@gmail.com>.
I don't think this is currently possible. There is some work underway to add
it in the future, however:

https://issues.apache.org/jira/browse/CASSANDRA-721
https://issues.apache.org/jira/browse/CASSANDRA-1016

On Thu, May 13, 2010 at 4:04 PM, Beier Cai <be...@gmail.com> wrote:

> Is it possible to increment/decrement a column value directly without
> reading it first and then do the operation on client side? In mysql you can
> do "UPDATE mytable SET counter=counter+1", any equivalent in Cassandra?
>
> Beier, Cai
> beiercai@gmail.com
>

Re: Increment and Decrement operation

Posted by Beier Cai <be...@gmail.com>.
Thanks for the info, hopefully it will make it to the next version

Beier, Cai
beiercai@gmail.com


On Thu, May 13, 2010 at 2:28 PM, Paul Prescod <pa...@prescod.net> wrote:

> No, but there is ongoing work on it:
>
>  * https://issues.apache.org/jira/browse/CASSANDRA-580
>
>  * http://www.formspring.me/joestump/q/420668558
>
>  * http://permalink.gmane.org/gmane.comp.db.cassandra.user/3740
>
> And in the meantime, an interim patch:
>
>  * https://issues.apache.org/jira/browse/CASSANDRA-721
>
> On Thu, May 13, 2010 at 2:04 PM, Beier Cai <be...@gmail.com> wrote:
> > Is it possible to increment/decrement a column value directly without
> > reading it first and then do the operation on client side? In mysql you
> can
> > do "UPDATE mytable SET counter=counter+1", any equivalent in Cassandra?
> >
> > Beier, Cai
> > beiercai@gmail.com
> >
>

Re: Increment and Decrement operation

Posted by Paul Prescod <pa...@prescod.net>.
No, but there is ongoing work on it:

 * https://issues.apache.org/jira/browse/CASSANDRA-580

 * http://www.formspring.me/joestump/q/420668558

 * http://permalink.gmane.org/gmane.comp.db.cassandra.user/3740

And in the meantime, an interim patch:

 * https://issues.apache.org/jira/browse/CASSANDRA-721

On Thu, May 13, 2010 at 2:04 PM, Beier Cai <be...@gmail.com> wrote:
> Is it possible to increment/decrement a column value directly without
> reading it first and then do the operation on client side? In mysql you can
> do "UPDATE mytable SET counter=counter+1", any equivalent in Cassandra?
>
> Beier, Cai
> beiercai@gmail.com
>