public void testModifyMaterializedViewStructureRejected() throws IOException {
String testDir = BuildDirectoryUtils.getBuildDirectoryPath();
// with a view
VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL);");
builder.addLiteralSchema("\nCREATE VIEW MATVIEW(C1, NUM) AS " +
"\n SELECT C1, COUNT(*) FROM A GROUP BY C1;");
builder.addPartitionInfo("A", "C1");
builder.addProcedures(org.voltdb.catalog.ProcedureA.class);
builder.compile(testDir + File.separator + "modmatview1.jar");
Catalog catOriginal = catalogForJar(testDir + File.separator + "modmatview1.jar");
// with a quite different view
builder = new VoltProjectBuilder();
builder.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL);");
builder.addLiteralSchema("\nCREATE VIEW MATVIEW(C2, C1, NUM) AS " +
"\n SELECT C2, C1, COUNT(*) FROM A GROUP BY C2, C1;");
builder.addPartitionInfo("A", "C1");
builder.addProcedures(org.voltdb.catalog.ProcedureA.class);
builder.compile(testDir + File.separator + "modmatview2.jar");
Catalog catUpdated = catalogForJar(testDir + File.separator + "modmatview2.jar");
verifyDiffRejected(catOriginal, catUpdated);
}