Skip to content

Commit

Permalink
Merge pull request #107 from zapr-oss/develop
Browse files Browse the repository at this point in the history
v2.14 release
  • Loading branch information
abhi-zapr authored Aug 10, 2019
2 parents 6bf734a + 3ac68c0 commit 048d431
Show file tree
Hide file tree
Showing 62 changed files with 3,398 additions and 18 deletions.
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,14 @@ Supported Features
* LongSum
* LongFirst
* LongLast
* ThetaSketch
* DistinctCount
* Histogram
* [Data Sketches](https://druid.apache.org/docs/latest/development/extensions-core/datasketches-extension.html)
* ThetaSketch
* TupleSketch
* QuantilesSketch
* HllSketchBuild
* HllSketchMerge

#### Filters

Expand All @@ -227,8 +232,32 @@ Supported Features
* FieldAccess
* HyperUniqueCardinality
* Javascript
* ThetaSketchEstimate
* ThetaSketchSetOp
* [Data Sketches](https://druid.apache.org/docs/latest/development/extensions-core/datasketches-extension.html)
* [Theta Sketch](https://druid.apache.org/docs/latest/development/extensions-core/datasketches-theta.html)
* ThetaSketchEstimate
* ThetaSketchSetOp
* [Tuple Sketch](https://druid.apache.org/docs/latest/development/extensions-core/datasketches-tuple.html)
* TupleSketchToEstimate
* TupleSketchToEstimateAndBounds
* TupleSketchToNumEntries
* TupleSketchToMeans
* TupleSketchToVariances
* TupleSketchToQuantilesSketch
* TupleSketchSetOp
* TupleSketchTTest
* TupleSketchToString
* [Quantiles Sketch](https://druid.apache.org/docs/latest/development/extensions-core/datasketches-quantiles.html)
* QuantilesSketchToQuantile
* QuantilesSketchToQuantiles
* QuantilesSketchToHistogram
* QuantilesSketchToString
* [HLL Sketch](https://druid.apache.org/docs/latest/development/extensions-core/datasketches-hll.html)
* HllSketchEstimateWithBounds
* HllSketchUnion
* HllSketchToString

#### Virtual Columns
* Expression

#### Granularity
* Duration
Expand Down
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>in.zapr.druid</groupId>
<artifactId>druidry</artifactId>
<version>2.13</version>
<version>2.14</version>

<name>Druidry - Druid Java Client</name>
<description>Druidry is an open-source Java based utility library which supports creating
Expand All @@ -16,7 +16,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson.version>2.9.8</jackson.version>
<jackson.databind.version>2.9.9.2</jackson.databind.version>
<jackson.datatype.version>2.9.9</jackson.datatype.version>
<jodatime.version>2.9.7</jodatime.version>
<lombok.version>1.16.14</lombok.version>
<testng.version>6.11</testng.version>
Expand All @@ -38,13 +39,13 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<version>${jackson.databind.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson.version}</version>
<version>${jackson.datatype.version}</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.fasterxml.jackson.annotation.JsonValue;

public enum OutputType {
STRING, LONG, FLOAT;
STRING, LONG, FLOAT, DOUBLE;

@JsonValue
public String getName() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package in.zapr.druid.druidry.extensions.datasketches.aggregator;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import in.zapr.druid.druidry.aggregator.DruidAggregator;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;

@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class HllSketchBuildAggregator extends DruidAggregator {

private static final String HLL_SKETCH_BUILD_TYPE_AGGREGATOR = "HLLSketchBuild";
private String fieldName;
private Integer lgK;
@JsonProperty("tgtHllType")
private TargetHllType targetHllType;

@Builder
private HllSketchBuildAggregator(@NonNull String name,
@NonNull String fieldName,
Integer lgK,
TargetHllType targetHllType) {
this.type = HLL_SKETCH_BUILD_TYPE_AGGREGATOR;
this.name = name;
this.fieldName = fieldName;
this.lgK = lgK;
this.targetHllType = targetHllType;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package in.zapr.druid.druidry.extensions.datasketches.aggregator;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import in.zapr.druid.druidry.aggregator.DruidAggregator;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;

@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class HllSketchMergeAggregator extends DruidAggregator {

private static final String HLL_SKETCH_MERGE_TYPE_AGGREGATOR = "HLLSketchMerge";

private String fieldName;
private Integer lgK;
@JsonProperty("tgtHllType")
private TargetHllType targetHllType;

@Builder
private HllSketchMergeAggregator(@NonNull String name,
@NonNull String fieldName,
Integer lgK,
TargetHllType targetHllType) {
this.type = HLL_SKETCH_MERGE_TYPE_AGGREGATOR;
this.name = name;
this.fieldName = fieldName;
this.lgK = lgK;
this.targetHllType = targetHllType;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package in.zapr.druid.druidry.extensions.datasketches.aggregator;

import com.google.common.base.Preconditions;
import com.google.common.math.LongMath;

import com.fasterxml.jackson.annotation.JsonInclude;

import in.zapr.druid.druidry.aggregator.DruidAggregator;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;

@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class QuantilesSketchAggregator extends DruidAggregator {

private static final String QUANTILES_SKETCH_TYPE_AGGREGATOR = "quantilesDoublesSketch";
private String fieldName;
private Integer k;

@Builder
private QuantilesSketchAggregator(@NonNull String name,
@NonNull String fieldName,
Integer k) {
this.type = QUANTILES_SKETCH_TYPE_AGGREGATOR;
this.name = name;
this.fieldName = fieldName;
this.k = k;

if (k != null) {
Preconditions.checkArgument(LongMath.isPowerOfTwo(k), "k must be a power of 2");
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package in.zapr.druid.druidry.extensions.datasketches.aggregator;

import com.fasterxml.jackson.annotation.JsonValue;

public enum TargetHllType {

HLL_4("HLL_4"),
HLL_6("HLL_6"),
HLL_8("HLL_8");

private String value;

TargetHllType(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@

import in.zapr.druid.druidry.aggregator.DruidAggregator;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;

@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class ThetaSketchAggregator extends DruidAggregator {

private static final String THETA_SKETCH_TYPE_AGGREGATOR = "thetaSketch";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package in.zapr.druid.druidry.extensions.datasketches.aggregator;

import com.google.common.base.Preconditions;
import com.google.common.math.LongMath;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;

import in.zapr.druid.druidry.aggregator.DruidAggregator;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;

@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class TupleSketchAggregator extends DruidAggregator {

private static final String TUPLE_SKETCH_TYPE_AGGREGATOR = "arrayOfDoublesSketch";
private String fieldName;
private Integer nominalEntries;
private Integer numberOfValues;
private List<String> metricColumns;

@Builder
private TupleSketchAggregator(@NonNull String name,
@NonNull String fieldName,
Integer nominalEntries,
Integer numberOfValues,
List<String> metricColumns) {
this.type = TUPLE_SKETCH_TYPE_AGGREGATOR;
this.name = name;
this.fieldName = fieldName;
this.nominalEntries = nominalEntries;
this.numberOfValues = numberOfValues;
this.metricColumns = metricColumns;

if (nominalEntries != null) {
Preconditions.checkArgument(LongMath.isPowerOfTwo(nominalEntries), "nominalEntries must be a power of 2");
}
}

}
Loading

0 comments on commit 048d431

Please sign in to comment.