use of com.yahoo.bullet.query.expressions.FieldExpression in project bullet-core by yahoo.
the class ExplodeFunctorTest method testApplyToNotList.
@Test
public void testApplyToNotList() {
Explode explode = new Explode(new FieldExpression("mapA"), "foo", null, false);
ExplodeFunctor functor = new ExplodeFunctor(explode);
List<BulletRecord> records = functor.apply(record, provider);
Assert.assertEquals(records.size(), 0);
}
use of com.yahoo.bullet.query.expressions.FieldExpression in project bullet-core by yahoo.
the class ExplodeFunctorTest method testApplyToList.
@Test
public void testApplyToList() {
Explode explode = new Explode(new FieldExpression("listA"), "foo", null, false);
ExplodeFunctor functor = new ExplodeFunctor(explode);
List<BulletRecord> records = functor.apply(record, provider);
Assert.assertEquals(records.size(), 3);
Assert.assertEquals(records.get(0).fieldCount(), 1);
Assert.assertEquals(records.get(0).typedGet("foo").getValue(), 0);
Assert.assertEquals(records.get(1).fieldCount(), 1);
Assert.assertEquals(records.get(1).typedGet("foo").getValue(), 1);
Assert.assertEquals(records.get(2).fieldCount(), 1);
Assert.assertEquals(records.get(2).typedGet("foo").getValue(), 2);
}
use of com.yahoo.bullet.query.expressions.FieldExpression in project bullet-core by yahoo.
the class ExplodeFunctorTest method testApplyToEmptyList.
@Test
public void testApplyToEmptyList() {
Explode explode = new Explode(new FieldExpression("listB"), "foo", null, false);
ExplodeFunctor functor = new ExplodeFunctor(explode);
List<BulletRecord> records = functor.apply(record, provider);
Assert.assertEquals(records.size(), 0);
}
use of com.yahoo.bullet.query.expressions.FieldExpression in project bullet-core by yahoo.
the class ExplodeFunctorTest method testApplyToNotMap.
@Test
public void testApplyToNotMap() {
Explode explode = new Explode(new FieldExpression("listA"), "foo", "bar", false);
ExplodeFunctor functor = new ExplodeFunctor(explode);
List<BulletRecord> records = functor.apply(record, provider);
Assert.assertEquals(records.size(), 0);
}
use of com.yahoo.bullet.query.expressions.FieldExpression in project bullet-core by yahoo.
the class ExplodeFunctorTest method testApplyToMap.
@Test
public void testApplyToMap() {
Explode explode = new Explode(new FieldExpression("mapA"), "foo", "bar", false);
ExplodeFunctor functor = new ExplodeFunctor(explode);
List<BulletRecord> records = functor.apply(record, provider);
Assert.assertEquals(records.size(), 3);
Assert.assertEquals(records.get(0).fieldCount(), 2);
Assert.assertEquals(records.get(0).typedGet("foo").getValue(), "a");
Assert.assertEquals(records.get(0).typedGet("bar").getValue(), 0);
Assert.assertEquals(records.get(1).fieldCount(), 2);
Assert.assertEquals(records.get(1).typedGet("foo").getValue(), "b");
Assert.assertEquals(records.get(1).typedGet("bar").getValue(), 1);
Assert.assertEquals(records.get(2).fieldCount(), 2);
Assert.assertEquals(records.get(2).typedGet("foo").getValue(), "c");
Assert.assertEquals(records.get(2).typedGet("bar").getValue(), 2);
}
Aggregations