Skip to content

Commit 2cbba35

Browse files
authored
Merge branch 'main' into fix-inference-spell
2 parents 67567c9 + f5ac68d commit 2cbba35

File tree

272 files changed

+3439
-1350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+3439
-1350
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.core.TimeValue;
2828
import org.elasticsearch.xpack.esql.core.expression.Expression;
2929
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
30+
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
3031
import org.elasticsearch.xpack.esql.core.expression.Literal;
3132
import org.elasticsearch.xpack.esql.core.expression.predicate.regex.RLikePattern;
3233
import org.elasticsearch.xpack.esql.core.tree.Source;
@@ -71,12 +72,11 @@ public class EvalBenchmark {
7172
BigArrays.NON_RECYCLING_INSTANCE
7273
);
7374

75+
private static final FoldContext FOLD_CONTEXT = FoldContext.small();
76+
7477
private static final int BLOCK_LENGTH = 8 * 1024;
7578

76-
static final DriverContext driverContext = new DriverContext(
77-
BigArrays.NON_RECYCLING_INSTANCE,
78-
BlockFactory.getInstance(new NoopCircuitBreaker("noop"), BigArrays.NON_RECYCLING_INSTANCE)
79-
);
79+
static final DriverContext driverContext = new DriverContext(BigArrays.NON_RECYCLING_INSTANCE, blockFactory);
8080

8181
static {
8282
// Smoke test all the expected values and force loading subclasses more like prod
@@ -114,18 +114,20 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
114114
return switch (operation) {
115115
case "abs" -> {
116116
FieldAttribute longField = longField();
117-
yield EvalMapper.toEvaluator(new Abs(Source.EMPTY, longField), layout(longField)).get(driverContext);
117+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Abs(Source.EMPTY, longField), layout(longField)).get(driverContext);
118118
}
119119
case "add" -> {
120120
FieldAttribute longField = longField();
121121
yield EvalMapper.toEvaluator(
122+
FOLD_CONTEXT,
122123
new Add(Source.EMPTY, longField, new Literal(Source.EMPTY, 1L, DataType.LONG)),
123124
layout(longField)
124125
).get(driverContext);
125126
}
126127
case "add_double" -> {
127128
FieldAttribute doubleField = doubleField();
128129
yield EvalMapper.toEvaluator(
130+
FOLD_CONTEXT,
129131
new Add(Source.EMPTY, doubleField, new Literal(Source.EMPTY, 1D, DataType.DOUBLE)),
130132
layout(doubleField)
131133
).get(driverContext);
@@ -140,7 +142,8 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
140142
lhs = new Add(Source.EMPTY, lhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
141143
rhs = new Add(Source.EMPTY, rhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
142144
}
143-
yield EvalMapper.toEvaluator(new Case(Source.EMPTY, condition, List.of(lhs, rhs)), layout(f1, f2)).get(driverContext);
145+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Case(Source.EMPTY, condition, List.of(lhs, rhs)), layout(f1, f2))
146+
.get(driverContext);
144147
}
145148
case "date_trunc" -> {
146149
FieldAttribute timestamp = new FieldAttribute(
@@ -149,35 +152,37 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
149152
new EsField("timestamp", DataType.DATETIME, Map.of(), true)
150153
);
151154
yield EvalMapper.toEvaluator(
155+
FOLD_CONTEXT,
152156
new DateTrunc(Source.EMPTY, new Literal(Source.EMPTY, Duration.ofHours(24), DataType.TIME_DURATION), timestamp),
153157
layout(timestamp)
154158
).get(driverContext);
155159
}
156160
case "equal_to_const" -> {
157161
FieldAttribute longField = longField();
158162
yield EvalMapper.toEvaluator(
163+
FOLD_CONTEXT,
159164
new Equals(Source.EMPTY, longField, new Literal(Source.EMPTY, 100_000L, DataType.LONG)),
160165
layout(longField)
161166
).get(driverContext);
162167
}
163168
case "long_equal_to_long" -> {
164169
FieldAttribute lhs = longField();
165170
FieldAttribute rhs = longField();
166-
yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(driverContext);
171+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(driverContext);
167172
}
168173
case "long_equal_to_int" -> {
169174
FieldAttribute lhs = longField();
170175
FieldAttribute rhs = intField();
171-
yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(driverContext);
176+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(driverContext);
172177
}
173178
case "mv_min", "mv_min_ascending" -> {
174179
FieldAttribute longField = longField();
175-
yield EvalMapper.toEvaluator(new MvMin(Source.EMPTY, longField), layout(longField)).get(driverContext);
180+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new MvMin(Source.EMPTY, longField), layout(longField)).get(driverContext);
176181
}
177182
case "rlike" -> {
178183
FieldAttribute keywordField = keywordField();
179184
RLike rlike = new RLike(Source.EMPTY, keywordField, new RLikePattern(".ar"));
180-
yield EvalMapper.toEvaluator(rlike, layout(keywordField)).get(driverContext);
185+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, rlike, layout(keywordField)).get(driverContext);
181186
}
182187
default -> throw new UnsupportedOperationException();
183188
};

docs/changelog/118602.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118602
2+
summary: Limit memory usage of `fold`
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/changelog/119893.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 119893
2+
summary: Add enterprise license check for Inference API actions
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/120042.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120042
2+
summary: Match dot prefix of migrated DS backing index with the source index
3+
area: Data streams
4+
type: bug
5+
issues: []

docs/changelog/120062.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 120062
2+
summary: Update Text Similarity Reranker to Properly Handle Aliases
3+
area: Ranking
4+
type: bug
5+
issues:
6+
- 119617

docs/reference/esql/esql-limitations.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ include::processing-commands/limit.asciidoc[tag=limitation]
3030
** You can use `to_datetime` to cast to millisecond dates to use unsupported functions
3131
* `double` (`float`, `half_float`, `scaled_float` are represented as `double`)
3232
* `ip`
33-
* `keyword` family including `keyword`, `constant_keyword`, and `wildcard`
33+
* `keyword` <<keyword, family>> including `keyword`, `constant_keyword`, and `wildcard`
3434
* `int` (`short` and `byte` are represented as `int`)
3535
* `long`
3636
* `null`
37-
* `text`
37+
* `text` <<text, family>> including `text`, `semantic_text` and `match_only_text`
3838
* experimental:[] `unsigned_long`
3939
* `version`
4040
* Spatial types

docs/reference/esql/functions/description/match.asciidoc

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/kibana/definition/bucket.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/kibana/definition/date_format.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/kibana/definition/match.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)