final Schema newSchema = SchemaCache.globalSchema(newAIS);
Plannable deletePlan = null;
Plannable insertPlan = null;
for(ChangeSet cs : changeSets) {
if(cs.hasSelectStatement()) {
SQLParser parser = server.getParser();
StatementNode insertStmt;
try {
insertStmt = parser.parseStatement("insert into " + newAIS.getTable(cs.getToTableId()).getName().toStringEscaped() + " " + cs.getSelectStatement());
} catch (StandardException e) {
throw new SQLParserInternalException(e);
}
StoreAdapter adapter = givenStore.createAdapter(session, SchemaCache.globalSchema(newAIS));
CreateAsCompiler compiler = new CreateAsCompiler(server, adapter, true, newAIS);