bottomN query ??

Hi all,

Are there some druid extension or workaround to do bottomN query instead of topN query??

Regards,

Andrés

you can use Inverted topN metric spec.
Refer http://druid.io/docs/latest/querying/topnmetricspec.html for details.

Ohh!! Thanks :slight_smile:

Andrés Gómez

Big Data Development Manager

agomez@redborder.com
+34 606224922 | +34 955 601 160

Just FYI, topN in as approximate (it does a local topN before a global) so for very large qty of results (tens of thousands or more) which are returning the top <>, the results will be most accurate for large skew, which is what people are normally looking for.

If you’re looking at the bottom of something, you’re usually looking at things that are almost equal in result. As such both the ordering and actual results are going to be approximate for small results of large potential results (ex: bottom 100 out of 1M). And unless you’re looking for the rare 0’s in a large dataset, might not give you the kind of information you are hoping for.

If your potential result set is less than 1000 then it should be perfectly accurate in result and ordering. (ex: bottom or top 10 of 500)

Ok! I understand :slight_smile:

Thanks again!!

Andrés Gómez

Big Data Development Manager

agomez@redborder.com
+34 606224922 | +34 955 601 160