/** * Gets the collection of having filters to be applied from the druid query. * * @param builder The RelBuilder created with Calcite. * @param druidQuery The query to find the having filter from. * @param apiToFieldMapper The mapping from api to physical name. * * @return the collection of equivalent filters for calcite. */ protected Collection<RexNode> getHavingFilter( RelBuilder builder, DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper ) { RexNode filter = null; if (druidQuery.getQueryType().equals(GROUP_BY)) { Having having = ((GroupByQuery) druidQuery).getHaving(); if (having != null) { filter = havingEvaluator.evaluateHaving(having, builder, apiToFieldMapper); } } return Collections.singletonList(filter); }