Skip to content

Commit 7fb728f

Browse files
authored
Merge branch 'main' into fix_136365_prune_columns_when_fork
2 parents 9823def + fe1bf19 commit 7fb728f

File tree

41 files changed

+452
-253
lines changed

Some content is hidden

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

41 files changed

+452
-253
lines changed

docs/changelog/138644.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138644
2+
summary: "Fix: add missing `vector_similarity_support` in InferenceFeatures"
3+
area: Search
4+
type: bug
5+
issues: []

modules/ingest-geoip/src/yamlRestTest/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.List;
3939
import java.util.Map;
4040
import java.util.Objects;
41+
import java.util.concurrent.TimeUnit;
4142

4243
import static org.hamcrest.Matchers.containsInAnyOrder;
4344
import static org.hamcrest.Matchers.equalTo;
@@ -158,7 +159,9 @@ static void assertDatabasesLoaded() throws Exception {
158159

159160
// ensure that the extra config database has been set up, too:
160161
assertThat(node.get("config_databases"), equalTo(List.of("asn.mmdb")));
161-
});
162+
// Downloading all four databases may take some time, so we set a longer timeout here.
163+
// If 20 seconds prove insufficient, we should first investigate whether we can speed up the database downloader.
164+
}, 20, TimeUnit.SECONDS);
162165
}
163166

164167
@SuppressForbidden(reason = "fixtures use java.io.File based APIs")

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,6 @@ tests:
429429
- class: org.elasticsearch.xpack.inference.integration.AuthorizationTaskExecutorIT
430430
method: testCreatesEisChatCompletion_DoesNotRemoveEndpointWhenNoLongerAuthorized
431431
issue: https://github.com/elastic/elasticsearch/issues/138480
432-
- class: org.elasticsearch.ingest.geoip.IngestGeoIpClientYamlTestSuiteIT
433-
method: test {yaml=ingest_geoip/60_ip_location_databases/Test adding, getting, and removing ip location databases}
434-
issue: https://github.com/elastic/elasticsearch/issues/138502
435432
- class: org.elasticsearch.xpack.exponentialhistogram.ExponentialHistogramFieldMapperTests
436433
method: testFormattedDocValues
437434
issue: https://github.com/elastic/elasticsearch/issues/138504
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9228000
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aggregate_metric_double_typed_block,9227000
1+
esql_timestamps_info,9228000

test/external-modules/esql-heap-attack/src/javaRestTest/java/org/elasticsearch/xpack/esql/heap_attack/HeapAttackIT.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ public void testSortByManyLongsGiantTopN() throws IOException {
169169
.entry("values", List.of(List.of(9)))
170170
.entry("documents_found", greaterThan(0))
171171
.entry("values_loaded", greaterThan(0))
172+
.entry("completion_time_in_millis", greaterThan(0L))
173+
.entry("expiration_time_in_millis", greaterThan(0L))
174+
.entry("start_time_in_millis", greaterThan(0L))
172175
);
173176
}
174177

test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,13 +2767,20 @@ protected static MapMatcher getProfileMatcher() {
27672767
.entry("plans", instanceOf(List.class));
27682768
}
27692769

2770-
protected static MapMatcher getResultMatcher(boolean includePartial, boolean includeDocumentsFound) {
2770+
protected static MapMatcher getResultMatcher(boolean includePartial, boolean includeDocumentsFound, boolean includeTimestamps) {
27712771
MapMatcher mapMatcher = matchesMap();
27722772
if (includeDocumentsFound) {
27732773
// Older versions may not return documents_found and values_loaded.
27742774
mapMatcher = mapMatcher.entry("documents_found", greaterThanOrEqualTo(0));
27752775
mapMatcher = mapMatcher.entry("values_loaded", greaterThanOrEqualTo(0));
27762776
}
2777+
if (includeTimestamps) {
2778+
// Older versions may not return start_time_in_millis, completion_time_in_millis and expiration_time_in_millis
2779+
mapMatcher = mapMatcher.entry("start_time_in_millis", greaterThanOrEqualTo(0L));
2780+
mapMatcher = mapMatcher.entry("completion_time_in_millis", greaterThanOrEqualTo(0L));
2781+
mapMatcher = mapMatcher.entry("expiration_time_in_millis", greaterThanOrEqualTo(0L));
2782+
}
2783+
27772784
mapMatcher = mapMatcher.entry("took", greaterThanOrEqualTo(0));
27782785
// Older version may not have is_partial
27792786
if (includePartial) {
@@ -2786,7 +2793,11 @@ protected static MapMatcher getResultMatcher(boolean includePartial, boolean inc
27862793
* Create empty result matcher from result, taking into account all metadata items.
27872794
*/
27882795
protected static MapMatcher getResultMatcher(Map<String, Object> result) {
2789-
return getResultMatcher(result.containsKey("is_partial"), result.containsKey("documents_found"));
2796+
return getResultMatcher(
2797+
result.containsKey("is_partial"),
2798+
result.containsKey("documents_found"),
2799+
result.containsKey("start_time_in_millis")
2800+
);
27902801
}
27912802

27922803
/**

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/tree/Node.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,23 @@ public List<T> collect(Predicate<? super T> predicate) {
176176
return l.isEmpty() ? emptyList() : l;
177177
}
178178

179+
public <E extends T> List<E> collect(Class<E> typeToken) {
180+
return collect(typeToken, n -> true);
181+
}
182+
183+
public <E extends T> List<E> collect(Class<E> typeToken, Predicate<? super E> predicate) {
184+
List<E> l = new ArrayList<>();
185+
forEachDown(n -> {
186+
if (typeToken.isInstance(n)) {
187+
E e = typeToken.cast(n);
188+
if (predicate.test(e)) {
189+
l.add(e);
190+
}
191+
}
192+
});
193+
return l.isEmpty() ? emptyList() : l;
194+
}
195+
179196
public List<T> collectLeaves() {
180197
return collect(n -> n.children().isEmpty());
181198
}

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClusterTimeSeriesIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,11 @@ private boolean capabilitiesSupportedNewAndOld(List<String> requiredCapabilities
311311
}
312312

313313
private void assertResultMap(boolean includeCCSMetadata, Map<String, Object> result, Map<String, Object> expectedResult) {
314-
MapMatcher mapMatcher = getResultMatcher(result.containsKey("is_partial"), result.containsKey("documents_found")).extraOk();
314+
MapMatcher mapMatcher = getResultMatcher(
315+
result.containsKey("is_partial"),
316+
result.containsKey("documents_found"),
317+
result.containsKey("start_time_in_millis")
318+
).extraOk();
315319
if (includeCCSMetadata) {
316320
mapMatcher = mapMatcher.entry("_clusters", any(Map.class));
317321
}

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClustersIT.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ private boolean capabilitiesSupportedNewAndOld(List<String> requiredCapabilities
262262
}
263263

264264
private <C, V> void assertResultMap(boolean includeCCSMetadata, Map<String, Object> result, C columns, V values, boolean remoteOnly) {
265-
MapMatcher mapMatcher = getResultMatcher(result.containsKey("is_partial"), result.containsKey("documents_found")).extraOk();
265+
MapMatcher mapMatcher = getResultMatcher(
266+
result.containsKey("is_partial"),
267+
result.containsKey("documents_found"),
268+
result.containsKey("start_time_in_millis")
269+
).extraOk();
266270
if (includeCCSMetadata) {
267271
mapMatcher = mapMatcher.entry("_clusters", any(Map.class));
268272
}
@@ -523,7 +527,11 @@ public void testLookupJoinAliasesSkipOld() throws IOException {
523527
var columns = List.of(Map.of("name", "c", "type", "long"));
524528
var values = List.of(List.of(localDocs.size()));
525529

526-
MapMatcher mapMatcher = getResultMatcher(false, result.containsKey("documents_found")).extraOk();
530+
MapMatcher mapMatcher = getResultMatcher(
531+
false,
532+
result.containsKey("documents_found"),
533+
result.containsKey("start_time_in_millis")
534+
).extraOk();
527535
mapMatcher = mapMatcher.entry("_clusters", any(Map.class));
528536
mapMatcher = mapMatcher.entry("is_partial", true);
529537
assertMap(result, mapMatcher.entry("columns", columns).entry("values", values));

0 commit comments

Comments
 (0)