table = new FTable[DruidParserTestUtil.SEED.length];
for (int i = 0; i < DruidParserTestUtil.SEED.length; i++) {
String createTable = DruidParserTestUtil.SEED[i];
context.setSql(createTable);
druidParser.generatePlan(context);
Plan plan = context.getPlan();
if (plan instanceof CreateTablePlan) {
CreateTablePlan createPlan = (CreateTablePlan) plan;
table[i] = createPlan.getTable();
TableSchemaCacheReader.getService(conf).createTable(table[i]);
reader.addSchema(table[i].getTableName(), table[i]);
}
}
for (int i = 0; i < DruidParserTestUtil.INDEX_SEED.length; i++) {
String createIndex = DruidParserTestUtil.INDEX_SEED[i];
context.setSql(createIndex);
druidParser.generatePlan(context);
Plan plan = context.getPlan();
if (plan instanceof CreateIndexPlan) {
CreateIndexPlan createIndexPlan = (CreateIndexPlan) plan;
Index index = createIndexPlan.getIndex();
TableSchemaCacheReader.getService(conf).addIndex(
index.getDependentTableName(), index);