Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.14 release #107

Merged
merged 29 commits into from
Aug 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9de170e
Add errorBoundsStdDev to ThetaSketch postAggregation. Allow dimension…
Nov 26, 2018
b5a6a7b
use builder, remove primitive, change jackson annotation
Dec 7, 2018
06e5c33
non-null dimensionin groupByQuery
Dec 7, 2018
a7105ae
Add virtual columns support.
vchimishuk Feb 19, 2019
1fc7bcb
Add virtual column support also for scan, search and select queries. …
vchimishuk Feb 28, 2019
f2f32bc
Updated Jackson version to 2.9.9
gagangupt16 May 28, 2019
d1b34bd
Merge pull request #66 from st0ckface/allow-null-dimension
abhi-zapr Jun 15, 2019
90c3531
change constructor to builder in test cases
Jun 15, 2019
a6688cc
two constructor rather than a builder because builder would be breaki…
Jun 22, 2019
2b660a7
Quantiles and Tuple Sketches Implementation
abhi-zapr Aug 1, 2019
4dae1d4
Update pom.xml
siddharthsa Aug 2, 2019
2dd68e8
HLL sketch implementation & copyright licenses in all files
abhi-zapr Aug 3, 2019
3691f0c
readme update for data sketches
abhi-zapr Aug 3, 2019
b32815e
refactoring
abhi-zapr Aug 3, 2019
1637e5d
refactoring README
abhi-zapr Aug 3, 2019
debbd92
datasketches test cases
abhi-zapr Aug 3, 2019
aa69bbd
EqualsAndHashCode
abhi-zapr Aug 3, 2019
1d3726b
Version bumped to 2.14-SNAPSHOT
abhi-zapr Aug 10, 2019
865f0db
spellCheck refactor
abhi-zapr Aug 10, 2019
79e134b
Merge pull request #99 from abhi195/thetaSketch-errorBoundsStdDev
abhi-zapr Aug 10, 2019
552a7c6
Merge pull request #105 from zapr-oss/thetaSketch-errorBoundsStdDev
abhi-zapr Aug 10, 2019
43cb048
conflict resolve
abhi-zapr Aug 10, 2019
301b063
Merge pull request #86 from vchimishuk/virtual-columns
abhi-zapr Aug 10, 2019
b196b50
Merge pull request #93 from gagangupt16/JacksonDependencyUpdate
abhi-zapr Aug 10, 2019
48fdac3
seperating databind and datatype version
abhi-zapr Aug 10, 2019
c116366
Merge branch 'develop' into patch-1
abhi-zapr Aug 10, 2019
0ba852d
Merge pull request #102 from siddharthsa/patch-1
abhi-zapr Aug 10, 2019
611f6d9
Merge pull request #103 from abhi195/data-sketches
abhi-zapr Aug 10, 2019
3ac68c0
Version bumped to 2.14 for next release
abhi-zapr Aug 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
datasketches test cases
  • Loading branch information
abhi-zapr committed Aug 3, 2019
commit debbd9201f3982a29562e095f25c3fde20fcd993
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* 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:https://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.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.json.JSONException;
import org.json.JSONObject;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class HllSketchBuildAggregatorTest {

private static ObjectMapper objectMapper;

@BeforeClass
public void init() {
objectMapper = new ObjectMapper();
}

private JSONObject getHllSketchBuildAggregatorJSON() throws JSONException {

JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "HLLSketchBuild");
jsonObject.put("name", "stars_hll");
return jsonObject;
}

@Test
public void testAllFields() throws JsonProcessingException, JSONException {

HllSketchBuildAggregator hllSketchBuildAggregator = HllSketchBuildAggregator.builder()
.name("stars_hll")
.fieldName("stars")
.lgK(4)
.targetHllType(TargetHllType.HLL_4)
.build();

JSONObject jsonObject = getHllSketchBuildAggregatorJSON();
jsonObject.put("fieldName", "stars");
jsonObject.put("lgK", 4);
jsonObject.put("tgtHllType", "HLL_4");

String actualJSON = objectMapper.writeValueAsString(hllSketchBuildAggregator);
String expectedJSON = jsonObject.toString();
JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
}

@Test
public void testRequiredFields() throws JsonProcessingException, JSONException {

HllSketchBuildAggregator hllSketchBuildAggregator = HllSketchBuildAggregator.builder()
.name("stars_hll")
.fieldName("stars")
.build();

JSONObject jsonObject = getHllSketchBuildAggregatorJSON();
jsonObject.put("fieldName", "stars");

String actualJSON = objectMapper.writeValueAsString(hllSketchBuildAggregator);
String expectedJSON = jsonObject.toString();
JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
}

@Test(expectedExceptions = NullPointerException.class)
public void testNullName() {

HllSketchBuildAggregator hllSketchBuildAggregator = HllSketchBuildAggregator.builder()
.fieldName("stars")
.build();
}

@Test(expectedExceptions = NullPointerException.class)
public void testNullFieldName() {

HllSketchBuildAggregator hllSketchBuildAggregator = HllSketchBuildAggregator.builder()
.name("stars_hll")
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* 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:https://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.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.json.JSONException;
import org.json.JSONObject;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class HllSketchMergeAggregatorTest {

private static ObjectMapper objectMapper;

@BeforeClass
public void init() {
objectMapper = new ObjectMapper();
}

private JSONObject getHllSketchMergeAggregatorJSON() throws JSONException {

JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "HLLSketchMerge");
jsonObject.put("name", "stars_hll");
return jsonObject;
}

@Test
public void testAllFields() throws JsonProcessingException, JSONException {

HllSketchMergeAggregator hllSketchMergeAggregator = HllSketchMergeAggregator.builder()
.name("stars_hll")
.fieldName("stars")
.lgK(4)
.targetHllType(TargetHllType.HLL_4)
.build();

JSONObject jsonObject = getHllSketchMergeAggregatorJSON();
jsonObject.put("fieldName", "stars");
jsonObject.put("lgK", 4);
jsonObject.put("tgtHllType", "HLL_4");

String actualJSON = objectMapper.writeValueAsString(hllSketchMergeAggregator);
String expectedJSON = jsonObject.toString();
JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
}

@Test
public void testRequiredFields() throws JsonProcessingException, JSONException {

HllSketchMergeAggregator hllSketchMergeAggregator = HllSketchMergeAggregator.builder()
.name("stars_hll")
.fieldName("stars")
.build();

JSONObject jsonObject = getHllSketchMergeAggregatorJSON();
jsonObject.put("fieldName", "stars");

String actualJSON = objectMapper.writeValueAsString(hllSketchMergeAggregator);
String expectedJSON = jsonObject.toString();
JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
}

@Test(expectedExceptions = NullPointerException.class)
public void testNullName() {

HllSketchMergeAggregator hllSketchMergeAggregator = HllSketchMergeAggregator.builder()
.fieldName("stars")
.build();
}

@Test(expectedExceptions = NullPointerException.class)
public void testNullFieldName() {

HllSketchMergeAggregator hllSketchMergeAggregator = HllSketchMergeAggregator.builder()
.name("stars_hll")
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
* 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:https://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.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.json.JSONException;
import org.json.JSONObject;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class QuantilesSketchAggregatorTest {

private static ObjectMapper objectMapper;

@BeforeClass
public void init() {
objectMapper = new ObjectMapper();
}

private JSONObject getQuantilesSketchAggregatorJSON() throws JSONException {

JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "quantilesDoublesSketch");
jsonObject.put("name", "star_age_quantiles_sketch");
return jsonObject;
}

@Test
public void testAllFields() throws JsonProcessingException, JSONException {

QuantilesSketchAggregator quantilesSketchAggregator = QuantilesSketchAggregator.builder()
.name("star_age_quantiles_sketch")
.fieldName("star_age")
.k(1024)
.build();

JSONObject jsonObject = getQuantilesSketchAggregatorJSON();
jsonObject.put("fieldName", "star_age");
jsonObject.put("k", 1024);

String actualJSON = objectMapper.writeValueAsString(quantilesSketchAggregator);
String expectedJSON = jsonObject.toString();
JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
}

@Test
public void testRequiredFields() throws JsonProcessingException, JSONException {

QuantilesSketchAggregator quantilesSketchAggregator = QuantilesSketchAggregator.builder()
.name("star_age_quantiles_sketch")
.fieldName("star_age")
.build();

JSONObject jsonObject = getQuantilesSketchAggregatorJSON();
jsonObject.put("fieldName", "star_age");

String actualJSON = objectMapper.writeValueAsString(quantilesSketchAggregator);
String expectedJSON = jsonObject.toString();
JSONAssert.assertEquals(expectedJSON, actualJSON, JSONCompareMode.NON_EXTENSIBLE);
}

@Test(expectedExceptions = IllegalArgumentException.class)
public void preconditionCheck() {

QuantilesSketchAggregator quantilesSketchAggregator = QuantilesSketchAggregator.builder()
.name("star_age_quantiles_sketch")
.fieldName("star_age")
.k(3)
.build();
}

@Test(expectedExceptions = NullPointerException.class)
public void testNullName() {

QuantilesSketchAggregator quantilesSketchAggregator = QuantilesSketchAggregator.builder()
.fieldName("star_age")
.build();
}

@Test(expectedExceptions = NullPointerException.class)
public void testNullFieldName() {

QuantilesSketchAggregator quantilesSketchAggregator = QuantilesSketchAggregator.builder()
.name("star_age_quantiles_sketch")
.build();
}
}
Loading