fixed filtered aggregator
This commit is contained in:
parent
e0f0880b36
commit
b874e76dbc
2 changed files with 17 additions and 7 deletions
|
@ -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"
|
:description "Clojure library for Druid.io"
|
||||||
:url "http://github.com/y42/clj-druid"
|
:url "http://github.com/y42/clj-druid"
|
||||||
:license {:name "Eclipse Public License"
|
:license {:name "Eclipse Public License"
|
||||||
|
|
|
@ -54,6 +54,21 @@
|
||||||
:name s/Str
|
:name s/Str
|
||||||
:fieldName 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
|
(s/defschema aggregation
|
||||||
"Aggregations are specifications of processing over metrics available in Druid"
|
"Aggregations are specifications of processing over metrics available in Druid"
|
||||||
(s/conditional
|
(s/conditional
|
||||||
|
@ -66,10 +81,5 @@
|
||||||
#(= :cardinality (:type %)) cardinalityAggregator
|
#(= :cardinality (:type %)) cardinalityAggregator
|
||||||
#(= :hyperUnique (:type %)) hyperUniqueAggregator))
|
#(= :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})
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue