Search in sources :

Example 1 with Distribution

use of com.yahoo.bullet.query.aggregations.Distribution in project bullet-core by yahoo.

the class QuantileSketchingStrategyTest method testCombining.

@Test
public void testCombining() {
    QuantileSketchingStrategy distribution = makeDistribution(DistributionType.CDF, asList(5.0, 2.5));
    IntStream.range(0, 25).mapToDouble(i -> (i * 0.1)).mapToObj(d -> RecordBox.get().add("field", d).getRecord()).forEach(distribution::consume);
    QuantileSketchingStrategy anotherDistribution = makeDistribution(DistributionType.CDF, asList(5.0, 2.5));
    IntStream.range(50, 100).mapToDouble(i -> (i * 0.1)).mapToObj(d -> RecordBox.get().add("field", d).getRecord()).forEach(anotherDistribution::consume);
    QuantileSketchingStrategy union = makeDistribution(DistributionType.CDF, asList(5.0, 2.5));
    union.combine(distribution.getData());
    union.combine(anotherDistribution.getData());
    Clip result = union.getResult();
    Map<String, Object> metadata = (Map<String, Object>) result.getMeta().asMap().get("meta");
    Assert.assertEquals(metadata.size(), 7);
    Assert.assertFalse((Boolean) metadata.get("isEst"));
    List<BulletRecord> records = result.getRecords();
    Assert.assertEquals(records.size(), 3);
    BulletRecord expectedA = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 2.5 + END_EXCLUSIVE).add(COUNT_FIELD, 25.0).add(PROBABILITY_FIELD, 1.0 / 3).getRecord();
    BulletRecord expectedB = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 5.0 + END_EXCLUSIVE).add(COUNT_FIELD, 25.0).add(PROBABILITY_FIELD, 1.0 / 3).getRecord();
    BulletRecord expectedC = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + POSITIVE_INFINITY_END).add(COUNT_FIELD, 75.0).add(PROBABILITY_FIELD, 1.0).getRecord();
    Assert.assertEquals(records.get(0), expectedA);
    Assert.assertEquals(records.get(1), expectedB);
    Assert.assertEquals(records.get(2), expectedC);
    Assert.assertEquals(union.getRecords(), records);
    Assert.assertEquals(union.getMetadata().asMap(), result.getMeta().asMap());
}
Also used : LinearDistribution(com.yahoo.bullet.query.aggregations.LinearDistribution) IntStream(java.util.stream.IntStream) Arrays(java.util.Arrays) ManualDistribution(com.yahoo.bullet.query.aggregations.ManualDistribution) RegionDistribution(com.yahoo.bullet.query.aggregations.RegionDistribution) START_INCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.START_INCLUSIVE) END_EXCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.END_EXCLUSIVE) PROBABILITY_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.PROBABILITY_FIELD) Concept(com.yahoo.bullet.result.Meta.Concept) Test(org.testng.annotations.Test) RecordBox(com.yahoo.bullet.result.RecordBox) NEGATIVE_INFINITY_START(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.NEGATIVE_INFINITY_START) Clip(com.yahoo.bullet.result.Clip) Family(com.yahoo.sketches.Family) HashSet(java.util.HashSet) Pair(org.apache.commons.lang3.tuple.Pair) Assert(org.testng.Assert) VALUE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.VALUE_FIELD) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Distribution(com.yahoo.bullet.query.aggregations.Distribution) POSITIVE_INFINITY_END(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.POSITIVE_INFINITY_END) BulletRecord(com.yahoo.bullet.record.BulletRecord) DoublesSketch(com.yahoo.sketches.quantiles.DoublesSketch) QUANTILE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.QUANTILE_FIELD) Set(java.util.Set) Collectors(java.util.stream.Collectors) List(java.util.List) TestHelpers.assertApproxEquals(com.yahoo.bullet.TestHelpers.assertApproxEquals) RANGE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.RANGE_FIELD) TestHelpers.addMetadata(com.yahoo.bullet.TestHelpers.addMetadata) BulletConfig(com.yahoo.bullet.common.BulletConfig) DistributionType(com.yahoo.bullet.query.aggregations.DistributionType) COUNT_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.COUNT_FIELD) SEPARATOR(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.SEPARATOR) Collections(java.util.Collections) Clip(com.yahoo.bullet.result.Clip) BulletRecord(com.yahoo.bullet.record.BulletRecord) Map(java.util.Map) Test(org.testng.annotations.Test)

Example 2 with Distribution

use of com.yahoo.bullet.query.aggregations.Distribution in project bullet-core by yahoo.

the class QuantileSketchingStrategyTest method testResetting.

@Test
public void testResetting() {
    QuantileSketchingStrategy distribution = makeDistribution(DistributionType.CDF, asList(5.0, 2.5));
    IntStream.range(0, 25).mapToDouble(i -> (i * 0.1)).mapToObj(d -> RecordBox.get().add("field", d).getRecord()).forEach(distribution::consume);
    BulletRecord expectedA = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 2.5 + END_EXCLUSIVE).add(COUNT_FIELD, 25.0).add(PROBABILITY_FIELD, 1.0).getRecord();
    BulletRecord expectedB = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 5.0 + END_EXCLUSIVE).add(COUNT_FIELD, 25.0).add(PROBABILITY_FIELD, 1.0).getRecord();
    BulletRecord expectedC = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + POSITIVE_INFINITY_END).add(COUNT_FIELD, 25.0).add(PROBABILITY_FIELD, 1.0).getRecord();
    Clip result = distribution.getResult();
    List<BulletRecord> records = result.getRecords();
    Assert.assertEquals(records.size(), 3);
    Assert.assertEquals(records.get(0), expectedA);
    Assert.assertEquals(records.get(1), expectedB);
    Assert.assertEquals(records.get(2), expectedC);
    Assert.assertEquals(distribution.getRecords(), records);
    Assert.assertEquals(distribution.getMetadata().asMap(), result.getMeta().asMap());
    distribution.reset();
    IntStream.range(50, 100).mapToDouble(i -> (i * 0.1)).mapToObj(d -> RecordBox.get().add("field", d).getRecord()).forEach(distribution::consume);
    expectedA = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 2.5 + END_EXCLUSIVE).add(COUNT_FIELD, 0.0).add(PROBABILITY_FIELD, 0.0).getRecord();
    expectedB = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 5.0 + END_EXCLUSIVE).add(COUNT_FIELD, 0.0).add(PROBABILITY_FIELD, 0.0).getRecord();
    expectedC = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + POSITIVE_INFINITY_END).add(COUNT_FIELD, 50.0).add(PROBABILITY_FIELD, 1.0).getRecord();
    result = distribution.getResult();
    records = result.getRecords();
    Assert.assertEquals(records.size(), 3);
    Assert.assertEquals(records.get(0), expectedA);
    Assert.assertEquals(records.get(1), expectedB);
    Assert.assertEquals(records.get(2), expectedC);
    Assert.assertEquals(distribution.getRecords(), records);
    Assert.assertEquals(distribution.getMetadata().asMap(), result.getMeta().asMap());
}
Also used : LinearDistribution(com.yahoo.bullet.query.aggregations.LinearDistribution) IntStream(java.util.stream.IntStream) Arrays(java.util.Arrays) ManualDistribution(com.yahoo.bullet.query.aggregations.ManualDistribution) RegionDistribution(com.yahoo.bullet.query.aggregations.RegionDistribution) START_INCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.START_INCLUSIVE) END_EXCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.END_EXCLUSIVE) PROBABILITY_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.PROBABILITY_FIELD) Concept(com.yahoo.bullet.result.Meta.Concept) Test(org.testng.annotations.Test) RecordBox(com.yahoo.bullet.result.RecordBox) NEGATIVE_INFINITY_START(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.NEGATIVE_INFINITY_START) Clip(com.yahoo.bullet.result.Clip) Family(com.yahoo.sketches.Family) HashSet(java.util.HashSet) Pair(org.apache.commons.lang3.tuple.Pair) Assert(org.testng.Assert) VALUE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.VALUE_FIELD) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Distribution(com.yahoo.bullet.query.aggregations.Distribution) POSITIVE_INFINITY_END(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.POSITIVE_INFINITY_END) BulletRecord(com.yahoo.bullet.record.BulletRecord) DoublesSketch(com.yahoo.sketches.quantiles.DoublesSketch) QUANTILE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.QUANTILE_FIELD) Set(java.util.Set) Collectors(java.util.stream.Collectors) List(java.util.List) TestHelpers.assertApproxEquals(com.yahoo.bullet.TestHelpers.assertApproxEquals) RANGE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.RANGE_FIELD) TestHelpers.addMetadata(com.yahoo.bullet.TestHelpers.addMetadata) BulletConfig(com.yahoo.bullet.common.BulletConfig) DistributionType(com.yahoo.bullet.query.aggregations.DistributionType) COUNT_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.COUNT_FIELD) SEPARATOR(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.SEPARATOR) Collections(java.util.Collections) Clip(com.yahoo.bullet.result.Clip) BulletRecord(com.yahoo.bullet.record.BulletRecord) Test(org.testng.annotations.Test)

Example 3 with Distribution

use of com.yahoo.bullet.query.aggregations.Distribution in project bullet-core by yahoo.

the class QuantileSketchingStrategyTest method testQuantiles.

@Test
public void testQuantiles() {
    QuantileSketchingStrategy distribution = makeDistribution("field", DistributionType.QUANTILE, 3);
    IntStream.range(0, 2000).mapToDouble(i -> (i * 0.1)).mapToObj(d -> RecordBox.get().add("field", d).getRecord()).forEach(distribution::consume);
    Clip result = distribution.getResult();
    Map<String, Object> metadata = (Map<String, Object>) result.getMeta().asMap().get("meta");
    Assert.assertEquals(metadata.size(), 7);
    Assert.assertTrue((Boolean) metadata.get("isEst"));
    Assert.assertEquals((String) metadata.get("family"), Family.QUANTILES.getFamilyName());
    // Size should be at least 512 bytes since we inserted 2K uniques with sketch k set to 512
    Assert.assertTrue((Integer) metadata.get("size") >= 512);
    Assert.assertEquals(metadata.get("nre"), DoublesSketch.getNormalizedRankError(512));
    // 60 items
    Assert.assertEquals(metadata.get("n"), 2000L);
    Assert.assertEquals(metadata.get("min"), 0.0);
    Assert.assertEquals(metadata.get("max"), 199.9);
    List<BulletRecord> records = result.getRecords();
    Assert.assertEquals(records.size(), 3);
    BulletRecord expectedA = RecordBox.get().add(QUANTILE_FIELD, 0.0).add(VALUE_FIELD, 0.0).getRecord();
    BulletRecord expectedC = RecordBox.get().add(QUANTILE_FIELD, 1.0).add(VALUE_FIELD, 199.9).getRecord();
    Assert.assertEquals(records.get(0), expectedA);
    Assert.assertEquals(records.get(2), expectedC);
    BulletRecord actualB = records.get(1);
    Assert.assertEquals(actualB.typedGet(QUANTILE_FIELD).getValue(), 0.5);
    Double actualMedian = (Double) actualB.typedGet(VALUE_FIELD).getValue();
    // We insert 0,0.1, ... 199.9. Our median is around 100.0. Our NRE < 1%, so we can be pretty certain the median
    // from the sketch is around this.
    assertApproxEquals(actualMedian, 100.0, 2.0);
    Assert.assertEquals(distribution.getRecords(), result.getRecords());
    Assert.assertEquals(distribution.getMetadata().asMap(), result.getMeta().asMap());
}
Also used : LinearDistribution(com.yahoo.bullet.query.aggregations.LinearDistribution) IntStream(java.util.stream.IntStream) Arrays(java.util.Arrays) ManualDistribution(com.yahoo.bullet.query.aggregations.ManualDistribution) RegionDistribution(com.yahoo.bullet.query.aggregations.RegionDistribution) START_INCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.START_INCLUSIVE) END_EXCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.END_EXCLUSIVE) PROBABILITY_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.PROBABILITY_FIELD) Concept(com.yahoo.bullet.result.Meta.Concept) Test(org.testng.annotations.Test) RecordBox(com.yahoo.bullet.result.RecordBox) NEGATIVE_INFINITY_START(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.NEGATIVE_INFINITY_START) Clip(com.yahoo.bullet.result.Clip) Family(com.yahoo.sketches.Family) HashSet(java.util.HashSet) Pair(org.apache.commons.lang3.tuple.Pair) Assert(org.testng.Assert) VALUE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.VALUE_FIELD) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Distribution(com.yahoo.bullet.query.aggregations.Distribution) POSITIVE_INFINITY_END(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.POSITIVE_INFINITY_END) BulletRecord(com.yahoo.bullet.record.BulletRecord) DoublesSketch(com.yahoo.sketches.quantiles.DoublesSketch) QUANTILE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.QUANTILE_FIELD) Set(java.util.Set) Collectors(java.util.stream.Collectors) List(java.util.List) TestHelpers.assertApproxEquals(com.yahoo.bullet.TestHelpers.assertApproxEquals) RANGE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.RANGE_FIELD) TestHelpers.addMetadata(com.yahoo.bullet.TestHelpers.addMetadata) BulletConfig(com.yahoo.bullet.common.BulletConfig) DistributionType(com.yahoo.bullet.query.aggregations.DistributionType) COUNT_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.COUNT_FIELD) SEPARATOR(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.SEPARATOR) Collections(java.util.Collections) Clip(com.yahoo.bullet.result.Clip) BulletRecord(com.yahoo.bullet.record.BulletRecord) Map(java.util.Map) Test(org.testng.annotations.Test)

Example 4 with Distribution

use of com.yahoo.bullet.query.aggregations.Distribution in project bullet-core by yahoo.

the class QuantileSketchingStrategyTest method testNegativeSize.

@Test
public void testNegativeSize() {
    // MAX_POINTS is configured to -1 and we will use the min BulletConfig.DEFAULT_DISTRIBUTION_AGGREGATION_MAX_POINTS
    // and aggregation size, which is 1
    QuantileSketchingStrategy distribution = makeDistribution(makeConfiguration(-1, 128), 1, "field", DistributionType.PMF, 10);
    IntStream.range(0, 100).mapToDouble(i -> i).mapToObj(d -> RecordBox.get().add("field", d).getRecord()).forEach(distribution::consume);
    Clip result = distribution.getResult();
    Map<String, Object> metadata = (Map<String, Object>) result.getMeta().asMap().get("meta");
    Assert.assertEquals(metadata.size(), 7);
    Assert.assertFalse((Boolean) metadata.get("isEst"));
    List<BulletRecord> records = result.getRecords();
    Assert.assertEquals(records.size(), 2);
    BulletRecord expectedA = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 0.0 + END_EXCLUSIVE).add(COUNT_FIELD, 0.0).add(PROBABILITY_FIELD, 0.0).getRecord();
    BulletRecord expectedB = RecordBox.get().add(RANGE_FIELD, START_INCLUSIVE + 0.0 + SEPARATOR + POSITIVE_INFINITY_END).add(COUNT_FIELD, 100.0).add(PROBABILITY_FIELD, 1.0).getRecord();
    Assert.assertEquals(records.get(0), expectedA);
    Assert.assertEquals(records.get(1), expectedB);
    Assert.assertEquals(distribution.getRecords(), result.getRecords());
    Assert.assertEquals(distribution.getMetadata().asMap(), result.getMeta().asMap());
}
Also used : LinearDistribution(com.yahoo.bullet.query.aggregations.LinearDistribution) IntStream(java.util.stream.IntStream) Arrays(java.util.Arrays) ManualDistribution(com.yahoo.bullet.query.aggregations.ManualDistribution) RegionDistribution(com.yahoo.bullet.query.aggregations.RegionDistribution) START_INCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.START_INCLUSIVE) END_EXCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.END_EXCLUSIVE) PROBABILITY_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.PROBABILITY_FIELD) Concept(com.yahoo.bullet.result.Meta.Concept) Test(org.testng.annotations.Test) RecordBox(com.yahoo.bullet.result.RecordBox) NEGATIVE_INFINITY_START(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.NEGATIVE_INFINITY_START) Clip(com.yahoo.bullet.result.Clip) Family(com.yahoo.sketches.Family) HashSet(java.util.HashSet) Pair(org.apache.commons.lang3.tuple.Pair) Assert(org.testng.Assert) VALUE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.VALUE_FIELD) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Distribution(com.yahoo.bullet.query.aggregations.Distribution) POSITIVE_INFINITY_END(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.POSITIVE_INFINITY_END) BulletRecord(com.yahoo.bullet.record.BulletRecord) DoublesSketch(com.yahoo.sketches.quantiles.DoublesSketch) QUANTILE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.QUANTILE_FIELD) Set(java.util.Set) Collectors(java.util.stream.Collectors) List(java.util.List) TestHelpers.assertApproxEquals(com.yahoo.bullet.TestHelpers.assertApproxEquals) RANGE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.RANGE_FIELD) TestHelpers.addMetadata(com.yahoo.bullet.TestHelpers.addMetadata) BulletConfig(com.yahoo.bullet.common.BulletConfig) DistributionType(com.yahoo.bullet.query.aggregations.DistributionType) COUNT_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.COUNT_FIELD) SEPARATOR(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.SEPARATOR) Collections(java.util.Collections) Clip(com.yahoo.bullet.result.Clip) BulletRecord(com.yahoo.bullet.record.BulletRecord) Map(java.util.Map) Test(org.testng.annotations.Test)

Example 5 with Distribution

use of com.yahoo.bullet.query.aggregations.Distribution in project bullet-core by yahoo.

the class QuantileSketchingStrategyTest method testCDF.

@Test
public void testCDF() {
    QuantileSketchingStrategy distribution = makeDistribution(DistributionType.CDF, asList(5.0, 2.5));
    IntStream.range(0, 100).mapToDouble(i -> (i * 0.1)).mapToObj(d -> RecordBox.get().add("field", d).getRecord()).forEach(distribution::consume);
    Clip result = distribution.getResult();
    Map<String, Object> metadata = (Map<String, Object>) result.getMeta().asMap().get("meta");
    Assert.assertEquals(metadata.size(), 7);
    Assert.assertFalse((Boolean) metadata.get("isEst"));
    List<BulletRecord> records = result.getRecords();
    Assert.assertEquals(records.size(), 3);
    BulletRecord expectedA = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 2.5 + END_EXCLUSIVE).add(COUNT_FIELD, 25.0).add(PROBABILITY_FIELD, 0.25).getRecord();
    BulletRecord expectedB = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + 5.0 + END_EXCLUSIVE).add(COUNT_FIELD, 50.0).add(PROBABILITY_FIELD, 0.5).getRecord();
    BulletRecord expectedC = RecordBox.get().add(RANGE_FIELD, NEGATIVE_INFINITY_START + SEPARATOR + POSITIVE_INFINITY_END).add(COUNT_FIELD, 100.0).add(PROBABILITY_FIELD, 1.0).getRecord();
    Assert.assertEquals(records.get(0), expectedA);
    Assert.assertEquals(records.get(1), expectedB);
    Assert.assertEquals(records.get(2), expectedC);
    Assert.assertEquals(distribution.getRecords(), result.getRecords());
    Assert.assertEquals(distribution.getMetadata().asMap(), result.getMeta().asMap());
}
Also used : LinearDistribution(com.yahoo.bullet.query.aggregations.LinearDistribution) IntStream(java.util.stream.IntStream) Arrays(java.util.Arrays) ManualDistribution(com.yahoo.bullet.query.aggregations.ManualDistribution) RegionDistribution(com.yahoo.bullet.query.aggregations.RegionDistribution) START_INCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.START_INCLUSIVE) END_EXCLUSIVE(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.END_EXCLUSIVE) PROBABILITY_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.PROBABILITY_FIELD) Concept(com.yahoo.bullet.result.Meta.Concept) Test(org.testng.annotations.Test) RecordBox(com.yahoo.bullet.result.RecordBox) NEGATIVE_INFINITY_START(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.NEGATIVE_INFINITY_START) Clip(com.yahoo.bullet.result.Clip) Family(com.yahoo.sketches.Family) HashSet(java.util.HashSet) Pair(org.apache.commons.lang3.tuple.Pair) Assert(org.testng.Assert) VALUE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.VALUE_FIELD) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Distribution(com.yahoo.bullet.query.aggregations.Distribution) POSITIVE_INFINITY_END(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.POSITIVE_INFINITY_END) BulletRecord(com.yahoo.bullet.record.BulletRecord) DoublesSketch(com.yahoo.sketches.quantiles.DoublesSketch) QUANTILE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.QUANTILE_FIELD) Set(java.util.Set) Collectors(java.util.stream.Collectors) List(java.util.List) TestHelpers.assertApproxEquals(com.yahoo.bullet.TestHelpers.assertApproxEquals) RANGE_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.RANGE_FIELD) TestHelpers.addMetadata(com.yahoo.bullet.TestHelpers.addMetadata) BulletConfig(com.yahoo.bullet.common.BulletConfig) DistributionType(com.yahoo.bullet.query.aggregations.DistributionType) COUNT_FIELD(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.COUNT_FIELD) SEPARATOR(com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.SEPARATOR) Collections(java.util.Collections) Clip(com.yahoo.bullet.result.Clip) BulletRecord(com.yahoo.bullet.record.BulletRecord) Map(java.util.Map) Test(org.testng.annotations.Test)

Aggregations

BulletConfig (com.yahoo.bullet.common.BulletConfig)9 Distribution (com.yahoo.bullet.query.aggregations.Distribution)9 LinearDistribution (com.yahoo.bullet.query.aggregations.LinearDistribution)9 TestHelpers.addMetadata (com.yahoo.bullet.TestHelpers.addMetadata)8 TestHelpers.assertApproxEquals (com.yahoo.bullet.TestHelpers.assertApproxEquals)8 DistributionType (com.yahoo.bullet.query.aggregations.DistributionType)8 ManualDistribution (com.yahoo.bullet.query.aggregations.ManualDistribution)8 RegionDistribution (com.yahoo.bullet.query.aggregations.RegionDistribution)8 COUNT_FIELD (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.COUNT_FIELD)8 END_EXCLUSIVE (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.END_EXCLUSIVE)8 NEGATIVE_INFINITY_START (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.NEGATIVE_INFINITY_START)8 POSITIVE_INFINITY_END (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.POSITIVE_INFINITY_END)8 PROBABILITY_FIELD (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.PROBABILITY_FIELD)8 QUANTILE_FIELD (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.QUANTILE_FIELD)8 RANGE_FIELD (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.RANGE_FIELD)8 SEPARATOR (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.SEPARATOR)8 START_INCLUSIVE (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.START_INCLUSIVE)8 VALUE_FIELD (com.yahoo.bullet.querying.aggregations.sketches.QuantileSketch.VALUE_FIELD)8 BulletRecord (com.yahoo.bullet.record.BulletRecord)8 Clip (com.yahoo.bullet.result.Clip)8