Skip to content

Commit 894dad6

Browse files
committed
TEMP
1 parent 758319a commit 894dad6

File tree

7 files changed

+97
-5
lines changed

7 files changed

+97
-5
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"esql.get_query": {
3+
"documentation": {
4+
"description": "Executes a get ESQL query request"
5+
},
6+
"stability": "experimental",
7+
"visibility": "public",
8+
"headers": {
9+
"accept": [],
10+
"content_type": [
11+
"application/json"
12+
]
13+
},
14+
"url": {
15+
"paths": [
16+
{
17+
"path": "/_query/queries/{id}",
18+
"methods": [
19+
"GET"
20+
],
21+
"parts": {
22+
"id": {
23+
"type": "string",
24+
"description": "The query ID"
25+
}
26+
}
27+
}
28+
]
29+
}
30+
}
31+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"esql.list_queries": {
3+
"documentation": {
4+
"description": "Executes a list ESQL queries request"
5+
},
6+
"stability": "experimental",
7+
"visibility": "public",
8+
"headers": {
9+
"accept": [],
10+
"content_type": [
11+
"application/json"
12+
]
13+
},
14+
"url": {
15+
"paths": [
16+
{
17+
"path": "/_query/queries",
18+
"methods": [
19+
"GET"
20+
]
21+
}
22+
]
23+
}
24+
}
25+
}

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/AbstractEsqlIntegTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void ensureExchangesAreReleased() throws Exception {
5555
ExchangeService exchangeService = esqlQueryAction.exchangeService();
5656
assertBusy(() -> {
5757
if (exchangeService.lifecycleState() == Lifecycle.State.STARTED) {
58-
assertTrue("Leftover exchanges " + exchangeService + " on taskId " + node, exchangeService.isEmpty());
58+
assertTrue("Leftover exchanges " + exchangeService + " on node " + node, exchangeService.isEmpty());
5959
}
6060
});
6161
}
@@ -98,7 +98,7 @@ public void ensureBlocksReleased() {
9898
)
9999
.toList()
100100
);
101-
assertThat("Request breaker not reset to 0 on taskId: " + node, reqBreaker.getUsed(), equalTo(0L));
101+
assertThat("Request breaker not reset to 0 on node: " + node, reqBreaker.getUsed(), equalTo(0L));
102102
});
103103
} catch (Exception e) {
104104
throw new RuntimeException("failed waiting for breakers to clear", e);

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlListQuerriesActionIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void testRunningQueries() throws Exception {
6767
.entry("running_time_nanos", IntegerMatcher.isIntOrLong());
6868
MapMatcher.assertMap(EsqlTestUtils.singleValue(listResult.values()), basicMatcher);
6969

70-
request = new Request("GET", "/_query/queries/" + taskId);
70+
request = new Request("GET", "/_query/queries/" + taskId + "1234");
7171
response = getRestClient().performRequest(request);
7272
MapMatcher.assertMap(
7373
entityToMap(response.getEntity()),

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlGetQueryAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public void onFailure(Exception e) {
5757

5858
@Override
5959
public void onFailure(Exception e) {
60-
listener.onFailure(e);
60+
// The underlying root cause is meaningless to the user, but that is what will be shown, so we remove it.
61+
var withoutCause = new Exception(e.getMessage());
62+
listener.onFailure(withoutCause);
6163
}
6264
});
6365
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
setup:
2+
# FIXME (gal, NOCOMMIT) Wrong check
3+
- requires:
4+
cluster_features: [ "gte_v8.11.0" ]
5+
reason: "ESQL is available in 8.11+"
6+
test_runner_features: allowed_warnings_regex
7+
- do:
8+
indices.create:
9+
index: test
10+
body:
11+
mappings:
12+
properties:
13+
message1:
14+
type: keyword
15+
16+
---
17+
List with no running queries:
18+
- do:
19+
esql.list_queries: { }
20+
- match: { queries: { } }
21+
22+
---
23+
Get with invalid task ID:
24+
- do:
25+
catch: /malformed task id foobar/
26+
esql.get_query:
27+
id: "foobar"
28+
29+
---
30+
Get with non-existent task ID:
31+
- do:
32+
catch: /task \[foobar:1234\] belongs to the node \[foobar\] which isn't part of the cluster and there is no record of the task/
33+
esql.get_query:
34+
id: "foobar:1234"

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/25_aggs_on_null.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ group on half missing:
146146
- do:
147147
esql.query:
148148
body:
149-
query: 'FROM test,test2 | STATS med=median(never_null) BY missing | LIMIT 1'
149+
query: 'FROM test,test2'
150150
columnar: true
151151
- match: {columns.0.name: "med"}
152152
- match: {columns.0.type: "double"}

0 commit comments

Comments
 (0)