Skip to content

Commit 1b913c2

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent f0509dc commit 1b913c2

File tree

2 files changed

+3
-6
lines changed
  • x-pack/plugin/esql/src
    • main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math
    • test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math

2 files changed

+3
-6
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Scalb.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ public DataType dataType() {
141141
public ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
142142
var dEval = Cast.cast(source(), d.dataType(), DataType.DOUBLE, toEvaluator.apply(d));
143143
if (scaleFactor.foldable()) {
144-
Integer factor = switch(scaleFactor.dataType()) {
145-
case DataType.INTEGER -> (Integer)scaleFactor.fold(toEvaluator.foldCtx());
146-
case DataType.LONG -> Math.toIntExact((Long)scaleFactor.fold(toEvaluator.foldCtx()));
144+
Integer factor = switch (scaleFactor.dataType()) {
145+
case DataType.INTEGER -> (Integer) scaleFactor.fold(toEvaluator.foldCtx());
146+
case DataType.LONG -> Math.toIntExact((Long) scaleFactor.fold(toEvaluator.foldCtx()));
147147
default -> throw new IllegalStateException("Invalid type for scaleFactor, should be int or long.");
148148
};
149149
return new ScalbConstantEvaluator.Factory(source(), dEval, factor);

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/ScalbTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
import org.elasticsearch.xpack.esql.expression.function.AbstractScalarFunctionTestCase;
1818
import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier;
1919

20-
import java.math.BigInteger;
21-
import java.util.Collections;
2220
import java.util.List;
23-
import java.util.SequencedCollection;
2421
import java.util.function.Supplier;
2522

2623
import static org.hamcrest.Matchers.equalTo;

0 commit comments

Comments
 (0)