Search in sources :

Example 6 with HllSketchBuildAggregatorFactory

use of org.apache.druid.query.aggregation.datasketches.hll.HllSketchBuildAggregatorFactory in project druid by druid-io.

the class HllSketchSqlAggregatorTest method createQuerySegmentWalker.

@Override
public SpecificSegmentsQuerySegmentWalker createQuerySegmentWalker() throws IOException {
    HllSketchModule.registerSerde();
    final QueryableIndex index = IndexBuilder.create().tmpDir(temporaryFolder.newFolder()).segmentWriteOutMediumFactory(OffHeapMemorySegmentWriteOutMediumFactory.instance()).schema(new IncrementalIndexSchema.Builder().withMetrics(new CountAggregatorFactory("cnt"), new DoubleSumAggregatorFactory("m1", "m1"), new HllSketchBuildAggregatorFactory("hllsketch_dim1", "dim1", null, null, ROUND)).withRollup(false).build()).rows(CalciteTests.ROWS1).buildMMappedIndex();
    walker = new SpecificSegmentsQuerySegmentWalker(conglomerate).add(DataSegment.builder().dataSource(CalciteTests.DATASOURCE1).interval(index.getDataInterval()).version("1").shardSpec(new LinearShardSpec(0)).size(0).build(), index);
    return walker;
}
Also used : CountAggregatorFactory(org.apache.druid.query.aggregation.CountAggregatorFactory) DoubleSumAggregatorFactory(org.apache.druid.query.aggregation.DoubleSumAggregatorFactory) SpecificSegmentsQuerySegmentWalker(org.apache.druid.sql.calcite.util.SpecificSegmentsQuerySegmentWalker) QueryableIndex(org.apache.druid.segment.QueryableIndex) LinearShardSpec(org.apache.druid.timeline.partition.LinearShardSpec) IndexBuilder(org.apache.druid.segment.IndexBuilder) HllSketchBuildAggregatorFactory(org.apache.druid.query.aggregation.datasketches.hll.HllSketchBuildAggregatorFactory)

Aggregations

HllSketchBuildAggregatorFactory (org.apache.druid.query.aggregation.datasketches.hll.HllSketchBuildAggregatorFactory)6 MultipleIntervalSegmentSpec (org.apache.druid.query.spec.MultipleIntervalSegmentSpec)4 BaseCalciteQueryTest (org.apache.druid.sql.calcite.BaseCalciteQueryTest)4 Test (org.junit.Test)4 FieldAccessPostAggregator (org.apache.druid.query.aggregation.post.FieldAccessPostAggregator)3 FinalizingFieldAccessPostAggregator (org.apache.druid.query.aggregation.post.FinalizingFieldAccessPostAggregator)3 CountAggregatorFactory (org.apache.druid.query.aggregation.CountAggregatorFactory)2 FilteredAggregatorFactory (org.apache.druid.query.aggregation.FilteredAggregatorFactory)2 LongSumAggregatorFactory (org.apache.druid.query.aggregation.LongSumAggregatorFactory)2 HllSketchMergeAggregatorFactory (org.apache.druid.query.aggregation.datasketches.hll.HllSketchMergeAggregatorFactory)2 HllSketchToEstimatePostAggregator (org.apache.druid.query.aggregation.datasketches.hll.HllSketchToEstimatePostAggregator)2 HllSketchToStringPostAggregator (org.apache.druid.query.aggregation.datasketches.hll.HllSketchToStringPostAggregator)2 ExpressionVirtualColumn (org.apache.druid.segment.virtual.ExpressionVirtualColumn)2 Nullable (javax.annotation.Nullable)1 RelDataType (org.apache.calcite.rel.type.RelDataType)1 RexNode (org.apache.calcite.rex.RexNode)1 ISE (org.apache.druid.java.util.common.ISE)1 PeriodGranularity (org.apache.druid.java.util.common.granularity.PeriodGranularity)1 QueryDataSource (org.apache.druid.query.QueryDataSource)1 AggregatorFactory (org.apache.druid.query.aggregation.AggregatorFactory)1