MySqlInsertParser extends MySqlSqlParser { @Override public void parse(ParseResult result) { statement = parser.parseStatement(); MySqlInsertStatement insert = (MySqlInsertStatement)statement; String tableName = StringUtil.removeBackquote(insert.getTableName().getSimpleName()); result.addTable(tableName); if (!BaymaxContext.isPartitionTable(tableName)){ return; } if (isMultiInsert(insert)){ throw new UnsupportedOperationException("分区表不支持insert into ...values (),()...或 insert into ...select.....形式的批量插入"); }else { result.setCalculateUnits(parserSingleInsert(tableName, insert)); } }  @Override void parse(ParseResult result); @Override void changeSql(ParseResult result, ExecutePlan plan);  }
@Test public void testParse() throws Exception { test(InsertTestSql.i1); }