Skip to content

Commit 980f865

Browse files
committed
Merge remote-tracking branch 'carlosdelest/docs/esql-match-default-options' into docs/esql-match-default-options
2 parents a6bb85d + 7b70bcc commit 980f865

File tree

35 files changed

+2642
-2841
lines changed

35 files changed

+2642
-2841
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,6 @@ tests:
390390
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
391391
method: test {p0=search/610_function_score/Random}
392392
issue: https://github.com/elastic/elasticsearch/issues/125010
393-
- class: org.elasticsearch.packaging.test.DockerTests
394-
method: test010Install
395-
issue: https://github.com/elastic/elasticsearch/issues/119441
396393
- class: org.elasticsearch.xpack.ilm.DataStreamAndIndexLifecycleMixingTests
397394
method: testGetDataStreamResponse
398395
issue: https://github.com/elastic/elasticsearch/issues/125083

qa/packaging/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public static void waitForElasticsearchToStart() {
187187
Thread.sleep(STARTUP_SLEEP_INTERVAL_MILLISECONDS);
188188

189189
// Set COLUMNS so that `ps` doesn't truncate its output
190-
psOutput = dockerShell.run("bash -c 'COLUMNS=3000 ps ax'").stdout();
190+
psOutput = dockerShell.run("bash -c 'COLUMNS=4000 ps ax'").stdout();
191191

192192
if (psOutput.contains("org.elasticsearch.bootstrap.Elasticsearch")) {
193193
isElasticsearchRunning = true;

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ static TransportVersion def(int id) {
148148
public static final TransportVersion RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR_8_19 = def(8_841_0_07);
149149
public static final TransportVersion INFERENCE_CONTEXT_8_X = def(8_841_0_08);
150150
public static final TransportVersion ML_INFERENCE_DEEPSEEK_8_19 = def(8_841_0_09);
151+
public static final TransportVersion ESQL_SERIALIZE_BLOCK_TYPE_CODE_8_19 = def(8_841_0_10);
151152
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0 = def(9_000_0_00);
152153
public static final TransportVersion REMOVE_SNAPSHOT_FAILURES_90 = def(9_000_0_01);
153154
public static final TransportVersion TRANSPORT_STATS_HANDLING_TIME_REQUIRED_90 = def(9_000_0_02);

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/ElementType.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ public String pascalCaseName() {
122122
* Read element type from an input stream
123123
*/
124124
static ElementType readFrom(StreamInput in) throws IOException {
125-
if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_SERIALIZE_BLOCK_TYPE_CODE)) {
125+
if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_SERIALIZE_BLOCK_TYPE_CODE)
126+
|| in.getTransportVersion().isPatchFrom(TransportVersions.ESQL_SERIALIZE_BLOCK_TYPE_CODE_8_19)) {
126127
byte b = in.readByte();
127128
return values()[b];
128129
} else {
@@ -136,7 +137,8 @@ static ElementType readFrom(StreamInput in) throws IOException {
136137
}
137138

138139
void writeTo(StreamOutput out) throws IOException {
139-
if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_SERIALIZE_BLOCK_TYPE_CODE)) {
140+
if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_SERIALIZE_BLOCK_TYPE_CODE)
141+
|| out.getTransportVersion().isPatchFrom(TransportVersions.ESQL_SERIALIZE_BLOCK_TYPE_CODE_8_19)) {
140142
out.writeByte(writableCode);
141143
} else {
142144
out.writeString(legacyWritableName);

x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-metrics.csv-spec

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
metricsWithoutAggs
2-
required_capability: metrics_syntax
2+
required_capability: metrics_command
33
METRICS k8s | sort @timestamp DESC, cluster, pod | keep @timestamp,cluster,pod,network.bytes_in,network.cost | limit 5;
44

55
@timestamp:datetime | cluster:keyword | pod: keyword| network.bytes_in:long | network.cost:double
@@ -11,9 +11,9 @@ METRICS k8s | sort @timestamp DESC, cluster, pod | keep @timestamp,cluster,pod,n
1111
;
1212

1313
metricsWithAggsAndSourceQuoting
14-
required_capability: metrics_syntax
14+
required_capability: metrics_command
1515
required_capability: double_quotes_source_enclosing
16-
METRICS "k8s" max_bytes=max(to_long(network.total_bytes_in)) BY cluster | SORT max_bytes DESC;
16+
METRICS "k8s" | STATS max_bytes=max(to_long(network.total_bytes_in)) BY cluster | SORT max_bytes DESC;
1717

1818
max_bytes:long | cluster: keyword
1919
10797 | qa
@@ -22,49 +22,49 @@ max_bytes:long | cluster: keyword
2222
;
2323

2424
maxRateAndSourceTripleQuoting
25-
required_capability: metrics_syntax
25+
required_capability: metrics_command
2626
required_capability: double_quotes_source_enclosing
27-
METRICS """k8s""" max(rate(network.total_bytes_in, 1minute));
27+
METRICS k8s | STATS max(rate(network.total_bytes_in, 1minute));
2828

2929
max(rate(network.total_bytes_in, 1minute)): double
3030
790.4235090751945
3131
;
3232

3333
maxCost
34-
required_capability: metrics_syntax
35-
METRICS k8s max_cost=max(rate(network.total_cost));
34+
required_capability: metrics_command
35+
METRICS k8s | STATS max_cost=max(rate(network.total_cost));
3636

3737
max_cost: double
3838
0.16151685393258428
3939
;
4040

4141
maxRateAndBytes
42-
required_capability: metrics_syntax
43-
METRICS k8s max(rate(network.total_bytes_in, 1minute)), max(network.bytes_in);
42+
required_capability: metrics_command
43+
METRICS k8s | STATS max(rate(network.total_bytes_in, 1minute)), max(network.bytes_in);
4444

4545
max(rate(network.total_bytes_in, 1minute)): double | max(network.bytes_in): long
4646
790.4235090751945 | 1021
4747
;
4848

4949
`maxRateAndMarkupBytes`
50-
required_capability: metrics_syntax
51-
METRICS k8s max(rate(network.total_bytes_in, 1minute)), max(network.bytes_in * 1.05);
50+
required_capability: metrics_command
51+
METRICS k8s | STATS max(rate(network.total_bytes_in, 1minute)), max(network.bytes_in * 1.05);
5252

5353
max(rate(network.total_bytes_in, 1minute)): double | max(network.bytes_in * 1.05): double
5454
790.4235090751945 | 1072.05
5555
;
5656

5757
maxRateAndBytesAndCost
58-
required_capability: metrics_syntax
59-
METRICS k8s max(rate(network.total_bytes_in, 1minute)), max(network.bytes_in), max(rate(network.total_cost));
58+
required_capability: metrics_command
59+
METRICS k8s | STATS max(rate(network.total_bytes_in, 1minute)), max(network.bytes_in), max(rate(network.total_cost));
6060

6161
max(rate(network.total_bytes_in, 1minute)): double| max(network.bytes_in): long| max(rate(network.total_cost)): double
6262
790.4235090751945 | 1021 | 0.16151685393258428
6363
;
6464

6565
sumRate
66-
required_capability: metrics_syntax
67-
METRICS k8s bytes=sum(rate(network.total_bytes_in)), sum(rate(network.total_cost)) BY cluster | SORT cluster;
66+
required_capability: metrics_command
67+
METRICS k8s | STATS bytes=sum(rate(network.total_bytes_in)), sum(rate(network.total_cost)) BY cluster | SORT cluster;
6868

6969
bytes: double | sum(rate(network.total_cost)): double | cluster: keyword
7070
24.49149357711476 | 0.3018995503437827 | prod
@@ -73,17 +73,17 @@ bytes: double | sum(rate(network.total_cost)): double | cluster: keyword
7373
;
7474

7575
oneRateWithBucket
76-
required_capability: metrics_syntax
77-
METRICS k8s max(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,5minute) | SORT time_bucket DESC | LIMIT 2;
76+
required_capability: metrics_command
77+
METRICS k8s | STATS max(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,5minute) | SORT time_bucket DESC | LIMIT 2;
7878

7979
max(rate(network.total_bytes_in)): double | time_bucket:date
8080
10.594594594594595 | 2024-05-10T00:20:00.000Z
8181
23.702205882352942 | 2024-05-10T00:15:00.000Z
8282
;
8383

8484
twoRatesWithBucket
85-
required_capability: metrics_syntax
86-
METRICS k8s max(rate(network.total_bytes_in)), sum(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,5minute) | SORT time_bucket DESC | LIMIT 3;
85+
required_capability: metrics_command
86+
METRICS k8s | STATS max(rate(network.total_bytes_in)), sum(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,5minute) | SORT time_bucket DESC | LIMIT 3;
8787

8888
max(rate(network.total_bytes_in)): double | sum(rate(network.total_bytes_in)): double | time_bucket:date
8989
10.594594594594595 | 42.70864495221802 | 2024-05-10T00:20:00.000Z
@@ -93,8 +93,8 @@ max(rate(network.total_bytes_in)): double | sum(rate(network.total_bytes_in)): d
9393

9494

9595
oneRateWithBucketAndCluster
96-
required_capability: metrics_syntax
97-
METRICS k8s max(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,5minute), cluster | SORT time_bucket DESC, cluster | LIMIT 6;
96+
required_capability: metrics_command
97+
METRICS k8s | STATS max(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,5minute), cluster | SORT time_bucket DESC, cluster | LIMIT 6;
9898

9999
max(rate(network.total_bytes_in)): double | time_bucket:date | cluster: keyword
100100
10.594594594594595 | 2024-05-10T00:20:00.000Z | prod
@@ -106,8 +106,8 @@ max(rate(network.total_bytes_in)): double | time_bucket:date | cluster:
106106
;
107107

108108
BytesAndCostByBucketAndCluster
109-
required_capability: metrics_syntax
110-
METRICS k8s max(rate(network.total_bytes_in)), max(network.cost) BY time_bucket = bucket(@timestamp,5minute), cluster | SORT time_bucket DESC, cluster | LIMIT 6;
109+
required_capability: metrics_command
110+
METRICS k8s | STATS max(rate(network.total_bytes_in)), max(network.cost) BY time_bucket = bucket(@timestamp,5minute), cluster | SORT time_bucket DESC, cluster | LIMIT 6;
111111

112112
max(rate(network.total_bytes_in)): double | max(network.cost): double | time_bucket:date | cluster: keyword
113113
10.594594594594595 | 10.75 | 2024-05-10T00:20:00.000Z | prod
@@ -119,8 +119,8 @@ max(rate(network.total_bytes_in)): double | max(network.cost): double | time_buc
119119
;
120120

121121
oneRateWithBucketAndClusterThenFilter
122-
required_capability: metrics_syntax
123-
METRICS k8s max(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,5minute), cluster | WHERE cluster=="prod" | SORT time_bucket DESC | LIMIT 3;
122+
required_capability: metrics_command
123+
METRICS k8s | WHERE cluster=="prod" | STATS max(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,5minute), cluster | SORT time_bucket DESC | LIMIT 3;
124124

125125
max(rate(network.total_bytes_in)): double | time_bucket:date | cluster: keyword
126126
10.594594594594595 | 2024-05-10T00:20:00.000Z | prod

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ public static Iterable<Object[]> parameters() {
155155
) },
156156
new Object[] {
157157
new Test(
158-
"METRICS idx max(id) BY host | LIMIT 10",
159-
Build.current().isSnapshot() ? Map.ofEntries(Map.entry("METRICS", 1), Map.entry("LIMIT", 1)) : Collections.emptyMap(),
158+
"METRICS idx | STATS max(id) BY host | LIMIT 10",
159+
Build.current().isSnapshot()
160+
? Map.ofEntries(Map.entry("METRICS", 1), Map.entry("STATS", 1), Map.entry("LIMIT", 1))
161+
: Collections.emptyMap(),
160162
Build.current().isSnapshot() ? Map.ofEntries(Map.entry("MAX", 1)) : Collections.emptyMap(),
161163
Build.current().isSnapshot()
162164
) }

0 commit comments

Comments
 (0)