Search in sources :

Example 6 with SketchMergeAggregatorFactory

use of org.apache.druid.query.aggregation.datasketches.theta.SketchMergeAggregatorFactory in project druid by druid-io.

the class ThetaSketchSqlAggregatorTest method createQuerySegmentWalker.

@Override
public SpecificSegmentsQuerySegmentWalker createQuerySegmentWalker() throws IOException {
    SketchModule.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 SketchMergeAggregatorFactory("thetasketch_dim1", "dim1", null, false, false, null)).withRollup(false).build()).rows(CalciteTests.ROWS1).buildMMappedIndex();
    return new SpecificSegmentsQuerySegmentWalker(conglomerate).add(DataSegment.builder().dataSource(DATA_SOURCE).interval(index.getDataInterval()).version("1").shardSpec(new LinearShardSpec(0)).size(0).build(), index);
}
Also used : SketchMergeAggregatorFactory(org.apache.druid.query.aggregation.datasketches.theta.SketchMergeAggregatorFactory) 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)

Aggregations

SketchMergeAggregatorFactory (org.apache.druid.query.aggregation.datasketches.theta.SketchMergeAggregatorFactory)6 MultipleIntervalSegmentSpec (org.apache.druid.query.spec.MultipleIntervalSegmentSpec)4 BaseCalciteQueryTest (org.apache.druid.sql.calcite.BaseCalciteQueryTest)4 Test (org.junit.Test)4 LongSumAggregatorFactory (org.apache.druid.query.aggregation.LongSumAggregatorFactory)3 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 SketchEstimatePostAggregator (org.apache.druid.query.aggregation.datasketches.theta.SketchEstimatePostAggregator)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 DoubleSumAggregatorFactory (org.apache.druid.query.aggregation.DoubleSumAggregatorFactory)1 SketchAggregatorFactory (org.apache.druid.query.aggregation.datasketches.theta.SketchAggregatorFactory)1