提交 3c60662e 编写于 作者: V Vlad Ilyushchenko

GRIFFIN: bugfixes

上级 ca7ee6ad
......@@ -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,
......
......@@ -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 {
......
......@@ -197,13 +197,21 @@ class GroupByUtils {
static void updateFunctions(ObjList<GroupByFunction> 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<GroupByFunction> 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<GroupByFunction> groupByFunctions, int n, MapValue value, Record record) {
for (int i = 0; i < n; i++) {
groupByFunctions.getQuick(i).computeFirst(value, record);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册