Calculate Mode and Median

Hi,
is there any way to calculate Mode and Median of a field?

I’ve seen that there is the Stat extension available but it only calculates variance and standard deviation.

Does anyone already calculate it (even in javascript eventually)?

Thanks

Maurizio

You can actually do approximate medians and percentiles using the approximate histogram extension.
Refer to docs here - http://druid.io/docs/latest/development/approximate-histograms.html