fixed filtered aggregator

This commit is contained in:
Guillaume Buisson 2016-02-05 19:01:10 +01:00
parent e0f0880b36
commit b874e76dbc
2 changed files with 17 additions and 7 deletions

View file

@ -1,4 +1,4 @@
(defproject y42/clj-druid "0.2.10"
(defproject y42/clj-druid "0.2.11-SNAPSHOT"
:description "Clojure library for Druid.io"
:url "http://github.com/y42/clj-druid"
:license {:name "Eclipse Public License"

View file

@ -54,6 +54,21 @@
:name s/Str
:fieldName s/Str})
(s/defschema filteredAggregator
"A filtered aggregator wraps any given aggregator, but only aggregates the values for which the given dimension filter matches.
This makes it possible to compute the results of a filtered and an unfiltered aggregation simultaneously, without having to issue multiple queries, and use both results as part of post-aggregations."
{:type (s/enum :filtered)
:filter Filter
:aggregator (s/conditional
#(= :count (:type %)) countAggregator
#(= :longSum (:type %)) longSumAggregator
#(= :doubleSum (:type %)) doubleSumAggregator
#(= :min (:type %)) minAggregator
#(= :max (:type %)) maxAggregator
#(= :javascript (:type %)) javascriptAggregator
#(= :cardinality (:type %)) cardinalityAggregator
#(= :hyperUnique (:type %)) hyperUniqueAggregator)})
(s/defschema aggregation
"Aggregations are specifications of processing over metrics available in Druid"
(s/conditional
@ -66,10 +81,5 @@
#(= :cardinality (:type %)) cardinalityAggregator
#(= :hyperUnique (:type %)) hyperUniqueAggregator))
(s/defschema filteredAggregator
"A filtered aggregator wraps any given aggregator, but only aggregates the values for which the given dimension filter matches.
This makes it possible to compute the results of a filtered and an unfiltered aggregation simultaneously, without having to issue multiple queries, and use both results as part of post-aggregations."
{:type (s/enum :filtered)
:filter Filter
:aggregator aggregation})