18
18
package ing .wbaa .druid
19
19
package definitions
20
20
21
+ import ca .mrvisser .sealerate
22
+ import io .circe ._
21
23
import io .circe .generic .auto ._
22
24
import io .circe .syntax ._
23
- import io .circe ._
24
25
25
26
sealed trait AggregationType extends Enum with CamelCaseEnumStringEncoder
26
27
object AggregationType extends EnumCodec [AggregationType ] {
@@ -35,18 +36,9 @@ object AggregationType extends EnumCodec[AggregationType] {
35
36
case object DoubleLast extends AggregationType
36
37
case object LongFirst extends AggregationType
37
38
case object LongLast extends AggregationType
39
+ case object ThetaSketch extends AggregationType
38
40
39
- val values = Set (Count ,
40
- LongSum ,
41
- DoubleSum ,
42
- DoubleMax ,
43
- DoubleMin ,
44
- LongMin ,
45
- LongMax ,
46
- DoubleFirst ,
47
- DoubleLast ,
48
- LongFirst ,
49
- LongLast )
41
+ val values : Set [AggregationType ] = sealerate.values[AggregationType ]
50
42
}
51
43
52
44
trait Aggregation {
@@ -81,6 +73,7 @@ object SingleFieldAggregation {
81
73
case x : DoubleLastAggregation => x.asJson
82
74
case x : LongLastAggregation => x.asJson
83
75
case x : LongFirstAggregation => x.asJson
76
+ case x : ThetaSketchAggregation => x.asJson
84
77
}
85
78
}
86
79
}
@@ -116,3 +109,8 @@ case class LongFirstAggregation(name: String, fieldName: String) extends SingleF
116
109
case class LongLastAggregation (name : String , fieldName : String ) extends SingleFieldAggregation {
117
110
val `type` = AggregationType .LongLast
118
111
}
112
+ case class ThetaSketchAggregation (name : String , fieldName : String , isInputThetaSketch : Boolean = false ,
113
+ size : Long = 16384 )
114
+ extends SingleFieldAggregation {
115
+ val `type` = AggregationType .ThetaSketch
116
+ }
0 commit comments