Loki: Remove distinct operation (#73938)

* remove distinct

* trigger ci

* update yarn.lock

* fix import
This commit is contained in:
Sven Grossmann
2023-08-28 19:26:59 +02:00
committed by GitHub
parent 9b9c9e83dc
commit 07eb4b1b90
14 changed files with 9 additions and 223 deletions

View File

@@ -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);