//test that new columns gets added to table schema
private void tableSchemaTest() throws Exception {
HowlSchema tableSchema = getTableSchema();
assertEquals(3, tableSchema.getFields().size());
//Update partition schema to have 3 fields
partitionColumns.add(HowlSchemaUtils.getHowlFieldSchema(new FieldSchema("c3", Constants.STRING_TYPE_NAME, "")));
writeRecords = new ArrayList<HowlRecord>();
for(int i = 0;i < 20;i++) {
List<Object> objList = new ArrayList<Object>();
objList.add(i);
objList.add("strvalue" + i);
objList.add("str2value" + i);
writeRecords.add(new DefaultHowlRecord(objList));
}
Map<String, String> partitionMap = new HashMap<String, String>();
partitionMap.put("part1", "p1value5");
runMRCreate(partitionMap, partitionColumns, writeRecords, 10);
tableSchema = getTableSchema();
//assert that c3 has got added to table schema
assertEquals(4, tableSchema.getFields().size());
assertEquals("c1", tableSchema.getFields().get(0).getName());
assertEquals("c2", tableSchema.getFields().get(1).getName());
assertEquals("c3", tableSchema.getFields().get(2).getName());
assertEquals("part1", tableSchema.getFields().get(3).getName());
//Test that changing column data type fails
partitionMap.clear();
partitionMap.put("part1", "p1value6");