Search in sources :

Example 1 with GroupAll

use of com.yahoo.bullet.query.aggregations.GroupAll in project bullet-core by yahoo.

the class QuerierTest method makeCountQueryWithAllWindow.

private static RunningQuery makeCountQueryWithAllWindow(BulletConfig config, int emitInterval) {
    GroupAll groupAll = new GroupAll(singleton(new GroupOperation(GroupOperation.GroupOperationType.COUNT, null, "COUNT")));
    Window window = WindowUtils.makeWindow(Window.Unit.TIME, emitInterval, Window.Unit.ALL, null);
    Query query = new Query(new Projection(), null, groupAll, null, window, null);
    query.configure(config);
    RunningQuery runningQuery = spy(makeRunningQuery("", query));
    Mockito.doReturn(false).when(runningQuery).isTimedOut();
    return runningQuery;
}
Also used : Window(com.yahoo.bullet.query.Window) Query(com.yahoo.bullet.query.Query) Projection(com.yahoo.bullet.query.Projection) GroupAll(com.yahoo.bullet.query.aggregations.GroupAll) GroupOperation(com.yahoo.bullet.querying.aggregations.grouping.GroupOperation)

Example 2 with GroupAll

use of com.yahoo.bullet.query.aggregations.GroupAll in project bullet-core by yahoo.

the class QueryUtils method makeGroupAllFilterQuery.

public static Query makeGroupAllFilterQuery(Expression filter, List<GroupOperation> operations) {
    Query query = new Query(new Projection(), filter, new GroupAll(new HashSet<>(operations)), null, new Window(), null);
    query.configure(new BulletConfig());
    return query;
}
Also used : GroupAll(com.yahoo.bullet.query.aggregations.GroupAll) BulletConfig(com.yahoo.bullet.common.BulletConfig) HashSet(java.util.HashSet)

Aggregations

GroupAll (com.yahoo.bullet.query.aggregations.GroupAll)2 BulletConfig (com.yahoo.bullet.common.BulletConfig)1 Projection (com.yahoo.bullet.query.Projection)1 Query (com.yahoo.bullet.query.Query)1 Window (com.yahoo.bullet.query.Window)1 GroupOperation (com.yahoo.bullet.querying.aggregations.grouping.GroupOperation)1 HashSet (java.util.HashSet)1