Search in sources :

Example 86 with Sequence

use of org.apache.druid.java.util.common.guava.Sequence in project druid by druid-io.

the class IncrementalIndexStorageAdapterTest method testCursoringAndIndexUpdationInterleaving.

@Test
public void testCursoringAndIndexUpdationInterleaving() throws Exception {
    final IncrementalIndex index = indexCreator.createIndex();
    final long timestamp = System.currentTimeMillis();
    for (int i = 0; i < 2; i++) {
        index.add(new MapBasedInputRow(timestamp, Collections.singletonList("billy"), ImmutableMap.of("billy", "v1" + i)));
    }
    final StorageAdapter sa = new IncrementalIndexStorageAdapter(index);
    Sequence<Cursor> cursors = sa.makeCursors(null, Intervals.utc(timestamp - 60_000, timestamp + 60_000), VirtualColumns.EMPTY, Granularities.ALL, false, null);
    final AtomicInteger assertCursorsNotEmpty = new AtomicInteger(0);
    cursors.map(cursor -> {
        DimensionSelector dimSelector = cursor.getColumnSelectorFactory().makeDimensionSelector(new DefaultDimensionSpec("billy", "billy"));
        int cardinality = dimSelector.getValueCardinality();
        // index gets more rows at this point, while other thread is iterating over the cursor
        try {
            for (int i = 0; i < 1; i++) {
                index.add(new MapBasedInputRow(timestamp, Collections.singletonList("billy"), ImmutableMap.of("billy", "v2" + i)));
            }
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
        int rowNumInCursor = 0;
        // and then, cursoring continues in the other thread
        while (!cursor.isDone()) {
            IndexedInts row = dimSelector.getRow();
            row.forEach(i -> Assert.assertTrue(i < cardinality));
            cursor.advance();
            rowNumInCursor++;
        }
        Assert.assertEquals(2, rowNumInCursor);
        assertCursorsNotEmpty.incrementAndGet();
        return null;
    }).toList();
    Assert.assertEquals(1, assertCursorsNotEmpty.get());
}
Also used : GroupByQueryEngine(org.apache.druid.query.groupby.GroupByQueryEngine) Arrays(java.util.Arrays) MapBasedRow(org.apache.druid.data.input.MapBasedRow) IndexedInts(org.apache.druid.segment.data.IndexedInts) StorageAdapter(org.apache.druid.segment.StorageAdapter) ByteBuffer(java.nio.ByteBuffer) Row(org.apache.druid.data.input.Row) DefaultDimensionSpec(org.apache.druid.query.dimension.DefaultDimensionSpec) ColumnSelectorFactory(org.apache.druid.segment.ColumnSelectorFactory) LongSumAggregatorFactory(org.apache.druid.query.aggregation.LongSumAggregatorFactory) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Parameterized(org.junit.runners.Parameterized) DateTimes(org.apache.druid.java.util.common.DateTimes) Sequence(org.apache.druid.java.util.common.guava.Sequence) TopNResultValue(org.apache.druid.query.topn.TopNResultValue) SelectorFilter(org.apache.druid.segment.filter.SelectorFilter) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) JavaScriptAggregatorFactory(org.apache.druid.query.aggregation.JavaScriptAggregatorFactory) Set(java.util.Set) List(java.util.List) CloseableStupidPool(org.apache.druid.collections.CloseableStupidPool) Predicate(com.google.common.base.Predicate) TopNQueryEngine(org.apache.druid.query.topn.TopNQueryEngine) BitmapIndexSelector(org.apache.druid.query.filter.BitmapIndexSelector) Iterables(com.google.common.collect.Iterables) Intervals(org.apache.druid.java.util.common.Intervals) DruidDoublePredicate(org.apache.druid.query.filter.DruidDoublePredicate) DimFilters(org.apache.druid.query.filter.DimFilters) RunWith(org.junit.runner.RunWith) MapBasedInputRow(org.apache.druid.data.input.MapBasedInputRow) JavaScriptConfig(org.apache.druid.js.JavaScriptConfig) DruidLongPredicate(org.apache.druid.query.filter.DruidLongPredicate) Interval(org.joda.time.Interval) Lists(com.google.common.collect.Lists) Predicates(com.google.common.base.Predicates) Suppliers(com.google.common.base.Suppliers) GroupByQuery(org.apache.druid.query.groupby.GroupByQuery) DimensionSelector(org.apache.druid.segment.DimensionSelector) CountAggregatorFactory(org.apache.druid.query.aggregation.CountAggregatorFactory) DruidFloatPredicate(org.apache.druid.query.filter.DruidFloatPredicate) ValueMatcher(org.apache.druid.query.filter.ValueMatcher) BitmapResultFactory(org.apache.druid.query.BitmapResultFactory) VirtualColumns(org.apache.druid.segment.VirtualColumns) TopNQueryBuilder(org.apache.druid.query.topn.TopNQueryBuilder) GroupByQueryConfig(org.apache.druid.query.groupby.GroupByQueryConfig) DateTime(org.joda.time.DateTime) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test) IOException(java.io.IOException) ColumnSelector(org.apache.druid.segment.ColumnSelector) Granularities(org.apache.druid.java.util.common.granularity.Granularities) Result(org.apache.druid.query.Result) Rule(org.junit.Rule) Cursor(org.apache.druid.segment.Cursor) NullHandling(org.apache.druid.common.config.NullHandling) DruidPredicateFactory(org.apache.druid.query.filter.DruidPredicateFactory) CloserRule(org.apache.druid.segment.CloserRule) Assert(org.junit.Assert) Filters(org.apache.druid.segment.filter.Filters) Collections(java.util.Collections) Filter(org.apache.druid.query.filter.Filter) DimensionSelector(org.apache.druid.segment.DimensionSelector) StorageAdapter(org.apache.druid.segment.StorageAdapter) Cursor(org.apache.druid.segment.Cursor) DefaultDimensionSpec(org.apache.druid.query.dimension.DefaultDimensionSpec) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IndexedInts(org.apache.druid.segment.data.IndexedInts) MapBasedInputRow(org.apache.druid.data.input.MapBasedInputRow) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test)

Example 87 with Sequence

use of org.apache.druid.java.util.common.guava.Sequence in project druid by druid-io.

the class IncrementalIndexStorageAdapterTest method testCursoringAndSnapshot.

@Test
public void testCursoringAndSnapshot() throws Exception {
    final IncrementalIndex index = indexCreator.createIndex();
    final long timestamp = System.currentTimeMillis();
    for (int i = 0; i < 2; i++) {
        index.add(new MapBasedInputRow(timestamp, Collections.singletonList("billy"), ImmutableMap.of("billy", "v0" + i)));
    }
    final StorageAdapter sa = new IncrementalIndexStorageAdapter(index);
    Sequence<Cursor> cursors = sa.makeCursors(null, Intervals.utc(timestamp - 60_000, timestamp + 60_000), VirtualColumns.EMPTY, Granularities.ALL, false, null);
    final AtomicInteger assertCursorsNotEmpty = new AtomicInteger(0);
    cursors.map(cursor -> {
        DimensionSelector dimSelector1A = cursor.getColumnSelectorFactory().makeDimensionSelector(new DefaultDimensionSpec("billy", "billy"));
        int cardinalityA = dimSelector1A.getValueCardinality();
        // index gets more rows at this point, while other thread is iterating over the cursor
        try {
            index.add(new MapBasedInputRow(timestamp, Collections.singletonList("billy"), ImmutableMap.of("billy", "v1")));
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
        DimensionSelector dimSelector1B = cursor.getColumnSelectorFactory().makeDimensionSelector(new DefaultDimensionSpec("billy", "billy"));
        // index gets more rows at this point, while other thread is iterating over the cursor
        try {
            index.add(new MapBasedInputRow(timestamp, Collections.singletonList("billy"), ImmutableMap.of("billy", "v2")));
            index.add(new MapBasedInputRow(timestamp, Collections.singletonList("billy2"), ImmutableMap.of("billy2", "v3")));
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
        DimensionSelector dimSelector1C = cursor.getColumnSelectorFactory().makeDimensionSelector(new DefaultDimensionSpec("billy", "billy"));
        DimensionSelector dimSelector2D = cursor.getColumnSelectorFactory().makeDimensionSelector(new DefaultDimensionSpec("billy2", "billy2"));
        // index gets more rows at this point, while other thread is iterating over the cursor
        try {
            index.add(new MapBasedInputRow(timestamp, Collections.singletonList("billy"), ImmutableMap.of("billy", "v3")));
            index.add(new MapBasedInputRow(timestamp, Collections.singletonList("billy3"), ImmutableMap.of("billy3", "")));
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
        DimensionSelector dimSelector3E = cursor.getColumnSelectorFactory().makeDimensionSelector(new DefaultDimensionSpec("billy3", "billy3"));
        int rowNumInCursor = 0;
        // and then, cursoring continues in the other thread
        while (!cursor.isDone()) {
            IndexedInts rowA = dimSelector1A.getRow();
            rowA.forEach(i -> Assert.assertTrue(i < cardinalityA));
            IndexedInts rowB = dimSelector1B.getRow();
            rowB.forEach(i -> Assert.assertTrue(i < cardinalityA));
            IndexedInts rowC = dimSelector1C.getRow();
            rowC.forEach(i -> Assert.assertTrue(i < cardinalityA));
            IndexedInts rowD = dimSelector2D.getRow();
            // no null id, so should get empty dims array
            Assert.assertEquals(0, rowD.size());
            IndexedInts rowE = dimSelector3E.getRow();
            if (NullHandling.replaceWithDefault()) {
                Assert.assertEquals(1, rowE.size());
                // the null id
                Assert.assertEquals(0, rowE.get(0));
            } else {
                Assert.assertEquals(0, rowE.size());
            }
            cursor.advance();
            rowNumInCursor++;
        }
        Assert.assertEquals(2, rowNumInCursor);
        assertCursorsNotEmpty.incrementAndGet();
        return null;
    }).toList();
    Assert.assertEquals(1, assertCursorsNotEmpty.get());
}
Also used : GroupByQueryEngine(org.apache.druid.query.groupby.GroupByQueryEngine) Arrays(java.util.Arrays) MapBasedRow(org.apache.druid.data.input.MapBasedRow) IndexedInts(org.apache.druid.segment.data.IndexedInts) StorageAdapter(org.apache.druid.segment.StorageAdapter) ByteBuffer(java.nio.ByteBuffer) Row(org.apache.druid.data.input.Row) DefaultDimensionSpec(org.apache.druid.query.dimension.DefaultDimensionSpec) ColumnSelectorFactory(org.apache.druid.segment.ColumnSelectorFactory) LongSumAggregatorFactory(org.apache.druid.query.aggregation.LongSumAggregatorFactory) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Parameterized(org.junit.runners.Parameterized) DateTimes(org.apache.druid.java.util.common.DateTimes) Sequence(org.apache.druid.java.util.common.guava.Sequence) TopNResultValue(org.apache.druid.query.topn.TopNResultValue) SelectorFilter(org.apache.druid.segment.filter.SelectorFilter) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) JavaScriptAggregatorFactory(org.apache.druid.query.aggregation.JavaScriptAggregatorFactory) Set(java.util.Set) List(java.util.List) CloseableStupidPool(org.apache.druid.collections.CloseableStupidPool) Predicate(com.google.common.base.Predicate) TopNQueryEngine(org.apache.druid.query.topn.TopNQueryEngine) BitmapIndexSelector(org.apache.druid.query.filter.BitmapIndexSelector) Iterables(com.google.common.collect.Iterables) Intervals(org.apache.druid.java.util.common.Intervals) DruidDoublePredicate(org.apache.druid.query.filter.DruidDoublePredicate) DimFilters(org.apache.druid.query.filter.DimFilters) RunWith(org.junit.runner.RunWith) MapBasedInputRow(org.apache.druid.data.input.MapBasedInputRow) JavaScriptConfig(org.apache.druid.js.JavaScriptConfig) DruidLongPredicate(org.apache.druid.query.filter.DruidLongPredicate) Interval(org.joda.time.Interval) Lists(com.google.common.collect.Lists) Predicates(com.google.common.base.Predicates) Suppliers(com.google.common.base.Suppliers) GroupByQuery(org.apache.druid.query.groupby.GroupByQuery) DimensionSelector(org.apache.druid.segment.DimensionSelector) CountAggregatorFactory(org.apache.druid.query.aggregation.CountAggregatorFactory) DruidFloatPredicate(org.apache.druid.query.filter.DruidFloatPredicate) ValueMatcher(org.apache.druid.query.filter.ValueMatcher) BitmapResultFactory(org.apache.druid.query.BitmapResultFactory) VirtualColumns(org.apache.druid.segment.VirtualColumns) TopNQueryBuilder(org.apache.druid.query.topn.TopNQueryBuilder) GroupByQueryConfig(org.apache.druid.query.groupby.GroupByQueryConfig) DateTime(org.joda.time.DateTime) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test) IOException(java.io.IOException) ColumnSelector(org.apache.druid.segment.ColumnSelector) Granularities(org.apache.druid.java.util.common.granularity.Granularities) Result(org.apache.druid.query.Result) Rule(org.junit.Rule) Cursor(org.apache.druid.segment.Cursor) NullHandling(org.apache.druid.common.config.NullHandling) DruidPredicateFactory(org.apache.druid.query.filter.DruidPredicateFactory) CloserRule(org.apache.druid.segment.CloserRule) Assert(org.junit.Assert) Filters(org.apache.druid.segment.filter.Filters) Collections(java.util.Collections) Filter(org.apache.druid.query.filter.Filter) DimensionSelector(org.apache.druid.segment.DimensionSelector) StorageAdapter(org.apache.druid.segment.StorageAdapter) Cursor(org.apache.druid.segment.Cursor) DefaultDimensionSpec(org.apache.druid.query.dimension.DefaultDimensionSpec) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IndexedInts(org.apache.druid.segment.data.IndexedInts) MapBasedInputRow(org.apache.druid.data.input.MapBasedInputRow) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test)

Example 88 with Sequence

use of org.apache.druid.java.util.common.guava.Sequence in project druid by druid-io.

the class ChainedExecutionQueryRunner method run.

@Override
public Sequence<T> run(final QueryPlus<T> queryPlus, final ResponseContext responseContext) {
    Query<T> query = queryPlus.getQuery();
    final int priority = QueryContexts.getPriority(query);
    final Ordering ordering = query.getResultOrdering();
    final QueryPlus<T> threadSafeQueryPlus = queryPlus.withoutThreadUnsafeState();
    return new BaseSequence<T, Iterator<T>>(new BaseSequence.IteratorMaker<T, Iterator<T>>() {

        @Override
        public Iterator<T> make() {
            // Make it a List<> to materialize all of the values (so that it will submit everything to the executor)
            List<ListenableFuture<Iterable<T>>> futures = Lists.newArrayList(Iterables.transform(queryables, input -> {
                if (input == null) {
                    throw new ISE("Null queryRunner! Looks to be some segment unmapping action happening");
                }
                return queryProcessingPool.submitRunnerTask(new AbstractPrioritizedQueryRunnerCallable<Iterable<T>, T>(priority, input) {

                    @Override
                    public Iterable<T> call() {
                        try {
                            Sequence<T> result = input.run(threadSafeQueryPlus, responseContext);
                            if (result == null) {
                                throw new ISE("Got a null result! Segments are missing!");
                            }
                            List<T> retVal = result.toList();
                            if (retVal == null) {
                                throw new ISE("Got a null list of results");
                            }
                            return retVal;
                        } catch (QueryInterruptedException e) {
                            throw new RuntimeException(e);
                        } catch (QueryTimeoutException e) {
                            throw e;
                        } catch (Exception e) {
                            log.noStackTrace().error(e, "Exception with one of the sequences!");
                            Throwables.propagateIfPossible(e);
                            throw new RuntimeException(e);
                        }
                    }
                });
            }));
            ListenableFuture<List<Iterable<T>>> future = Futures.allAsList(futures);
            queryWatcher.registerQueryFuture(query, future);
            try {
                return new MergeIterable<>(ordering.nullsFirst(), QueryContexts.hasTimeout(query) ? future.get(QueryContexts.getTimeout(query), TimeUnit.MILLISECONDS) : future.get()).iterator();
            } catch (InterruptedException e) {
                log.noStackTrace().warn(e, "Query interrupted, cancelling pending results, query id [%s]", query.getId());
                // Note: canceling combinedFuture first so that it can complete with INTERRUPTED as its final state. See ChainedExecutionQueryRunnerTest.testQueryTimeout()
                GuavaUtils.cancelAll(true, future, futures);
                throw new QueryInterruptedException(e);
            } catch (CancellationException e) {
                throw new QueryInterruptedException(e);
            } catch (TimeoutException e) {
                log.warn("Query timeout, cancelling pending results for query id [%s]", query.getId());
                GuavaUtils.cancelAll(true, future, futures);
                throw new QueryTimeoutException(StringUtils.nonStrictFormat("Query [%s] timed out", query.getId()));
            } catch (ExecutionException e) {
                GuavaUtils.cancelAll(true, future, futures);
                Throwables.propagateIfPossible(e.getCause());
                throw new RuntimeException(e.getCause());
            }
        }

        @Override
        public void cleanup(Iterator<T> tIterator) {
        }
    });
}
Also used : MergeIterable(org.apache.druid.java.util.common.guava.MergeIterable) MergeIterable(org.apache.druid.java.util.common.guava.MergeIterable) Ordering(com.google.common.collect.Ordering) Iterator(java.util.Iterator) List(java.util.List) ISE(org.apache.druid.java.util.common.ISE) ExecutionException(java.util.concurrent.ExecutionException) TimeoutException(java.util.concurrent.TimeoutException) Sequence(org.apache.druid.java.util.common.guava.Sequence) BaseSequence(org.apache.druid.java.util.common.guava.BaseSequence) BaseSequence(org.apache.druid.java.util.common.guava.BaseSequence) CancellationException(java.util.concurrent.CancellationException) TimeoutException(java.util.concurrent.TimeoutException) ExecutionException(java.util.concurrent.ExecutionException) CancellationException(java.util.concurrent.CancellationException) ListenableFuture(com.google.common.util.concurrent.ListenableFuture)

Example 89 with Sequence

use of org.apache.druid.java.util.common.guava.Sequence in project druid by druid-io.

the class FinalizeResultsQueryRunner method run.

@Override
public Sequence<T> run(final QueryPlus<T> queryPlus, ResponseContext responseContext) {
    final Query<T> query = queryPlus.getQuery();
    final boolean isBySegment = QueryContexts.isBySegment(query);
    final boolean shouldFinalize = QueryContexts.isFinalize(query, true);
    final Query<T> queryToRun;
    final Function<T, ?> finalizerFn;
    final MetricManipulationFn metricManipulationFn;
    if (shouldFinalize) {
        queryToRun = query.withOverriddenContext(ImmutableMap.of("finalize", false));
        metricManipulationFn = MetricManipulatorFns.finalizing();
    } else {
        queryToRun = query;
        metricManipulationFn = MetricManipulatorFns.identity();
    }
    if (isBySegment) {
        finalizerFn = new Function<T, Result<BySegmentResultValue<T>>>() {

            final Function<T, T> baseFinalizer = toolChest.makePostComputeManipulatorFn(query, metricManipulationFn);

            @Override
            public Result<BySegmentResultValue<T>> apply(T input) {
                // noinspection unchecked (input is not actually a T; see class-level javadoc)
                Result<BySegmentResultValueClass<T>> result = (Result<BySegmentResultValueClass<T>>) input;
                if (input == null) {
                    throw new ISE("Cannot have a null result!");
                }
                BySegmentResultValue<T> resultsClass = result.getValue();
                return new Result<>(result.getTimestamp(), new BySegmentResultValueClass<>(Lists.transform(resultsClass.getResults(), baseFinalizer), resultsClass.getSegmentId(), resultsClass.getInterval()));
            }
        };
    } else {
        finalizerFn = toolChest.makePostComputeManipulatorFn(query, metricManipulationFn);
    }
    // noinspection unchecked (Technically unsound, but see class-level javadoc for rationale)
    return (Sequence<T>) Sequences.map(baseRunner.run(queryPlus.withQuery(queryToRun), responseContext), finalizerFn);
}
Also used : Sequence(org.apache.druid.java.util.common.guava.Sequence) MetricManipulationFn(org.apache.druid.query.aggregation.MetricManipulationFn) ISE(org.apache.druid.java.util.common.ISE)

Example 90 with Sequence

use of org.apache.druid.java.util.common.guava.Sequence in project druid by druid-io.

the class UnionQueryRunner method run.

@Override
public Sequence<T> run(final QueryPlus<T> queryPlus, final ResponseContext responseContext) {
    Query<T> query = queryPlus.getQuery();
    final DataSourceAnalysis analysis = DataSourceAnalysis.forDataSource(query.getDataSource());
    if (analysis.isConcreteTableBased() && analysis.getBaseUnionDataSource().isPresent()) {
        // Union of tables.
        final UnionDataSource unionDataSource = analysis.getBaseUnionDataSource().get();
        if (unionDataSource.getDataSources().isEmpty()) {
            // Shouldn't happen, because UnionDataSource doesn't allow empty unions.
            throw new ISE("Unexpectedly received empty union");
        } else if (unionDataSource.getDataSources().size() == 1) {
            // Single table. Run as a normal query.
            return baseRunner.run(queryPlus.withQuery(Queries.withBaseDataSource(query, Iterables.getOnlyElement(unionDataSource.getDataSources()))), responseContext);
        } else {
            // Split up the tables and merge their results.
            return new MergeSequence<>(query.getResultOrdering(), Sequences.simple(Lists.transform(IntStream.range(0, unionDataSource.getDataSources().size()).mapToObj(i -> new Pair<>(unionDataSource.getDataSources().get(i), i + 1)).collect(Collectors.toList()), (Function<Pair<TableDataSource, Integer>, Sequence<T>>) singleSourceWithIndex -> baseRunner.run(queryPlus.withQuery(Queries.withBaseDataSource(query, singleSourceWithIndex.lhs).withSubQueryId(generateSubqueryId(query.getSubQueryId(), singleSourceWithIndex.lhs.getName(), singleSourceWithIndex.rhs))), responseContext))));
        }
    } else {
        // Not a union of tables. Do nothing special.
        return baseRunner.run(queryPlus, responseContext);
    }
}
Also used : IntStream(java.util.stream.IntStream) Sequence(org.apache.druid.java.util.common.guava.Sequence) DataSourceAnalysis(org.apache.druid.query.planning.DataSourceAnalysis) Iterables(com.google.common.collect.Iterables) StringUtils(org.apache.commons.lang.StringUtils) Function(com.google.common.base.Function) MergeSequence(org.apache.druid.java.util.common.guava.MergeSequence) ResponseContext(org.apache.druid.query.context.ResponseContext) ISE(org.apache.druid.java.util.common.ISE) Collectors(java.util.stream.Collectors) Pair(org.apache.druid.java.util.common.Pair) Lists(com.google.common.collect.Lists) Sequences(org.apache.druid.java.util.common.guava.Sequences) Function(com.google.common.base.Function) ISE(org.apache.druid.java.util.common.ISE) DataSourceAnalysis(org.apache.druid.query.planning.DataSourceAnalysis) Pair(org.apache.druid.java.util.common.Pair)

Aggregations

Sequence (org.apache.druid.java.util.common.guava.Sequence)102 Test (org.junit.Test)53 List (java.util.List)44 DefaultDimensionSpec (org.apache.druid.query.dimension.DefaultDimensionSpec)37 ResponseContext (org.apache.druid.query.context.ResponseContext)32 ImmutableList (com.google.common.collect.ImmutableList)29 Intervals (org.apache.druid.java.util.common.Intervals)28 Granularities (org.apache.druid.java.util.common.granularity.Granularities)28 QueryRunner (org.apache.druid.query.QueryRunner)28 ArrayList (java.util.ArrayList)27 VirtualColumns (org.apache.druid.segment.VirtualColumns)26 Cursor (org.apache.druid.segment.Cursor)25 QueryPlus (org.apache.druid.query.QueryPlus)24 Result (org.apache.druid.query.Result)24 NullHandling (org.apache.druid.common.config.NullHandling)22 InitializedNullHandlingTest (org.apache.druid.testing.InitializedNullHandlingTest)22 MultipleIntervalSegmentSpec (org.apache.druid.query.spec.MultipleIntervalSegmentSpec)21 QueryableIndexStorageAdapter (org.apache.druid.segment.QueryableIndexStorageAdapter)20 DataSegment (org.apache.druid.timeline.DataSegment)20 ImmutableMap (com.google.common.collect.ImmutableMap)18