Skip to content

Commit e7736be

Browse files
[CI] Auto commit changes from spotless
1 parent 8317911 commit e7736be

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/plugin/KnnFunctionIT.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public void testKnn() {
4848
assertEquals(i, row.getFirst());
4949
@SuppressWarnings("unchecked")
5050
// Vectors should be the same
51-
List<Double> floats = (List<Double>)row.get(1);
52-
for(int j = 0; j < floats.size(); j++) {
51+
List<Double> floats = (List<Double>) row.get(1);
52+
for (int j = 0; j < floats.size(); j++) {
5353
assertEquals(floats.get(j).floatValue(), indexedVectors.get(i).get(j), 0f);
5454
}
5555
var score = (Double) row.get(2);

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/vector/Knn.java

+4-12
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,10 @@ public class Knn extends Function implements TranslationAware {
4646
private final Expression field;
4747
private final Expression query;
4848

49-
@FunctionInfo(
50-
returnType = "boolean",
51-
preview = true,
52-
description = """
53-
Finds the k nearest vectors to a query vector, as measured by a similarity metric.
54-
knn function finds nearest vectors through approximate search on indexed dense_vectors
55-
""",
56-
appliesTo = {
57-
@FunctionAppliesTo(
58-
lifeCycle = FunctionAppliesToLifecycle.DEVELOPMENT
59-
) }
60-
)
49+
@FunctionInfo(returnType = "boolean", preview = true, description = """
50+
Finds the k nearest vectors to a query vector, as measured by a similarity metric.
51+
knn function finds nearest vectors through approximate search on indexed dense_vectors
52+
""", appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.DEVELOPMENT) })
6153
public Knn(Source source, Expression field, Expression query) {
6254
super(source, List.of(field, query));
6355
this.field = field;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/PlannerUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ public static ElementType toElementType(DataType dataType, MappedFieldType.Field
301301
case PARTIAL_AGG, AGGREGATE_METRIC_DOUBLE -> ElementType.COMPOSITE;
302302
// Can't throw IAE as this is used to estimate row size
303303
case DENSE_VECTOR -> ElementType.NULL;
304-
case SHORT, BYTE, DATE_PERIOD, TIME_DURATION, OBJECT, FLOAT, HALF_FLOAT, SCALED_FLOAT ->
305-
throw EsqlIllegalArgumentException.illegalDataType(dataType);
304+
case SHORT, BYTE, DATE_PERIOD, TIME_DURATION, OBJECT, FLOAT, HALF_FLOAT, SCALED_FLOAT -> throw EsqlIllegalArgumentException
305+
.illegalDataType(dataType);
306306
};
307307
}
308308

0 commit comments

Comments
 (0)