context.setTsr(reader);
DruidDQLParser dqlParser = new DruidDQLParser(conf, null);
DruidDDLParser ddlParser = new DruidDDLParser(conf);
DruidDMLParser dmlParser = new DruidDMLParser(conf, null);
WaspParser druidParser = new WaspParser(ddlParser, dqlParser, dmlParser);
// create table
context.setSql(createTable);
druidParser.generatePlan(context);
Plan plan = context.getPlan();
if (plan instanceof CreateTablePlan) {
CreateTablePlan createPlan = (CreateTablePlan) plan;
FTable table = createPlan.getTable();
TableSchemaCacheReader.getService(conf).createTable(table);
}
// insert
context.setSql(insert);
druidParser.generatePlan(context);
plan = context.getPlan();
if (plan instanceof InsertPlan) {
InsertPlan insertPlan = (InsertPlan) plan;
List<InsertAction> actions = insertPlan.getActions();
Assert.assertEquals(actions.size(), 1);