use of com.yahoo.bullet.query.postaggregations.PostAggregation in project bullet-core by yahoo.
the class Querier method start.
// ********************************* Monoidal Interface Overrides *********************************
/**
* Starts the query.
*/
private void start() {
// Is an empty map if metadata was disabled
metaKeys = (Map<String, String>) config.getAs(BulletConfig.RESULT_METADATA_METRICS, Map.class);
boolean isRateLimitEnabled = config.getAs(BulletConfig.RATE_LIMIT_ENABLE, Boolean.class);
if (isRateLimitEnabled) {
int maxEmit = config.getAs(BulletConfig.RATE_LIMIT_MAX_EMIT_COUNT, Integer.class);
int timeInterval = config.getAs(BulletConfig.RATE_LIMIT_TIME_INTERVAL, Integer.class);
rateLimit = new RateLimiter(maxEmit, timeInterval);
}
Query query = runningQuery.getQuery();
Expression filter = query.getFilter();
if (filter != null) {
this.filter = new Filter(filter);
}
TableFunction tableFunction = query.getTableFunction();
if (tableFunction != null) {
tableFunctor = tableFunction.getTableFunctor();
}
com.yahoo.bullet.query.Projection projection = query.getProjection();
if (projection.getType() != PASS_THROUGH) {
this.projection = new Projection(projection.getFields());
}
// Aggregation and Strategy are guaranteed to not be null.
Strategy strategy = query.getAggregation().getStrategy(config);
List<PostAggregation> postAggregations = query.getPostAggregations();
if (postAggregations != null && !postAggregations.isEmpty()) {
postStrategies = postAggregations.stream().map(PostAggregation::getPostStrategy).collect(Collectors.toList());
}
// Scheme is guaranteed to not be null. It is constructed in its "start" state.
window = query.getWindow().getScheme(strategy, config);
}
Aggregations