use of com.yahoo.elide.datastores.aggregation.filter.visitor.FilterConstraints in project elide by yahoo.
the class DefaultQueryValidatorTest method testHavingFilterPromotionUngroupedDimension.
@Test
public void testHavingFilterPromotionUngroupedDimension() throws ParseException {
FilterExpression originalFilter = filterParser.parseFilterExpression("countryIsoCode==USA,lowScore<45", playerStatsType, false);
SplitFilterExpressionVisitor visitor = new SplitFilterExpressionVisitor(playerStatsTable);
FilterConstraints constraints = originalFilter.accept(visitor);
FilterExpression whereFilter = constraints.getWhereExpression();
FilterExpression havingFilter = constraints.getHavingExpression();
Query query = Query.builder().source(playerStatsTable).metricProjection(playerStatsTable.getMetricProjection("lowScore")).whereFilter(whereFilter).havingFilter(havingFilter).build();
validateQuery(query, "Invalid operation: Post aggregation filtering on 'countryIsoCode' requires the field to be projected in the response");
}
Aggregations