use of datawave.query.language.parser.jexl.LuceneToJexlQueryParser in project datawave by NationalSecurityAgency.
the class GroupingTest method testGroupingUsingLuceneFunctionWithDuplicateValues.
@Test
public void testGroupingUsingLuceneFunctionWithDuplicateValues() throws Exception {
Map<String, String> extraParameters = new HashMap<>();
extraParameters.put("group.fields.batch.size", "6");
Date startDate = format.parse("20091231");
Date endDate = format.parse("20150101");
String queryString = "(UUID:CORLEONE) and #GROUPBY('AGE','BIRTHDAY')";
// @formatter:off
Map<String, Integer> expectedMap = ImmutableMap.<String, Integer>builder().put("4-18", 1).put("5-40", 1).put("3-20", 1).put("1-24", 1).put("2-22", 1).put("22-22", 1).build();
// @formatter:on
logic.setParser(new LuceneToJexlQueryParser());
for (RebuildingScannerTestHelper.TEARDOWN teardown : TEARDOWNS) {
for (RebuildingScannerTestHelper.INTERRUPT interrupt : INTERRUPTS) {
runTestQueryWithGrouping(expectedMap, queryString, startDate, endDate, extraParameters, teardown, interrupt);
}
}
logic.setParser(new JexlControlledQueryParser());
}
Aggregations