Merge pull request #483 from metamx/fix-aggregatefirst-topn-algo

fix NPE in aggregatrFirstTopnAlgo