Skip to content

Commit 412b904

Browse files
ES|QL: fix Generative test checks for commands that don't change the output schema
1 parent ad53ee5 commit 412b904

File tree

1 file changed

+7
-6
lines changed
  • x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/generator/command

1 file changed

+7
-6
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/generator/command/CommandGenerator.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ static ValidationResult expectSameColumns(
130130
return VALIDATION_OK;
131131
}
132132

133-
if (previousColumns.stream().anyMatch(x -> x.name().contains("<all-fields-projected>"))) {
134-
return VALIDATION_OK; // known bug
135-
}
133+
// known bug https://github.com/elastic/elasticsearch/issues/121741
134+
previousColumns = previousColumns.stream().filter(x -> x.name().contains("<all-fields-projected>") == false).toList();
135+
columns = columns.stream().filter(x -> x.name().contains("<all-fields-projected>") == false).toList();
136136

137137
if (previousColumns.size() != columns.size()) {
138138
return new ValidationResult(false, "Expecting [" + previousColumns.size() + "] columns, got [" + columns.size() + "]");
@@ -154,9 +154,10 @@ static ValidationResult expectSameColumns(
154154
* The command doesn't have to produce LESS columns than the previous query
155155
*/
156156
static ValidationResult expectAtLeastSameNumberOfColumns(List<Column> previousColumns, List<Column> columns) {
157-
if (previousColumns.stream().anyMatch(x -> x.name().contains("<all-fields-projected>"))) {
158-
return VALIDATION_OK; // known bug
159-
}
157+
// known bug https://github.com/elastic/elasticsearch/issues/121741
158+
previousColumns = previousColumns.stream().filter(x -> x.name().contains("<all-fields-projected>") == false).toList();
159+
columns = columns.stream().filter(x -> x.name().contains("<all-fields-projected>") == false).toList();
160+
160161

161162
if (previousColumns.size() > columns.size()) {
162163
return new ValidationResult(false, "Expecting at least [" + previousColumns.size() + "] columns, got [" + columns.size() + "]");

0 commit comments

Comments
 (0)