use of com.questdb.griffin.lexer.model.QueryModel 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);
}
use of com.questdb.griffin.lexer.model.QueryModel in project questdb by bluestreak01.
the class SqlLexerOptimiserTest method testTooManyColumnsEdgeInOrderBy.
@Test
public void testTooManyColumnsEdgeInOrderBy() throws Exception {
try (TableModel model = new TableModel(configuration, "x", PartitionBy.NONE)) {
for (int i = 0; i < SqlLexerOptimiser.MAX_ORDER_BY_COLUMNS - 1; i++) {
model.col("f" + i, ColumnType.INT);
}
CairoTestUtils.create(model);
}
StringBuilder b = new StringBuilder();
b.append("x order by ");
for (int i = 0; i < SqlLexerOptimiser.MAX_ORDER_BY_COLUMNS - 1; i++) {
if (i > 0) {
b.append(',');
}
b.append('f').append(i);
}
QueryModel st = (QueryModel) parser.parse(b);
Assert.assertEquals(SqlLexerOptimiser.MAX_ORDER_BY_COLUMNS - 1, st.getOrderBy().size());
}
use of com.questdb.griffin.lexer.model.QueryModel in project questdb by bluestreak01.
the class QueryCompiler method compile.
private RecordCursorFactory compile(ParsedModel model) {
if (model.getModelType() == ParsedModel.QUERY) {
clearState();
final QueryModel qm = (QueryModel) model;
// rs.setParameterMap(EMPTY_PARAMS);
return null;
}
throw new IllegalArgumentException("QueryModel expected");
}
Aggregations