Skip to content

Commit 42277e0

Browse files
committed
SQL: Fix test to not run as a jdbc driver newer than the server (#70674)
Fix test simulating running an newer JDBC driver against an older server. This scenario's no longer supported. Fixes #70630. (cherry picked from commit e6c4ce5)
1 parent bfaa0db commit 42277e0

File tree

1 file changed

+4
-11
lines changed
  • x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node

1 file changed

+4
-11
lines changed

x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.elasticsearch.test.rest.ESRestTestCase;
2121
import org.elasticsearch.xpack.ql.TestNode;
2222
import org.elasticsearch.xpack.ql.TestNodes;
23-
import org.elasticsearch.xpack.sql.type.SqlDataTypes;
2423
import org.junit.After;
2524
import org.junit.Before;
2625

@@ -90,7 +89,6 @@ public void cleanUpIndex() throws IOException {
9089
}
9190
}
9291

93-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/70630")
9492
public void testAllTypesWithRequestToOldNodes() throws Exception {
9593
Map<String, Object> expectedResponse = prepareTestData(
9694
columns -> {
@@ -226,19 +224,15 @@ private Map<String, Object> columnInfo(String name, String type) {
226224
Map<String, Object> column = new HashMap<>();
227225
column.put("name", name);
228226
column.put("type", type);
229-
column.put("display_size", SqlDataTypes.displaySize(SqlDataTypes.fromTypeName(type)));
230227
return unmodifiableMap(column);
231228
}
232229

233-
private void assertAllTypesWithNodes(Map<String, Object> expectedResponse, List<TestNode> nodesList) throws Exception {
230+
private void assertAllTypesWithNodes(Map<String, Object> expectedResponse, List<TestNode> nodesList)
231+
throws Exception {
234232
try (
235233
RestClient client = buildClient(restClientSettings(),
236234
nodesList.stream().map(TestNode::getPublishAddress).toArray(HttpHost[]::new))
237235
) {
238-
Request request = new Request("POST", "_sql");
239-
String version = ",\"version\":\"" + newVersion.toString() + "\"";
240-
String binaryFormat = ",\"binary_format\":\"false\"";
241-
242236
@SuppressWarnings("unchecked")
243237
List<Map<String, Object>> columns = (List<Map<String, Object>>) expectedResponse.get("columns");
244238
String intervalYearMonth = "INTERVAL '150' YEAR AS interval_year, ";
@@ -249,9 +243,8 @@ private void assertAllTypesWithNodes(Map<String, Object> expectedResponse, List<
249243
String fieldsList = columns.stream().map(m -> (String) m.get("name")).filter(str -> str.startsWith("interval") == false)
250244
.collect(Collectors.toList()).stream().collect(Collectors.joining(", "));
251245
String query = "SELECT " + intervalYearMonth + intervalDayTime + fieldsList + " FROM " + index + " ORDER BY id";
252-
request.setJsonEntity(
253-
"{\"mode\":\"jdbc\"" + version + binaryFormat + ",\"query\":\"" + query + "\"}"
254-
);
246+
Request request = new Request("POST", "_sql");
247+
request.setJsonEntity("{\"query\":\"" + query + "\"}");
255248
assertBusy(() -> { assertResponse(expectedResponse, runSql(client, request)); });
256249
}
257250
}

0 commit comments

Comments
 (0)