Skip to content

Commit e9d925e

Browse files
ES|QL: make ignoreOrder parsing more strict in CSV tests (#118136)
1 parent 0a2c9fb commit e9d925e

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ tests:
242242
- class: org.elasticsearch.packaging.test.ArchiveTests
243243
method: test40AutoconfigurationNotTriggeredWhenNodeIsMeantToJoinExistingCluster
244244
issue: https://github.com/elastic/elasticsearch/issues/118029
245-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
246-
issue: https://github.com/elastic/elasticsearch/issues/117981
247245
- class: org.elasticsearch.packaging.test.ConfigurationTests
248246
method: test30SymlinkedDataPath
249247
issue: https://github.com/elastic/elasticsearch/issues/118111

x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/CsvSpecReader.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ public Object parse(String line) {
8080
testCase.expectedWarningsRegexString.add(regex);
8181
testCase.expectedWarningsRegex.add(warningRegexToPattern(regex));
8282
} else if (lower.startsWith("ignoreorder:")) {
83-
testCase.ignoreOrder = Boolean.parseBoolean(line.substring("ignoreOrder:".length()).trim());
83+
String value = lower.substring("ignoreOrder:".length()).trim();
84+
if ("true".equals(value)) {
85+
testCase.ignoreOrder = true;
86+
} else if ("false".equals(value) == false) {
87+
throw new IllegalArgumentException("Invalid value for ignoreOrder: [" + value + "], it can only be true or false");
88+
}
8489
} else if (line.startsWith(";")) {
8590
testCase.expectedResults = data.toString();
8691
// clean-up and emit

x-pack/plugin/esql/qa/testFixtures/src/main/resources/lookup-join.csv-spec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ FROM sample_data
140140
| EVAL client_ip = client_ip::keyword
141141
| LOOKUP JOIN clientips_lookup ON client_ip
142142
;
143-
ignoreOrder:true;
143+
ignoreOrder:true
144144

145145
@timestamp:date | event_duration:long | message:keyword | client_ip:keyword | env:keyword
146146
2023-10-23T13:55:01.543Z | 1756467 | Connected to 10.1.0.1 | 172.21.3.15 | Production
@@ -160,7 +160,7 @@ FROM sample_data
160160
| LOOKUP JOIN clientips_lookup ON client_ip
161161
| KEEP @timestamp, client_ip, event_duration, message, env
162162
;
163-
ignoreOrder:true;
163+
ignoreOrder:true
164164

165165
@timestamp:date | client_ip:keyword | event_duration:long | message:keyword | env:keyword
166166
2023-10-23T13:55:01.543Z | 172.21.3.15 | 1756467 | Connected to 10.1.0.1 | Production
@@ -245,7 +245,7 @@ required_capability: join_lookup_v4
245245
FROM sample_data
246246
| LOOKUP JOIN message_types_lookup ON message
247247
;
248-
ignoreOrder:true;
248+
ignoreOrder:true
249249

250250
@timestamp:date | client_ip:ip | event_duration:long | message:keyword | type:keyword
251251
2023-10-23T13:55:01.543Z | 172.21.3.15 | 1756467 | Connected to 10.1.0.1 | Success
@@ -264,7 +264,7 @@ FROM sample_data
264264
| LOOKUP JOIN message_types_lookup ON message
265265
| KEEP @timestamp, client_ip, event_duration, message, type
266266
;
267-
ignoreOrder:true;
267+
ignoreOrder:true
268268

269269
@timestamp:date | client_ip:ip | event_duration:long | message:keyword | type:keyword
270270
2023-10-23T13:55:01.543Z | 172.21.3.15 | 1756467 | Connected to 10.1.0.1 | Success

0 commit comments

Comments
 (0)