Search in sources :

Example 1 with ParsedModel

use of com.questdb.parser.sql.model.ParsedModel in project questdb by bluestreak01.

the class AbstractQueryContext method executeQuery.

private RecordSource executeQuery(ChunkedResponse r, Factory factory) throws ParserException, DisconnectedChannelException, SlowWritableChannelException {
    QueryCompiler compiler = COMPILER.get();
    ParsedModel model = compiler.parse(query);
    switch(model.getModelType()) {
        case ParsedModel.QUERY:
            return compiler.compile(factory, model);
        default:
            try {
                compiler.execute(factory, model);
            } catch (JournalException e) {
                error().$("Server error executing statement ").$(query).$(e).$();
                sendException(r, 0, e.getMessage(), 500);
            }
            return null;
    }
}
Also used : JournalException(com.questdb.std.ex.JournalException) QueryCompiler(com.questdb.parser.sql.QueryCompiler) ParsedModel(com.questdb.parser.sql.model.ParsedModel)

Aggregations

QueryCompiler (com.questdb.parser.sql.QueryCompiler)1 ParsedModel (com.questdb.parser.sql.model.ParsedModel)1 JournalException (com.questdb.std.ex.JournalException)1