Search in sources :

Example 1 with VespaGroupingStep

use of com.yahoo.search.yql.VespaGroupingStep in project vespa by vespa-engine.

the class GroupingParserTestCase method assertYqlParsable.

private static void assertYqlParsable(String request, String... expectedOperations) {
    YqlParser parser = new YqlParser(new ParserEnvironment());
    parser.parse(new Parsable().setQuery("select foo from bar where baz contains 'baz' | " + request + ";"));
    List<VespaGroupingStep> steps = parser.getGroupingSteps();
    List<String> actual = new ArrayList<>(steps.size());
    for (VespaGroupingStep step : steps) {
        actual.add(step.getOperation().toString());
    }
    if (expectedOperations.length > 0) {
        assertEquals(Arrays.asList(expectedOperations), actual);
    }
}
Also used : YqlParser(com.yahoo.search.yql.YqlParser) VespaGroupingStep(com.yahoo.search.yql.VespaGroupingStep) ArrayList(java.util.ArrayList) Parsable(com.yahoo.search.query.parser.Parsable) ParserEnvironment(com.yahoo.search.query.parser.ParserEnvironment)

Aggregations

Parsable (com.yahoo.search.query.parser.Parsable)1 ParserEnvironment (com.yahoo.search.query.parser.ParserEnvironment)1 VespaGroupingStep (com.yahoo.search.yql.VespaGroupingStep)1 YqlParser (com.yahoo.search.yql.YqlParser)1 ArrayList (java.util.ArrayList)1