use of io.druid.query.search.search.SearchQuery in project druid by druid-io.
the class SearchQueryRunnerWithCaseTest method testSearch.
@Test
public void testSearch() {
Druids.SearchQueryBuilder builder = testBuilder();
Map<String, Set<String>> expectedResults = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);
SearchQuery searchQuery;
searchQuery = builder.query("SPOT").build();
expectedResults.put(marketDimension, Sets.newHashSet("spot", "SPot"));
checkSearchQuery(searchQuery, expectedResults);
searchQuery = builder.query("spot", true).build();
expectedResults.put(marketDimension, Sets.newHashSet("spot"));
checkSearchQuery(searchQuery, expectedResults);
searchQuery = builder.query("SPot", true).build();
expectedResults.put(marketDimension, Sets.newHashSet("SPot"));
checkSearchQuery(searchQuery, expectedResults);
}
use of io.druid.query.search.search.SearchQuery in project druid by druid-io.
the class AppendTest method testFilteredSearch2.
@Test
public void testFilteredSearch2() {
List<Result<SearchResultValue>> expectedResults = Arrays.asList(new Result<SearchResultValue>(new DateTime("2011-01-12T00:00:00.000Z"), new SearchResultValue(Arrays.<SearchHit>asList(new SearchHit(placementishDimension, "a"), new SearchHit(placementDimension, "mezzanine"), new SearchHit(marketDimension, "total_market")))));
SearchQuery query = makeFilteredSearchQuery();
QueryRunner runner = TestQueryRunners.makeSearchQueryRunner(segment2);
HashMap<String, Object> context = new HashMap<String, Object>();
TestHelper.assertExpectedResults(expectedResults, runner.run(query, context));
}
use of io.druid.query.search.search.SearchQuery in project druid by druid-io.
the class AppendTest method testSearchWithOverlap.
@Test
public void testSearchWithOverlap() {
List<Result<SearchResultValue>> expectedResults = Arrays.asList(new Result<SearchResultValue>(new DateTime("2011-01-12T00:00:00.000Z"), new SearchResultValue(Arrays.<SearchHit>asList(new SearchHit(placementishDimension, "a"), new SearchHit(placementDimension, "mezzanine"), new SearchHit(marketDimension, "total_market")))));
SearchQuery query = makeSearchQuery();
QueryRunner runner = TestQueryRunners.makeSearchQueryRunner(segment2);
HashMap<String, Object> context = new HashMap<String, Object>();
TestHelper.assertExpectedResults(expectedResults, runner.run(query, context));
}
use of io.druid.query.search.search.SearchQuery in project druid by druid-io.
the class AppendTest method testSearch.
@Test
public void testSearch() {
List<Result<SearchResultValue>> expectedResults = Arrays.asList(new Result<SearchResultValue>(new DateTime("2011-01-12T00:00:00.000Z"), new SearchResultValue(Arrays.<SearchHit>asList(new SearchHit(placementishDimension, "a"), new SearchHit(qualityDimension, "automotive"), new SearchHit(placementDimension, "mezzanine"), new SearchHit(marketDimension, "total_market")))));
SearchQuery query = makeSearchQuery();
QueryRunner runner = TestQueryRunners.makeSearchQueryRunner(segment);
HashMap<String, Object> context = new HashMap<String, Object>();
TestHelper.assertExpectedResults(expectedResults, runner.run(query, context));
}
use of io.druid.query.search.search.SearchQuery in project druid by druid-io.
the class SchemalessTestFullTest method testFullOnSearch.
private void testFullOnSearch(QueryRunner runner, List<Result<SearchResultValue>> expectedResults, String failMsg) {
SearchQuery query = Druids.newSearchQueryBuilder().dataSource(dataSource).granularity(allGran).intervals(fullOnInterval).query("a").build();
failMsg += " search ";
HashMap<String, Object> context = new HashMap<>();
Iterable<Result<SearchResultValue>> actualResults = Sequences.toList(runner.run(query, context), Lists.<Result<SearchResultValue>>newArrayList());
TestHelper.assertExpectedResults(expectedResults, actualResults, failMsg);
}
Aggregations