mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Remove distinct operation (#73938)
* remove distinct * trigger ci * update yarn.lock * fix import
This commit is contained in:
@@ -8,8 +8,6 @@ import {
|
||||
By,
|
||||
ConvOp,
|
||||
Decolorize,
|
||||
DistinctFilter,
|
||||
DistinctLabel,
|
||||
DropLabel,
|
||||
DropLabels,
|
||||
DropLabelsExpr,
|
||||
@@ -213,11 +211,6 @@ export function handleExpression(expr: string, node: SyntaxNode, context: Contex
|
||||
break;
|
||||
}
|
||||
|
||||
case DistinctFilter: {
|
||||
visQuery.operations.push(handleDistinctFilter(expr, node, context));
|
||||
break;
|
||||
}
|
||||
|
||||
case DropLabelsExpr: {
|
||||
visQuery.operations.push(handleDropFilter(expr, node, context));
|
||||
break;
|
||||
@@ -660,23 +653,6 @@ function isEmptyQuery(query: LokiVisualQuery) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function handleDistinctFilter(expr: string, node: SyntaxNode, context: Context): QueryBuilderOperation {
|
||||
const labels: string[] = [];
|
||||
let exploringNode = node.getChild(DistinctLabel);
|
||||
while (exploringNode) {
|
||||
const label = getString(expr, exploringNode.getChild(Identifier));
|
||||
if (label) {
|
||||
labels.push(label);
|
||||
}
|
||||
exploringNode = exploringNode?.getChild(DistinctLabel);
|
||||
}
|
||||
labels.reverse();
|
||||
return {
|
||||
id: LokiOperationId.Distinct,
|
||||
params: labels,
|
||||
};
|
||||
}
|
||||
|
||||
function handleDropFilter(expr: string, node: SyntaxNode, context: Context): QueryBuilderOperation {
|
||||
const labels: string[] = [];
|
||||
let exploringNode = node.getChild(DropLabels);
|
||||
|
||||
Reference in New Issue
Block a user