Skip to content

Commit e9afc06

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 84d3c50 commit e9afc06

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ public class DenseVectorFieldTypeIT extends AbstractEsqlIntegTestCase {
4444
"bbq_flat",
4545
"flat"
4646
);
47-
public static final Set<String> NON_QUANTIZED_DENSE_VECTOR_INDEX_TYPES = Set.of(
48-
"hnsw",
49-
"flat"
50-
);
47+
public static final Set<String> NON_QUANTIZED_DENSE_VECTOR_INDEX_TYPES = Set.of("hnsw", "flat");
5148

5249
private final ElementType elementType;
5350
private final boolean synthetic;
@@ -59,16 +56,16 @@ public static Iterable<Object[]> parameters() throws Exception {
5956
List<Object[]> params = new ArrayList<>();
6057
// Indexed field types
6158
for (String indexType : ALL_DENSE_VECTOR_INDEX_TYPES) {
62-
params.add(new Object[] {ElementType.FLOAT, indexType, true, false });
59+
params.add(new Object[] { ElementType.FLOAT, indexType, true, false });
6360
}
6461
for (String indexType : NON_QUANTIZED_DENSE_VECTOR_INDEX_TYPES) {
65-
params.add(new Object[] {ElementType.BYTE, indexType, true, false });
62+
params.add(new Object[] { ElementType.BYTE, indexType, true, false });
6663
}
6764
for (ElementType elementType : List.of(ElementType.BYTE, ElementType.FLOAT)) {
6865
// No indexing
69-
params.add(new Object[]{elementType, null, false, false});
66+
params.add(new Object[] { elementType, null, false, false });
7067
// No indexing, synthetic source
71-
params.add(new Object[]{elementType, null, false, true});
68+
params.add(new Object[] { elementType, null, false, true });
7269
}
7370
return params;
7471
}

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,22 @@ public class KnnFunctionIT extends AbstractEsqlIntegTestCase {
4848
private final DenseVectorFieldMapper.ElementType elementType;
4949
private final String indexType;
5050

51-
5251
@ParametersFactory
5352
public static Iterable<Object[]> parameters() throws Exception {
5453
List<Object[]> params = new ArrayList<>();
5554
for (String indexType : ALL_DENSE_VECTOR_INDEX_TYPES) {
56-
params.add(new Object[] {DenseVectorFieldMapper.ElementType.FLOAT, indexType });
55+
params.add(new Object[] { DenseVectorFieldMapper.ElementType.FLOAT, indexType });
5756
}
5857
for (String indexType : NON_QUANTIZED_DENSE_VECTOR_INDEX_TYPES) {
59-
params.add(new Object[] {DenseVectorFieldMapper.ElementType.BYTE, indexType });
58+
params.add(new Object[] { DenseVectorFieldMapper.ElementType.BYTE, indexType });
6059
}
6160

6261
// Remove flat index types, as knn does not do a top k for flat
6362
params.removeIf(param -> param[1] != null && ((String) param[1]).contains("flat"));
6463
return params;
6564
}
6665

67-
public KnnFunctionIT(
68-
@Name("elementType") DenseVectorFieldMapper.ElementType elementType,
69-
@Name("indexType") String indexType
70-
) {
66+
public KnnFunctionIT(@Name("elementType") DenseVectorFieldMapper.ElementType elementType, @Name("indexType") String indexType) {
7167
this.elementType = elementType;
7268
this.indexType = indexType;
7369
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,10 @@ private static void checkDenseVectorCastingKnn(String fieldName) {
23592359

23602360
public void testDenseVectorImplicitCastingSimilarityFunctions() {
23612361
if (EsqlCapabilities.Cap.COSINE_VECTOR_SIMILARITY_FUNCTION.isEnabled()) {
2362-
checkDenseVectorImplicitCastingSimilarityFunction("v_cosine(float_vector, [0.342, 0.164, 0.234])", List.of(0.342f, 0.164f, 0.234f));
2362+
checkDenseVectorImplicitCastingSimilarityFunction(
2363+
"v_cosine(float_vector, [0.342, 0.164, 0.234])",
2364+
List.of(0.342f, 0.164f, 0.234f)
2365+
);
23632366
checkDenseVectorImplicitCastingSimilarityFunction("v_cosine(byte_vector, [1, 2, 3])", List.of(1f, 2f, 3f));
23642367
}
23652368
if (EsqlCapabilities.Cap.DOT_PRODUCT_VECTOR_SIMILARITY_FUNCTION.isEnabled()) {
@@ -2370,7 +2373,10 @@ public void testDenseVectorImplicitCastingSimilarityFunctions() {
23702373
checkDenseVectorImplicitCastingSimilarityFunction("v_dot_product(byte_vector, [1, 2, 3])", List.of(1f, 2f, 3f));
23712374
}
23722375
if (EsqlCapabilities.Cap.L1_NORM_VECTOR_SIMILARITY_FUNCTION.isEnabled()) {
2373-
checkDenseVectorImplicitCastingSimilarityFunction("v_l1_norm(float_vector, [0.342, 0.164, 0.234])", List.of(0.342f, 0.164f, 0.234f));
2376+
checkDenseVectorImplicitCastingSimilarityFunction(
2377+
"v_l1_norm(float_vector, [0.342, 0.164, 0.234])",
2378+
List.of(0.342f, 0.164f, 0.234f)
2379+
);
23742380
checkDenseVectorImplicitCastingSimilarityFunction("v_l1_norm(byte_vector, [1, 2, 3])", List.of(1f, 2f, 3f));
23752381
}
23762382
}

0 commit comments

Comments
 (0)