Program: 6438
Project: 6438
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void testTableToTableWithValidations() throws Exception {
  Schema schema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.INT)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.DOUBLE)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)));
  ETLStage source=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str",Properties.Table.PROPERTY_SCHEMA_ROW_FIELD,"String_Node_Str",Properties.Table.PROPERTY_SCHEMA,schema.toString()));
  String validationScript="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ETLStage transform=new ETLStage("String_Node_Str",ImmutableMap.of("String_Node_Str","String_Node_Str","String_Node_Str",validationScript),"String_Node_Str");
  List<ETLStage> transformList=new ArrayList<>();
  transformList.add(transform);
  ETLStage sink=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str",Properties.Table.PROPERTY_SCHEMA_ROW_FIELD,"String_Node_Str"));
  ETLBatchConfig etlConfig=new ETLBatchConfig("String_Node_Str",source,sink,transformList);
  AppRequest<ETLBatchConfig> appRequest=new AppRequest<>(ETLBATCH_ARTIFACT,etlConfig);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(appId,appRequest);
  DataSetManager<Table> inputManager=getDataset("String_Node_Str");
  Table inputTable=inputManager.get();
  Put put=new Put(Bytes.toBytes("String_Node_Str"));
  put.add("String_Node_Str","String_Node_Str");
  put.add("String_Node_Str",5);
  put.add("String_Node_Str",123.45);
  put.add("String_Node_Str","String_Node_Str");
  inputTable.put(put);
  inputManager.flush();
  put=new Put(Bytes.toBytes("String_Node_Str"));
  put.add("String_Node_Str","String_Node_Str");
  put.add("String_Node_Str",10);
  put.add("String_Node_Str",123456789d);
  put.add("String_Node_Str","String_Node_Str");
  inputTable.put(put);
  inputManager.flush();
  MapReduceManager mrManager=appManager.getMapReduceManager(ETLMapReduce.NAME);
  mrManager.start();
  mrManager.waitForFinish(5,TimeUnit.MINUTES);
  DataSetManager<Table> outputManager=getDataset("String_Node_Str");
  Table outputTable=outputManager.get();
  Row row=outputTable.get(Bytes.toBytes("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",row.getString("String_Node_Str"));
  Assert.assertEquals(5,(int)row.getInt("String_Node_Str"));
  Assert.assertTrue(Math.abs(123.45 - row.getDouble("String_Node_Str")) < 0.000001);
  Assert.assertEquals("String_Node_Str",row.getString("String_Node_Str"));
  row=outputTable.get(Bytes.toBytes("String_Node_Str"));
  Assert.assertEquals(0,row.getColumns().size());
  DataSetManager<TimePartitionedFileSet> fileSetManager=getDataset("String_Node_Str");
  TimePartitionedFileSet fileSet=fileSetManager.get();
  List<GenericRecord> records=readOutput(fileSet,ETLMapReduce.ERROR_SCHEMA);
  Assert.assertEquals(1,records.size());
  fileSet.close();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testTableToTableWithValidations() throws Exception {
  Schema schema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.INT)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.DOUBLE)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)));
  ETLStage source=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str",Properties.Table.PROPERTY_SCHEMA_ROW_FIELD,"String_Node_Str",Properties.Table.PROPERTY_SCHEMA,schema.toString()));
  String validationScript="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ETLStage transform=new ETLStage("String_Node_Str",ImmutableMap.of("String_Node_Str","String_Node_Str","String_Node_Str",validationScript),"String_Node_Str");
  List<ETLStage> transformList=new ArrayList<>();
  transformList.add(transform);
  ETLStage sink=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str",Properties.Table.PROPERTY_SCHEMA_ROW_FIELD,"String_Node_Str"));
  ETLBatchConfig etlConfig=new ETLBatchConfig("String_Node_Str",source,sink,transformList);
  AppRequest<ETLBatchConfig> appRequest=new AppRequest<>(ETLBATCH_ARTIFACT,etlConfig);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(appId,appRequest);
  DataSetManager<Table> inputManager=getDataset("String_Node_Str");
  Table inputTable=inputManager.get();
  Put put=new Put(Bytes.toBytes("String_Node_Str"));
  put.add("String_Node_Str","String_Node_Str");
  put.add("String_Node_Str",5);
  put.add("String_Node_Str",123.45);
  put.add("String_Node_Str","String_Node_Str");
  inputTable.put(put);
  inputManager.flush();
  put=new Put(Bytes.toBytes("String_Node_Str"));
  put.add("String_Node_Str","String_Node_Str");
  put.add("String_Node_Str",10);
  put.add("String_Node_Str",123456789d);
  put.add("String_Node_Str","String_Node_Str");
  inputTable.put(put);
  inputManager.flush();
  MapReduceManager mrManager=appManager.getMapReduceManager(ETLMapReduce.NAME);
  mrManager.start();
  mrManager.waitForFinish(5,TimeUnit.MINUTES);
  DataSetManager<Table> outputManager=getDataset("String_Node_Str");
  Table outputTable=outputManager.get();
  Row row=outputTable.get(Bytes.toBytes("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",row.getString("String_Node_Str"));
  Assert.assertEquals(5,(int)row.getInt("String_Node_Str"));
  Assert.assertTrue(Math.abs(123.45 - row.getDouble("String_Node_Str")) < 0.000001);
  Assert.assertEquals("String_Node_Str",row.getString("String_Node_Str"));
  row=outputTable.get(Bytes.toBytes("String_Node_Str"));
  Assert.assertEquals(0,row.getColumns().size());
  DataSetManager<TimePartitionedFileSet> fileSetManager=getDataset("String_Node_Str");
  try (TimePartitionedFileSet fileSet=fileSetManager.get()){
    List<GenericRecord> records=readOutput(fileSet,ETLMapReduce.ERROR_SCHEMA);
    Assert.assertEquals(1,records.size());
  }
 }