Loki Query Builder: Add parsing support for aggregations with grouping (#80145)

Loki Query Builder: Add parsing support for aggregations with grouping arguments
This commit is contained in:
Matias Chomicki
2024-01-08 17:17:19 +01:00
committed by GitHub
parent c60a1dddc2
commit 4950935401
2 changed files with 20 additions and 0 deletions

View File

@@ -501,11 +501,16 @@ function handleRangeAggregation(expr: string, node: SyntaxNode, context: Context
const params = number !== null && number !== undefined ? [getString(expr, number)] : [];
const range = logExpr?.getChild(Range);
const rangeValue = range ? getString(expr, range) : null;
const grouping = node.getChild(Grouping);
if (rangeValue) {
params.unshift(rangeValue.substring(1, rangeValue.length - 1));
}
if (grouping) {
params.push(...getAllByType(expr, grouping, Identifier));
}
const op = {
id: funcName,
params,