Skip to content

Commit 4c94b4a

Browse files
committed
Fix error for multi cluster tests, where k can already have been rewritten
1 parent f4356a2 commit 4c94b4a

File tree

1 file changed

+5
-0
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/vector

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ private TypeResolution resolveQuery() {
192192
}
193193

194194
private TypeResolution resolveK() {
195+
if (k == null) {
196+
// Function has already been rewritten and included in QueryBuilder - otherwise parsing would have failed
197+
return TypeResolution.TYPE_RESOLVED;
198+
}
199+
195200
return isType(k(), dt -> dt == INTEGER, sourceText(), THIRD, "integer").and(isFoldable(k(), sourceText(), THIRD))
196201
.and(isNotNull(k(), sourceText(), THIRD));
197202
}

0 commit comments

Comments
 (0)