use of org.apache.druid.query.Druids.SearchQueryBuilder in project druid by druid-io.
the class SearchQueryRunnerWithCaseTest method testFallbackToCursorBasedPlan.
@Test
public void testFallbackToCursorBasedPlan() {
final SearchQueryBuilder builder = testBuilder();
final SearchQuery query = builder.filters("qualityLong", "1000").build();
final Map<String, Set<String>> expectedResults = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
expectedResults.put("qualityLong", Sets.newHashSet("1000"));
expectedResults.put("qualityDouble", Sets.newHashSet("10000.0"));
expectedResults.put("qualityFloat", Sets.newHashSet("10000.0"));
expectedResults.put("qualityNumericString", Sets.newHashSet("100000"));
expectedResults.put("longNumericNull", Sets.newHashSet("10"));
expectedResults.put("floatNumericNull", Sets.newHashSet("10.0"));
expectedResults.put("doubleNumericNull", Sets.newHashSet("10.0"));
expectedResults.put("quality", Sets.newHashSet("AutoMotive", "automotive"));
expectedResults.put("placement", Sets.newHashSet("PREFERRED", "preferred"));
expectedResults.put("placementish", Sets.newHashSet("a", "preferred"));
expectedResults.put("market", Sets.newHashSet("spot"));
checkSearchQuery(query, expectedResults);
}
use of org.apache.druid.query.Druids.SearchQueryBuilder in project druid by druid-io.
the class SearchBenchmark method setupQueries.
private void setupQueries() {
// queries for the basic schema
final Map<String, SearchQueryBuilder> basicQueries = new LinkedHashMap<>();
final GeneratorSchemaInfo basicSchema = GeneratorBasicSchemas.SCHEMA_MAP.get("basic");
final List<String> queryTypes = ImmutableList.of("A", "B", "C", "D");
for (final String eachType : queryTypes) {
basicQueries.put(eachType, makeQuery(eachType, basicSchema));
}
SCHEMA_QUERY_MAP.put("basic", basicQueries);
}
Aggregations