diff --git a/core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessor.java b/core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessor.java index a37fe04612ada6479f43d235304aa126b74215a4..2f79e8c5d55b54aa94cc11d793a2dd11d1d5c9ab 100644 --- a/core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessor.java +++ b/core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessor.java @@ -137,6 +137,7 @@ public class JsonQueryProcessor implements HttpRequestProcessor, Closeable { executeCachedSelect(context, dispatcher, state, socket, factory); } else { // new query + LOG.info().$("exec [q='").$(state.query).$("']").$(); final CompiledQuery cc = compiler.compile(state.query, sqlExecutionContext); queryExecutors.getQuick(cc.getType()).execute( context, diff --git a/core/src/main/java/io/questdb/griffin/SqlParser.java b/core/src/main/java/io/questdb/griffin/SqlParser.java index 7bc1362c5b4640f899492a1556a14e07d9d52f09..cfaa8f1c59525fe269f65d20d0b76dd33dd3639d 100644 --- a/core/src/main/java/io/questdb/griffin/SqlParser.java +++ b/core/src/main/java/io/questdb/griffin/SqlParser.java @@ -312,7 +312,7 @@ public final class SqlParser { model.setFileName(expectExpr(lexer)); return model; } - return null; + throw SqlException.$(lexer.lastTokenPosition(), "'from' expected"); } private ExecutionModel parseCreateStatement(GenericLexer lexer, SqlExecutionContext executionContext) throws SqlException { diff --git a/core/src/main/java/io/questdb/griffin/engine/groupby/GroupByUtils.java b/core/src/main/java/io/questdb/griffin/engine/groupby/GroupByUtils.java index 116fccb06de2c0e5dbcfb2838fdf7122e8775fa9..d3327bfe0d109fbe4a536937116d41836792d5dc 100644 --- a/core/src/main/java/io/questdb/griffin/engine/groupby/GroupByUtils.java +++ b/core/src/main/java/io/questdb/griffin/engine/groupby/GroupByUtils.java @@ -197,13 +197,21 @@ class GroupByUtils { static void updateFunctions(ObjList groupByFunctions, int n, MapValue value, Record record) { if (value.isNew()) { - for (int i = 0; i < n; i++) { - groupByFunctions.getQuick(i).computeFirst(value, record); - } + updateNew(groupByFunctions, n, value, record); } else { - for (int i = 0; i < n; i++) { - groupByFunctions.getQuick(i).computeNext(value, record); - } + updateExisting(groupByFunctions, n, value, record); + } + } + + private static void updateExisting(ObjList groupByFunctions, int n, MapValue value, Record record) { + for (int i = 0; i < n; i++) { + groupByFunctions.getQuick(i).computeNext(value, record); + } + } + + private static void updateNew(ObjList groupByFunctions, int n, MapValue value, Record record) { + for (int i = 0; i < n; i++) { + groupByFunctions.getQuick(i).computeFirst(value, record); } }