mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user