@Test public void testFullSelectNoDimensionAndMetric() { SelectQuery query = newTestQuery() .intervals(I_0112_0114_SPEC) .dimensionSpecs(DefaultDimensionSpec.toSpec("foo")) .metrics(Collections.singletonList("foo2")) .build(); Iterable<Result<SelectResultValue>> results = runner.run(QueryPlus.wrap(query), new HashMap<>()).toList(); final List<List<Map<String, Object>>> events = toEvents( new String[]{ EventHolder.timestampKey + ":TIME", "foo:NULL", "foo2:NULL" }, V_0112_0114 ); PagingOffset offset = query.getPagingOffset(segmentIdString); List<Result<SelectResultValue>> expectedResults = toExpected( segmentIdString, events, Collections.singletonList("foo"), Collections.singletonList("foo2"), offset.startOffset(), offset.threshold() ); verify(expectedResults, results); }
Collections.singletonList("index"), offset.startOffset(), offset.threshold() ); verify(expectedResults, results);
@Test public void testSelectPagination() { SelectQuery query = newTestQuery() .intervals(I_0112_0114_SPEC) .dimensionSpecs(DefaultDimensionSpec.toSpec(QueryRunnerTestHelper.qualityDimension)) .metrics(Collections.singletonList(QueryRunnerTestHelper.indexMetric)) .pagingSpec(new PagingSpec(toPagingIdentifier(3, descending), 3)) .build(); Iterable<Result<SelectResultValue>> results = runner.run(QueryPlus.wrap(query), new HashMap<>()).toList(); PagingOffset offset = query.getPagingOffset(segmentIdString); List<Result<SelectResultValue>> expectedResults = toExpected( segmentIdString, toEvents( new String[]{ EventHolder.timestampKey + ":TIME", "foo:NULL", "foo2:NULL" }, V_0112_0114 ), Collections.singletonList("quality"), Collections.singletonList("index"), offset.startOffset(), offset.threshold() ); verify(expectedResults, results); }
), offset.startOffset(), offset.threshold() ); verify(expectedResults, populateNullColumnAtLastForQueryableIndexCase(results, "null_column"));
Collections.singletonList(QueryRunnerTestHelper.indexMetric), offset.startOffset(), offset.threshold() );
Collections.singletonList("index"), offset.startOffset(), offset.threshold() ); verify(expectedResults, results);
Collections.singletonList("index"), offset.startOffset(), offset.threshold() ); verify(expectedResults, results);