Hey,
I would like to get the value of a particular dimension for the first (and last) event in a given granularity.
Example:
If I have dimensions = ['timestamp', 'dim1']
I would like to do a TimeSeries (or GroupBy) query to get the value of dim1 for the first and last rows (the rows with the min and max timestamp) in the grouping.
{
"queryType": "timeseries",
"dataSource": "sample_datasource",
"granularity": "day",
...
"intervals": [ "2012-01-01T00:00:00.000/2012-01-03T00:00:00.000" ]
}
One way I can think of doing it is with a min and max aggregator on timestamp, and then a seperate experimental select query to match exactly that timestamp. Or maybe a custom JavaScript aggregator? I was secretly hoping for an aggregator called 'first'!
I'm pretty new to Druid, so any help would be greatly appreciated!
Thanks,
Richard