Search in sources :

Example 1 with OrderByStrategy

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}]}");
}
Also used : FieldExpression(com.yahoo.bullet.query.expressions.FieldExpression) OrderByStrategy(com.yahoo.bullet.querying.postaggregations.OrderByStrategy) Test(org.testng.annotations.Test)

Aggregations

FieldExpression (com.yahoo.bullet.query.expressions.FieldExpression)1 OrderByStrategy (com.yahoo.bullet.querying.postaggregations.OrderByStrategy)1 Test (org.testng.annotations.Test)1