Skip to content

Commit 4bb44b6

Browse files
Fix more failing UTs
1 parent b6c162d commit 4bb44b6

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClustersIT.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,6 @@ public void testLikeIndex() throws Exception {
422422
""", includeCCSMetadata);
423423
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
424424
var values = List.of(List.of(remoteDocs.size(), REMOTE_CLUSTER_NAME + ":" + remoteIndex));
425-
String resultString = Strings.toString(JsonXContent.contentBuilder().prettyPrint().map(result));
426-
System.out.println(resultString);
427425
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, false);
428426
}
429427

@@ -437,8 +435,6 @@ public void testNotLikeIndex() throws Exception {
437435
""", includeCCSMetadata);
438436
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
439437
var values = List.of(List.of(localDocs.size(), localIndex));
440-
String resultString = Strings.toString(JsonXContent.contentBuilder().prettyPrint().map(result));
441-
System.out.println(resultString);
442438
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, false);
443439
}
444440

@@ -458,8 +454,6 @@ public void testLikeListIndex() throws Exception {
458454
""", includeCCSMetadata);
459455
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
460456
var values = List.of(List.of(remoteDocs.size(), REMOTE_CLUSTER_NAME + ":" + remoteIndex));
461-
String resultString = Strings.toString(JsonXContent.contentBuilder().prettyPrint().map(result));
462-
System.out.println(resultString);
463457
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, true);
464458
}
465459

@@ -479,8 +473,6 @@ public void testNotLikeListIndex() throws Exception {
479473
""", includeCCSMetadata);
480474
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
481475
var values = List.of(List.of(localDocs.size(), localIndex));
482-
String resultString = Strings.toString(JsonXContent.contentBuilder().prettyPrint().map(result));
483-
System.out.println(resultString);
484476
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, true);
485477
}
486478

@@ -500,8 +492,6 @@ public void testNotLikeListKeyWord() throws Exception {
500492
""", includeCCSMetadata);
501493
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
502494
var values = List.of(List.of(localDocs.size(), localIndex));
503-
String resultString = Strings.toString(JsonXContent.contentBuilder().prettyPrint().map(result));
504-
System.out.println(resultString);
505495
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, true);
506496
}
507497

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/WildcardLikeList.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@ public String getLuceneQueryDescription() {
166166
* Throws an {@link IllegalArgumentException} if the pattern list contains more than one pattern.
167167
*/
168168
private Query translateField(String targetFieldName) {
169-
if (configuration == null) {
170-
throw new IllegalArgumentException("Configuration cannot be null for WildcardLikeList translation");
171-
}
172169
return new ExpressionQuery(source(), targetFieldName, this, configuration);
173170
}
174171
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/ExpressionQueryBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public ExpressionQueryBuilder(StreamInput in) throws IOException {
7373
@Override
7474
protected void doWriteTo(StreamOutput out) throws IOException {
7575
out.writeString(this.fieldName);
76+
if (config == null) {
77+
throw new UnsupportedEncodingException("Configuration cannot be null when writing ExpressionQueryBuilder");
78+
}
7679
config.writeTo(out);
7780
PlanStreamOutput planStreamOutput = new PlanStreamOutput(out, config);
7881
planStreamOutput.writeNamedWriteable(expression);

0 commit comments

Comments
 (0)