### Question:
Over extends EvalFunc<DataBag> { @Override public Schema outputSchema(Schema inputSch) { try { if (returnType == DataType.UNKNOWN) { return Schema.generateNestedSchema(DataType.BAG, DataType.NULL); } else { Schema outputTupleSchema = new Schema(new Schema.FieldSchema(returnName, returnType)); return new Schema(new Schema.FieldSchema( getSchemaName(this.getClass().getName().toLowerCase(), inputSch), outputTupleSchema, DataType.BAG)); } } catch (FrontendException fe) { throw new RuntimeException("Unable to create nested schema", fe); } } Over();  Over(String typespec); @Override DataBag exec(Tuple input); @Override Schema outputSchema(Schema inputSch);  }### Answer:
@Test public void testSchema() throws Exception { Over func = new Over(); Schema in = Schema.generateNestedSchema(DataType.BAG, DataType.INTEGER); Schema out = func.outputSchema(in); assertEquals("{{NULL}}", out.toString()); func = new Over("chararray"); in = Schema.generateNestedSchema(DataType.BAG, DataType.INTEGER); out = func.outputSchema(in); assertEquals("{org.apache.pig.piggybank.evaluation.over_1: {result: chararray}}", out.toString()); func = new Over("Int"); in = Schema.generateNestedSchema(DataType.BAG, DataType.INTEGER); out = func.outputSchema(in); assertEquals("{org.apache.pig.piggybank.evaluation.over_2: {result: int}}", out.toString()); func = new Over("DOUBLE"); in = Schema.generateNestedSchema(DataType.BAG, DataType.INTEGER); out = func.outputSchema(in); assertEquals("{org.apache.pig.piggybank.evaluation.over_3: {result: double}}", out.toString()); func = new Over("bob:chararray"); in = Schema.generateNestedSchema(DataType.BAG, DataType.INTEGER); out = func.outputSchema(in); assertEquals("{org.apache.pig.piggybank.evaluation.over_4: {bob: chararray}}", out.toString()); }