mathk
mathk

Reputation: 8123

How to count event in the last hour grouping by minute

I have an object that contain a timestamp,

class Event{ public long timestamp; }

Now I what to count all events in the last hour grouping by minutes. So I am expecting 60 result.

The query I have try but that give me syntax error near snapshot:

select timestamp.roundFloor(''min'') as timeminute, count(1) 
   from Event
   where timestamp.after(current_timestamp.minus(60 minutes)) 
   group by  timeminute  
   snapshot every 15 sec

How do I build such a query?

Upvotes: 0

Views: 204

Answers (1)

user650839
user650839

Reputation: 2594

Its "output snapshot" and not just "snapshot", see docs.

Upvotes: 1

Related Questions