Query that returns last value.

Hi all,

I have a question about queries. Is possible to do a query that returns the last data value without indicate the interval query or something like this???

I know that the time boundary query returns the earliest and latest data points of a data set, but we can that the query return the last data.

Regards,

Andrés

This is a common request and one that is not yet supported in Druid, however https://github.com/druid-io/druid/pull/3168 is an attempt to add functionality to extend timeboundary to work with filters

Hey Andrés,

If you want the last full row matching a particular filter (or no filter at all) then you can do a descending “select” query with threshold 1.

If you want to tabulate the last values of some specific column as part of a timeseries or groupBy query then you probably want the (currently not implemented) “last” aggregator that FJ mentioned.

ok thanks :slight_smile: