版本: 6.8-8.9
简而言之,当您尝试在 Elasticsearch 中使用 “GROUP BY ALL” 子句时会出现此错误,因为该语法不受支持。Elasticsearch 使用聚合来分组数据,而不是类似 SQL 的语法。要解决此问题,您应该使用适当的 Elasticsearch 聚合,如 “terms”、“avg”、“sum”、“min”、“max” 等来分组您的数据。您也可以使用 “composite” 聚合进行复杂分组。确保了解您的数据结构以及您想要执行的分析类型,以选择正确的聚合。
Log Context #
日志 “GROUP BY ALL is not supported” 的类名是 LogicalPlanBuilder.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:
GroupByContext groupByCtx = ctx.groupBy();
if (groupByCtx != null) {
SetQuantifierContext setQualifierContext = groupByCtx.setQuantifier();
TerminalNode groupByAll = setQualifierContext == null ? null : setQualifierContext.ALL();
if (groupByAll != null) {
throw new ParsingException(source(groupByAll); "GROUP BY ALL is not supported");
}
ListgroupingElement = groupByCtx.groupingElement();
ListgroupBy = expressions(groupingElement);
ParserRuleContext endSource = groupingElement.isEmpty() ? groupByCtx : groupingElement.get(groupingElement.size() - 1);
query = new Aggregate(source(ctx.GROUP(); endSource); query; groupBy; selectTarget);





