use of com.yahoo.bullet.querying.postaggregations.OrderByStrategy in project bullet-core by yahoo.
the class OrderByTest method testOrderBy.
@Test
public void testOrderBy() {
OrderBy orderBy = new OrderBy(Arrays.asList(new OrderBy.SortItem(new FieldExpression("1"), OrderBy.Direction.ASC), new OrderBy.SortItem(new FieldExpression("2"), OrderBy.Direction.DESC)));
Assert.assertEquals(orderBy.getFields().size(), 2);
Assert.assertEquals(orderBy.getType(), PostAggregationType.ORDER_BY);
Assert.assertTrue(orderBy.getPostStrategy() instanceof OrderByStrategy);
Assert.assertEquals(orderBy.toString(), "{type: ORDER_BY, fields: [{expression: {field: 1, type: null}, direction: ASC}, {expression: {field: 2, type: null}, direction: DESC}]}");
}
Aggregations