incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven A Robenalt <srobe...@stanford.edu>
Subject Re: Is it possible to set a counter to zero using CQL?
Date Thu, 13 Feb 2014 02:46:29 GMT
Hi Jacob,

I get the same effect using:

update mytable set count = count + 0 where day = "20140103"

The count field is changed from null to zero as a result.

Steve



On Wed, Feb 12, 2014 at 6:31 PM, Jacob Rhoden <jacob.rhoden@me.com> wrote:

> Hi Guys,
> My question is probably best described by example. Is it possible to
> indicate that on a particular day, the total number of "events" were zero.
>
> // Three events today
> update mytable count=count+1 where day="20140101"
> update mytable count=count+1 where day="20140101"
> update mytable count=count+1 where day="20140101"
> update mytable count=count+1 where day="20140101"
>
> // Two events today
> update mytable count=count+1 where day="20140102"
> update mytable count=count+1 where day="20140102"
>
> // Zero events today, so do a count+1 and count-1 to get a zero
> update mytable count=count+1 where day="20140103"
> update mytable count=count-1 where day="20140103"
>
>
> I need to be able to distinguish between knowing if zero events occurred
> on that day, or no processing of data occurred on that day.
>
> Thanks,
> Jacob
>



-- 
Steve Robenalt
Software Architect
HighWire | Stanford University
425 Broadway St, Redwood City, CA 94063

srobenal@stanford.edu
http://highwire.stanford.edu

Mime
View raw message