Search in sources :

Example 1 with ComputationStrategy

use of com.yahoo.bullet.querying.postaggregations.ComputationStrategy in project bullet-core by yahoo.

the class ComputationTest method testComputation.

@Test
public void testComputation() {
    Computation computation = new Computation(Collections.singletonList(new Field("abc", new ValueExpression(1))));
    Assert.assertEquals(computation.getFields(), Collections.singletonList(new Field("abc", new ValueExpression(1))));
    Assert.assertEquals(computation.getType(), PostAggregationType.COMPUTATION);
    Assert.assertEquals(computation.toString(), "{type: COMPUTATION, fields: [{name: abc, value: {value: 1, type: INTEGER}}]}");
    Assert.assertTrue(computation.getPostStrategy() instanceof ComputationStrategy);
}
Also used : Field(com.yahoo.bullet.query.Field) ComputationStrategy(com.yahoo.bullet.querying.postaggregations.ComputationStrategy) ValueExpression(com.yahoo.bullet.query.expressions.ValueExpression) Test(org.testng.annotations.Test)

Aggregations

Field (com.yahoo.bullet.query.Field)1 ValueExpression (com.yahoo.bullet.query.expressions.ValueExpression)1 ComputationStrategy (com.yahoo.bullet.querying.postaggregations.ComputationStrategy)1 Test (org.testng.annotations.Test)1