Druid Query to find time latencies in the incoming events

Hey Folks!

I am new to druid and was playing around the query formulations. I have a specific question, will be great if someone can help me with the right query structure:

Use case example:

I1 = RealTime Event A comes at Time 12:00

I2 = RealTime Event B comes at Time 12:02

I3 = RealTime Event C comes at Time 12:06

In = … so on

I want the calculate different in time between two consecutive intervals for instance the output above should be I2 - I1 ii.e 2 min, I3 - I2 i.e 4 min… so on

any help?



Can you provide a SQL like query over some sample rows ?
That will make the question more clear thought.