Exemplo n.º 1
0
  @Before
  public void before() throws Exception {
    parser = new SQLParser();
    unparser = new BoundNodeToString();
    unparser.setUseBindings(true);

    String sql = fileContents(new File(RESOURCE_DIR, "schema.ddl"));
    SchemaFactory schemaFactory = new SchemaFactory(OptimizerTestBase.DEFAULT_SCHEMA);
    AkibanInformationSchema ais = schemaFactory.ais(sql);
    binder = new AISBinder(ais, OptimizerTestBase.DEFAULT_SCHEMA);
  }
Exemplo n.º 2
0
 @Override
 public String generateResult() throws Exception {
   StatementNode stmt = parser.parseStatement(sql);
   binder.bind(stmt);
   return unparser.toString(stmt);
 }