use of com.questdb.griffin.lexer.model.ParsedModel in project questdb by bluestreak01.
the class SqlLexerOptimiserTest method assertCreateTable.
private void assertCreateTable(String expected, String ddl, TableModel... tableModels) throws ParserException {
createModelsAndRun(() -> {
ParsedModel model = parser.parse(ddl);
Assert.assertEquals(ParsedModel.CREATE_TABLE, model.getModelType());
Assert.assertTrue(model instanceof CreateTableModel);
sink.clear();
((CreateTableModel) model).toSink(sink);
TestUtils.assertEquals(expected, sink);
}, tableModels);
}
use of com.questdb.griffin.lexer.model.ParsedModel in project questdb by bluestreak01.
the class SqlLexerOptimiserTest method assertQuery.
private void assertQuery(String expected, String query, TableModel... tableModels) throws ParserException {
createModelsAndRun(() -> {
sink.clear();
ParsedModel model = parser.parse(query);
Assert.assertEquals(model.getModelType(), ParsedModel.QUERY);
((QueryModel) model).toSink(sink);
TestUtils.assertEquals(expected, sink);
}, tableModels);
}
Aggregations