Skip to content

Commit f9610e6

Browse files
committed
Apply spotless suggestions
1 parent de90f2b commit f9610e6

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/promql/PromqlFoldingUtils.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ private static Duration arithmetics(Source source, Number scalar, Duration durat
116116
case ADD -> arithmetics(source, duration, scalar, ArithmeticOp.ADD);
117117
case SUB -> arithmetics(source, Duration.ofSeconds(scalar.longValue()), duration, ArithmeticOp.SUB);
118118
case MUL -> arithmetics(source, duration, scalar, ArithmeticOp.MUL);
119-
default -> throw new ParsingException(
120-
source,
121-
"Operation [{}] not supported with scalar on left and duration on right",
122-
op
123-
);
119+
default -> throw new ParsingException(source, "Operation [{}] not supported with scalar on left and duration on right", op);
124120
};
125121
}
126122

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/promql/PromqlLogicalPlanBuilder.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.elasticsearch.xpack.esql.expression.promql.predicate.operator.comparison.VectorBinaryComparison.ComparisonOp;
2929
import org.elasticsearch.xpack.esql.expression.promql.predicate.operator.set.VectorBinarySet;
3030
import org.elasticsearch.xpack.esql.expression.promql.subquery.Subquery;
31-
import org.elasticsearch.xpack.esql.parser.EsqlBaseParser;
3231
import org.elasticsearch.xpack.esql.parser.ParsingException;
3332
import org.elasticsearch.xpack.esql.parser.PromqlBaseParser;
3433
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan;
@@ -296,7 +295,7 @@ public LogicalPlan visitArithmeticBinary(PromqlBaseParser.ArithmeticBinaryContex
296295
Object leftValue = leftLiteral.value();
297296
Object rightValue = rightLiteral.value();
298297

299-
// arithmetics
298+
// arithmetics
300299
if (binaryOperator instanceof ArithmeticOp arithmeticOp) {
301300
Object result = PromqlFoldingUtils.evaluate(source, leftValue, rightValue, arithmeticOp);
302301
DataType resultType = determineResultType(result);
@@ -356,20 +355,12 @@ public LogicalPlan visitArithmeticBinary(PromqlBaseParser.ArithmeticBinaryContex
356355

357356
return switch (binaryOperator) {
358357
case ArithmeticOp arithmeticOp -> new VectorBinaryArithmetic(source, le, re, modifier, arithmeticOp);
359-
case ComparisonOp comparisonOp -> new VectorBinaryComparison(
360-
source,
361-
le,
362-
re,
363-
modifier,
364-
bool,
365-
comparisonOp
366-
);
358+
case ComparisonOp comparisonOp -> new VectorBinaryComparison(source, le, re, modifier, bool, comparisonOp);
367359
case VectorBinarySet.SetOp setOp -> new VectorBinarySet(source, le, re, modifier, setOp);
368360
default -> throw new ParsingException(source(ctx.op), "Unknown arithmetic {}", opText);
369361
};
370362
}
371363

372-
373364
private BinaryOp binaryOp(Token opType) {
374365
return switch (opType.getType()) {
375366
case CARET -> ArithmeticOp.POW;

0 commit comments

Comments
 (0)