use of com.yahoo.bullet.query.aggregations.Raw in project bullet-core by yahoo.
the class RunningQueryTest method testStartTime.
@Test
public void testStartTime() {
long start = System.currentTimeMillis();
BulletConfig config = new BulletConfig();
Query query = new Query(new Projection(), null, new Raw(null), null, new Window(), null);
query.configure(config);
RunningQuery runningQuery = new RunningQuery("foo", query, new Metadata(null, null));
long end = System.currentTimeMillis();
Assert.assertTrue(runningQuery.getStartTime() >= start);
Assert.assertTrue(runningQuery.getStartTime() <= end);
Assert.assertFalse(runningQuery.isTimedOut());
}
use of com.yahoo.bullet.query.aggregations.Raw in project bullet-core by yahoo.
the class QueryTest method testValidateOuterQueryNoWindow.
@Test(expectedExceptions = BulletException.class, expectedExceptionsMessageRegExp = "Outer query cannot have a window\\.")
public void testValidateOuterQueryNoWindow() {
Query outerQuery = new Query(new Projection(), null, new Raw(null), null, new Window(1, Window.Unit.RECORD), null);
new Query(null, new Projection(), null, new Raw(null), null, outerQuery, new Window(), null);
}
use of com.yahoo.bullet.query.aggregations.Raw in project bullet-core by yahoo.
the class QueryTest method testDisableWindowing.
@Test
public void testDisableWindowing() {
BulletConfig config = new BulletConfig();
config.set(BulletConfig.WINDOW_DISABLE, true);
config.validate();
Query query = new Query(new Projection(), null, new Raw(null), null, WindowUtils.makeSlidingWindow(1), null);
query.configure(config);
Assert.assertNull(query.getWindow().getEmitEvery());
Assert.assertNull(query.getWindow().getEmitType());
Assert.assertNull(query.getWindow().getIncludeType());
Assert.assertNull(query.getWindow().getIncludeFirst());
}
use of com.yahoo.bullet.query.aggregations.Raw in project bullet-core by yahoo.
the class QueryTest method testWindowing.
@Test
public void testWindowing() {
BulletConfig config = new BulletConfig();
Query query = new Query(new Projection(), null, new Raw(null), null, WindowUtils.makeTumblingWindow(1), null);
query.configure(config);
Assert.assertEquals(query.getWindow().getEmitEvery(), (Integer) BulletConfig.DEFAULT_WINDOW_MIN_EMIT_EVERY);
}
use of com.yahoo.bullet.query.aggregations.Raw in project bullet-core by yahoo.
the class QueryUtils method makeSimpleAggregationFilterQuery.
public static Query makeSimpleAggregationFilterQuery(Expression filter, Integer size, Window.Unit emit, Integer emitValue, Window.Unit include, Integer includeValue) {
Window window = WindowUtils.makeWindow(emit, emitValue, include, includeValue);
Query query = new Query(new Projection(), filter, new Raw(size), null, window, null);
query.configure(new BulletConfig());
return query;
}
Aggregations