use of com.yahoo.bullet.parsing.Aggregation in project bullet-core by yahoo.
the class WindowingOperationsTest method testRawReactiveWindow.
@Test
public void testRawReactiveWindow() {
BulletConfig config = new BulletConfig();
Query query = new Query();
Window window = WindowUtils.makeReactiveWindow();
window.configure(config);
query.setWindow(window);
Aggregation aggregation = new Aggregation();
aggregation.setType(Aggregation.Type.RAW);
query.setAggregation(aggregation);
Assert.assertEquals(WindowingOperations.findScheme(query, null, config).getClass(), Reactive.class);
}
use of com.yahoo.bullet.parsing.Aggregation in project bullet-core by yahoo.
the class AggregationOperationsTest method testGroupByStrategy.
@Test
public void testGroupByStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.GROUP);
aggregation.setFields(singletonMap("field", "foo"));
aggregation.setAttributes(singletonMap(GroupOperation.OPERATIONS, singletonList(singletonMap(GroupOperation.OPERATION_TYPE, GroupOperation.GroupOperationType.COUNT.getName()))));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), GroupBy.class);
}
use of com.yahoo.bullet.parsing.Aggregation in project bullet-core by yahoo.
the class AggregationOperationsTest method testCountDistinctStrategy.
@Test
public void testCountDistinctStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.COUNT_DISTINCT);
aggregation.setFields(singletonMap("field", "foo"));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), CountDistinct.class);
}
use of com.yahoo.bullet.parsing.Aggregation in project bullet-core by yahoo.
the class AggregationOperationsTest method testTopKStrategy.
@Test
public void testTopKStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.TOP_K);
aggregation.setFields(singletonMap("field", "foo"));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), TopK.class);
}
use of com.yahoo.bullet.parsing.Aggregation in project bullet-core by yahoo.
the class AggregationOperationsTest method testNullType.
@Test(expectedExceptions = NullPointerException.class)
public void testNullType() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(null);
aggregation.configure(config);
AggregationOperations.findStrategy(aggregation, config);
}
Aggregations