Most recent row matching a filter

Is there a straight-forward way to get the most recent row (or timestamp of the most recent row) that matches a certain filter? I’d like to determine the extent of data that matches a filter and I already know the start time. I need to know the extent before doing a time series request in order to intelligently choose the granularity.

Thanks for your help!


Hi Duane, timeBoundary queries currently don’t support filters, but it would be a great addition for sure.
I think we already have a github issue for this, do you mind adding your thoughts here ?

Thanks Xavier, I added my support to that issue. In the meantime, is the best way of doing this to do a search with recursive calls to druid doing count aggregations with increasing granularity?

Hi Duane, I think you can issue a timeseries query with a MAX aggregator over the “__time” dimension with a filter. I believe right now this happens to work but isn’t an officially supported thing.