Replace min/max by longMin, doubleMin, longMax and doubleMax

This commit is contained in:
Matthieu Sprunck 2016-09-29 16:53:29 +02:00
parent 3c67327f52
commit 220adce2a8
2 changed files with 23 additions and 9 deletions

View file

@ -1,4 +1,4 @@
(defproject y42/clj-druid "0.2.13-SNAPSHOT" (defproject y42/clj-druid "0.2.14-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"

View file

@ -20,15 +20,27 @@
:name s/Str :name s/Str
:fieldName s/Str}) :fieldName s/Str})
(s/defschema minAggregator (s/defschema doubleMinAggregator
"min computes the minimum metric value" "computes the minimum of all metric values and Double.POSITIVE_INFINITY"
{:type (s/enum :min) {:type (s/enum :doubleMin)
:name s/Str :name s/Str
:fieldName s/Str}) :fieldName s/Str})
(s/defschema maxAggregator (s/defschema longMinAggregator
"max computes the maximum metric value" "computes the minimum of all metric values and Long.MAX_VALUE"
{:type (s/enum :max) {:type (s/enum :longMin)
:name s/Str
:fieldName s/Str})
(s/defschema doubleMaxAggregator
"computes the maximum of all metric values and Double.NEGATIVE_INFINITY"
{:type (s/enum :doubleMax)
:name s/Str
:fieldName s/Str})
(s/defschema longMaxAggregator
"computes the maximum of all metric values and Long.MIN_VALUE"
{:type (s/enum :longMax)
:name s/Str :name s/Str
:fieldName s/Str}) :fieldName s/Str})
@ -70,8 +82,10 @@ This makes it possible to compute the results of a filtered and an unfiltered ag
#(= :count (:type %)) countAggregator #(= :count (:type %)) countAggregator
#(= :longSum (:type %)) longSumAggregator #(= :longSum (:type %)) longSumAggregator
#(= :doubleSum (:type %)) doubleSumAggregator #(= :doubleSum (:type %)) doubleSumAggregator
#(= :min (:type %)) minAggregator #(= :longMin (:type %)) longMinAggregator
#(= :max (:type %)) maxAggregator #(= :doubleMin (:type %)) doubleMinAggregator
#(= :longMax (:type %)) longMaxAggregator
#(= :doubleMax (:type %)) doubleMaxAggregator
#(= :javascript (:type %)) javascriptAggregator #(= :javascript (:type %)) javascriptAggregator
#(= :cardinality (:type %)) cardinalityAggregator #(= :cardinality (:type %)) cardinalityAggregator
#(= :hyperUnique (:type %)) hyperUniqueAggregator #(= :hyperUnique (:type %)) hyperUniqueAggregator