}
}
POCast op = new POCast(new OperatorKey("", r.nextLong()), -1);
POProject prj = new POProject(new OperatorKey("", r.nextLong()), -1, 0);
PhysicalPlan plan = new PhysicalPlan();
plan.add(prj);
plan.add(op);
plan.connect(prj, op);
prj.setResultType(DataType.INTEGER);
for(Iterator<Tuple> it = bag.iterator(); it.hasNext(); ) {
Tuple t = it.next();
plan.attachInput(t);
if(t.get(0) == null) {
Integer result = (Integer)op.getNext((Integer)null).result;
assertEquals( null, result);
}
}
prj.setResultType(DataType.FLOAT);
for(Iterator<Tuple> it = bag.iterator(); it.hasNext(); ) {
Tuple t = it.next();
plan.attachInput(t);
if(t.get(0) == null) {
Integer result = (Integer)op.getNext((Integer)null).result;
assertEquals( null, result);
}
}
prj.setResultType(DataType.DOUBLE);
for(Iterator<Tuple> it = bag.iterator(); it.hasNext(); ) {
Tuple t = it.next();
plan.attachInput(t);
if(t.get(0) == null) {
Double result = (Double) op.getNext((Double) null).result;
assertEquals(null, result);
}
}
prj.setResultType(DataType.CHARARRAY);
for(Iterator<Tuple> it = bag.iterator(); it.hasNext(); ) {
Tuple t = it.next();
plan.attachInput(t);
if(t.get(0) == null) {
String result = (String)op.getNext((String)null).result;
assertEquals( null, result);
}
}
prj.setResultType(DataType.BYTEARRAY);
TupleFactory tf = TupleFactory.getInstance();
{
Tuple t = tf.newTuple();