Skip to content

Commit 31e7d60

Browse files
authored
Merge branch 'main' into sagemaker-openai-completion
2 parents f28a3f8 + 6d63670 commit 31e7d60

File tree

17 files changed

+319
-188
lines changed

17 files changed

+319
-188
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
steps:
2+
- label: periodic-micro-benchmarks
3+
command: |
4+
.ci/scripts/run-gradle.sh -p benchmarks/ run --args 'org.elasticsearch.benchmark._nightly -rf json -rff build/result.json'
5+
timeout_in_minutes: 300
6+
agents:
7+
provider: gcp
8+
image: family/elasticsearch-ubuntu-2004
9+
machineType: custom-32-98304
10+
buildDirectory: /dev/shm/bk

benchmarks/src/main/java/org/elasticsearch/benchmark/esql/QueryPlanningBenchmark.java renamed to benchmarks/src/main/java/org/elasticsearch/benchmark/_nightly/esql/QueryPlanningBenchmark.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
package org.elasticsearch.benchmark.esql;
10+
package org.elasticsearch.benchmark._nightly.esql;
1111

1212
import org.elasticsearch.common.logging.LogConfigurator;
1313
import org.elasticsearch.common.settings.Settings;
@@ -67,9 +67,9 @@ public class QueryPlanningBenchmark {
6767
}
6868

6969
private PlanTelemetry telemetry;
70-
private EsqlParser parser;
71-
private Analyzer analyzer;
72-
private LogicalPlanOptimizer optimizer;
70+
private EsqlParser defaultParser;
71+
private Analyzer manyFieldsAnalyzer;
72+
private LogicalPlanOptimizer defaultOptimizer;
7373

7474
@Setup
7575
public void setup() {
@@ -100,8 +100,8 @@ public void setup() {
100100
var functionRegistry = new EsqlFunctionRegistry();
101101

102102
telemetry = new PlanTelemetry(functionRegistry);
103-
parser = new EsqlParser();
104-
analyzer = new Analyzer(
103+
defaultParser = new EsqlParser();
104+
manyFieldsAnalyzer = new Analyzer(
105105
new AnalyzerContext(
106106
config,
107107
functionRegistry,
@@ -112,10 +112,10 @@ public void setup() {
112112
),
113113
new Verifier(new Metrics(functionRegistry), new XPackLicenseState(() -> 0L))
114114
);
115-
optimizer = new LogicalPlanOptimizer(new LogicalOptimizerContext(config, FoldContext.small()));
115+
defaultOptimizer = new LogicalPlanOptimizer(new LogicalOptimizerContext(config, FoldContext.small()));
116116
}
117117

118-
private LogicalPlan plan(String query) {
118+
private LogicalPlan plan(EsqlParser parser, Analyzer analyzer, LogicalPlanOptimizer optimizer, String query) {
119119
var parsed = parser.createStatement(query, new QueryParams(), telemetry);
120120
var analyzed = analyzer.analyze(parsed);
121121
var optimized = optimizer.optimize(analyzed);
@@ -124,6 +124,6 @@ private LogicalPlan plan(String query) {
124124

125125
@Benchmark
126126
public void manyFields(Blackhole blackhole) {
127-
blackhole.consume(plan("FROM test | LIMIT 10"));
127+
blackhole.consume(plan(defaultParser, manyFieldsAnalyzer, defaultOptimizer, "FROM test | LIMIT 10"));
128128
}
129129
}

catalog-info.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,41 @@ spec:
263263
Daily:
264264
branch: main
265265
cronline: "0 12 * * * America/New_York"
266+
---
267+
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
268+
apiVersion: backstage.io/v1alpha1
269+
kind: Resource
270+
metadata:
271+
name: buildkite-pipeline-elasticsearch-periodic-micro-benchmarks
272+
description: Runs periodic micro benchmarks fom the main branch
273+
links:
274+
- title: Pipeline
275+
url: https://buildkite.com/elastic/elasticsearch-periodic-micro-benchmarks
276+
spec:
277+
type: buildkite-pipeline
278+
system: buildkite
279+
owner: group:elasticsearch-team
280+
implementation:
281+
apiVersion: buildkite.elastic.dev/v1
282+
kind: Pipeline
283+
metadata:
284+
description: ":elasticsearch: Runs nightly micro benchmarks fom the main branch"
285+
name: elasticsearch / periodic / micro-benchmarks
286+
spec:
287+
repository: elastic/elasticsearch
288+
pipeline_file: .buildkite/pipelines/periodic-micro-benchmarks.yml
289+
branch_configuration: main
290+
teams:
291+
elasticsearch-team: {}
292+
ml-core: {}
293+
everyone:
294+
access_level: BUILD_AND_READ
295+
provider_settings:
296+
build_branches: false
297+
build_pull_requests: false
298+
publish_commit_status: false
299+
trigger_mode: none
300+
schedules:
301+
Daily:
302+
branch: main
303+
cronline: "@daily"

distribution/docker/src/docker/dockerfiles/cloud_ess_fips/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Extract Elasticsearch artifact
2525
################################################################################
2626
27-
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest@sha256:a9e07d97c55f5b854b1c203509e57b6f466eb26318540b2e1b59734355f747b6 AS builder
27+
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest@sha256:68e0781cd592beda39880428985d5fecca1cf2abb18365da73bf1f7ebd994974 AS builder
2828
2929
# Install required packages to extract the Elasticsearch distribution
3030
RUN <%= retry.loop(package_manager, "export DEBIAN_FRONTEND=noninteractive && ${package_manager} update && ${package_manager} update && ${package_manager} add --no-cache curl") %>
@@ -103,7 +103,7 @@ WORKDIR /usr/share/elasticsearch/config
103103
# Add entrypoint
104104
################################################################################
105105

106-
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest@sha256:a9e07d97c55f5b854b1c203509e57b6f466eb26318540b2e1b59734355f747b6
106+
FROM docker.elastic.co/wolfi/chainguard-base-fips:latest@sha256:68e0781cd592beda39880428985d5fecca1cf2abb18365da73bf1f7ebd994974
107107

108108
RUN <%= retry.loop(package_manager,
109109
"export DEBIAN_FRONTEND=noninteractive && \n" +

distribution/docker/src/docker/dockerfiles/wolfi/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Extract Elasticsearch artifact
2525
################################################################################
2626
27-
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:55ee1dca9780931b0929d6eb734f455790c06ddbb59f55008e0cddebfbfd1e2e AS builder
27+
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:3d19648819612728a676ab4061edfb3283bd7117a22c6c4479ee1c1d51831832 AS builder
2828
2929
# Install required packages to extract the Elasticsearch distribution
3030
RUN <%= retry.loop(package_manager, "export DEBIAN_FRONTEND=noninteractive && ${package_manager} update && ${package_manager} update && ${package_manager} add --no-cache curl") %>
@@ -79,7 +79,7 @@ RUN sed -i -e 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' bin/elas
7979
# Add entrypoint
8080
################################################################################
8181

82-
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:55ee1dca9780931b0929d6eb734f455790c06ddbb59f55008e0cddebfbfd1e2e
82+
FROM docker.elastic.co/wolfi/chainguard-base:latest@sha256:3d19648819612728a676ab4061edfb3283bd7117a22c6c4479ee1c1d51831832
8383

8484
RUN <%= retry.loop(package_manager,
8585
"export DEBIAN_FRONTEND=noninteractive && \n" +

docs/changelog/128464.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 128464
2+
summary: Add support for parameters in LIMIT command
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

server/src/main/java/org/elasticsearch/action/support/SubscribableListener.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@
3232
import java.util.concurrent.Executor;
3333

3434
/**
35-
* An {@link ActionListener} to which other {@link ActionListener} instances can subscribe, such that when this listener is
36-
* completed it fans-out its result to the subscribed listeners.
35+
* An {@link ActionListener} to which other {@link ActionListener} instances can subscribe, such that when this listener is completed it
36+
* fans-out its result to the subscribed listeners.
3737
* <p>
38-
* If this listener is complete, {@link #addListener} completes the subscribing listener immediately
39-
* with the result with which this listener was completed. Otherwise, the subscribing listener is retained
40-
* and completed when this listener is completed.
38+
* If this listener is complete, {@link #addListener} completes the subscribing listener immediately with the result with which this
39+
* listener was completed. Otherwise, the subscribing listener is retained and completed when this listener is completed.
4140
* <p>
42-
* Exceptions are passed to subscribed listeners without modification. {@link ListenableActionFuture} and {@link ListenableFuture} are child
43-
* classes that provide additional exception handling.
41+
* Exceptions are passed to subscribed listeners without modification. {@link ListenableActionFuture} and {@link ListenableFuture} are
42+
* subclasses which modify the exceptions passed to subscribed listeners.
43+
* <p>
44+
* If this listener is completed more than once then all results other than the first (whether successful or otherwise) are silently
45+
* discarded. All subscribed listeners will be notified of the same result, exactly once, even if several completions occur concurrently.
4446
* <p>
4547
* A sequence of async steps can be chained together using a series of {@link SubscribableListener}s, similar to {@link CompletionStage}
4648
* (without the {@code catch (Throwable t)}). Listeners can be created for each step, where the next step subscribes to the result of the

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/exchange/ExchangeService.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
* use {@link ExchangeSourceHandler#addRemoteSink(RemoteSink, boolean, Runnable, int, ActionListener)}.
5757
*/
5858
public final class ExchangeService extends AbstractLifecycleComponent {
59+
60+
private static final Logger logger = LogManager.getLogger(ExchangeService.class);
61+
5962
// TODO: Make this a child action of the data node transport to ensure that exchanges
6063
// are accessed only by the user initialized the session.
6164
public static final String EXCHANGE_ACTION_NAME = "internal:data/read/esql/exchange";
@@ -71,8 +74,6 @@ public final class ExchangeService extends AbstractLifecycleComponent {
7174
public static final String INACTIVE_SINKS_INTERVAL_SETTING = "esql.exchange.sink_inactive_interval";
7275
public static final TimeValue INACTIVE_SINKS_INTERVAL_DEFAULT = TimeValue.timeValueMinutes(5);
7376

74-
private static final Logger LOGGER = LogManager.getLogger(ExchangeService.class);
75-
7677
private final ThreadPool threadPool;
7778
private final Executor executor;
7879
private final BlockFactory blockFactory;
@@ -87,7 +88,7 @@ public ExchangeService(Settings settings, ThreadPool threadPool, String executor
8788
final var inactiveInterval = settings.getAsTime(INACTIVE_SINKS_INTERVAL_SETTING, INACTIVE_SINKS_INTERVAL_DEFAULT);
8889
// Run the reaper every half of the keep_alive interval
8990
this.threadPool.scheduleWithFixedDelay(
90-
new InactiveSinksReaper(LOGGER, threadPool, inactiveInterval),
91+
new InactiveSinksReaper(threadPool, inactiveInterval),
9192
TimeValue.timeValueMillis(Math.max(1, inactiveInterval.millis() / 2)),
9293
executor
9394
);
@@ -249,12 +250,10 @@ public void messageReceived(ExchangeRequest request, TransportChannel channel, T
249250
}
250251

251252
private final class InactiveSinksReaper extends AbstractRunnable {
252-
private final Logger logger;
253253
private final TimeValue keepAlive;
254254
private final ThreadPool threadPool;
255255

256-
InactiveSinksReaper(Logger logger, ThreadPool threadPool, TimeValue keepAlive) {
257-
this.logger = logger;
256+
InactiveSinksReaper(ThreadPool threadPool, TimeValue keepAlive) {
258257
this.keepAlive = keepAlive;
259258
this.threadPool = threadPool;
260259
}

x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ identifierOrParameter
187187
;
188188

189189
limitCommand
190-
: LIMIT INTEGER_LITERAL
190+
: LIMIT constant
191191
;
192192

193193
sortCommand

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,12 @@ public enum Cap {
11281128
/**
11291129
* Dense vector field type support
11301130
*/
1131-
DENSE_VECTOR_FIELD_TYPE(EsqlCorePlugin.DENSE_VECTOR_FEATURE_FLAG);
1131+
DENSE_VECTOR_FIELD_TYPE(EsqlCorePlugin.DENSE_VECTOR_FEATURE_FLAG),
1132+
1133+
/**
1134+
* Support parameters for LiMIT command.
1135+
*/
1136+
PARAMETER_FOR_LIMIT;
11321137

11331138
private final boolean enabled;
11341139

0 commit comments

Comments
 (0)