SqlStreamInput/Output use TransportVersion from a read-in Version constant. We need to remove the useage of `transportVersion` field
x-pack/plugin/sql/qa/mixed-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java
for (String doc : Arrays.asList("{\"int\":1,\"kw\":\"foo\"}", "{\"int\":2,\"kw\":\"bar\"}", "{\"kw\":\"bar\"}")) {
            bulk.append("{\"index\":{}}\n").append(doc).append("\n");
        }
        indexDocs.setJsonEntity(bulk.toString());
        client().performRequest(indexDocs);
    }
    @SuppressWarnings("unchecked")
    private List<Integer> runOrderByNullsLastQuery(RestClient queryClient) throws IOException {
        indexDocs();
        Request query = new Request("POST", "_sql");
        query.setJsonEntity(sqlQueryEntityWithOptionalMode("SELECT int FROM test GROUP BY 1 ORDER BY 1 NULLS LAST", bwcVersion));
        Map<String, Object> result = performRequestAndReadBodyAsJson(queryClient, query);
        List<List<Object>> rows = (List<List<Object>>) result.get("rows");
        return rows.stream().map(row -> (Integer) row.get(0)).collect(Collectors.toList());
    }
    public static String sqlQueryEntityWithOptionalMode(String query, Version bwcVersion) throws IOException {
        return sqlQueryEntityWithOptionalMode(Map.of("query", query), bwcVersion);
    }
    public static String sqlQueryEntityWithOptionalMode(Map<String, Object> fields, Version bwcVersion) throws IOException {
        XContentBuilder json = XContentFactory.jsonBuilder().startObject();
        if (bwcVersion.before(Version.V_7_12_0)) {
            
            
            
            
            json.field("mode", "jdbc");
            json.field("binary_format", false);
            json.field("version", bwcVersion.toString());
        }
        for (Map.Entry<String, Object> entry : fields.entrySet()) {