Skip to content

Commit 68e5f08

Browse files
authored
Merge branch 'main' into feature/count_by_trunc_with_filter
2 parents 93e6a63 + f70dbb8 commit 68e5f08

File tree

52 files changed

+687
-52
lines changed

Some content is hidden

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

52 files changed

+687
-52
lines changed

build-conventions/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
plugins {
11-
id "com.gradle.develocity" version "4.1.1"
11+
id "com.gradle.develocity" version "4.2.2"
1212
}
1313

1414
rootProject.name = 'build-conventions'

build-tools-internal/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pluginManagement {
99
}
1010

1111
plugins {
12-
id "com.gradle.develocity" version "4.1.1"
12+
id "com.gradle.develocity" version "4.2.2"
1313
}
1414

1515
dependencyResolutionManagement {

build-tools/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pluginManagement {
1010
includeBuild "../build-conventions"
1111
}
1212
plugins {
13-
id "com.gradle.develocity" version "4.1.1"
13+
id "com.gradle.develocity" version "4.2.2"
1414
}
1515
include 'reaper'
1616

docs/changelog/138632.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138632
2+
summary: Correctly handle empty inputs in `chunkedInfer()`
3+
area: Machine Learning
4+
type: bug
5+
issues: []

docs/reference/elasticsearch/mapping-reference/mapping-source-field.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ An expert-only feature is the ability to prune the contents of the `_source` fie
356356
Removing fields from the `_source` has similar downsides to disabling `_source`, especially the fact that you cannot reindex documents from one Elasticsearch index to another. Consider using [source filtering](/reference/elasticsearch/rest-apis/retrieve-selected-fields.md#source-filtering) instead.
357357
::::
358358

359+
::::{note}
360+
Source pruning is not available in {{serverless-short}}
361+
::::
359362

360363
The `includes`/`excludes` parameters (which also accept wildcards) can be used as follows:
361364

gradle/build.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ checkstyle = "com.puppycrawl.tools:checkstyle:11.0.1"
1717
commmons-io = "commons-io:commons-io:2.2"
1818
docker-compose = "com.avast.gradle:gradle-docker-compose-plugin:0.17.5"
1919
forbiddenApis = "de.thetaphi:forbiddenapis:3.8"
20-
gradle-enterprise = "com.gradle:develocity-gradle-plugin:4.1.1"
20+
gradle-enterprise = "com.gradle:develocity-gradle-plugin:4.2.2"
2121
hamcrest = "org.hamcrest:hamcrest:3.0"
2222
httpcore5 = "org.apache.httpcomponents.core5:httpcore5:5.3.3"
2323
httpclient5 = "org.apache.httpcomponents.client5:httpclient5:5.4.2"

gradle/verification-metadata.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,9 @@
964964
<sha256 value="48234cd74e35d91a31a683820a35b5b6d11b55527f32a5b162c6757408b95d7a" origin="Generated by Gradle"/>
965965
</artifact>
966966
</component>
967-
<component group="com.gradle" name="develocity-gradle-plugin" version="4.1.1">
968-
<artifact name="develocity-gradle-plugin-4.1.1.jar">
969-
<sha256 value="21a509cfff19aad0eb23dcc2a1979345708ffa61d6f4488f8956caae51cb55ff" origin="Generated by Gradle"/>
967+
<component group="com.gradle" name="develocity-gradle-plugin" version="4.2.2">
968+
<artifact name="develocity-gradle-plugin-4.2.2.jar">
969+
<sha256 value="3e45a8c18b34a8dddeb185c3e7030728634aaf31b9762052e5dae87f3d597fba" origin="Generated by Gradle"/>
970970
</artifact>
971971
</component>
972972
<component group="com.gradleup.gratatouille" name="gratatouille-runtime" version="0.0.8">

libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentParser.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,12 @@ <T> Map<String, T> map(Supplier<Map<String, T>> mapFactory, CheckedFunction<XCon
225225
* The callback to notify when parsing encounters a deprecated field.
226226
*/
227227
DeprecationHandler getDeprecationHandler();
228+
229+
/**
230+
* Switch to a different underlying parser.
231+
* Typically, that's a noop but some filter parsers might want to wrap the underlying parser again.
232+
*/
233+
default XContentParser switchParser(XContentParser parser) throws IOException {
234+
return parser;
235+
}
228236
}

modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/DisabledSecurityDataStreamTestCase.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.common.util.concurrent.ThreadContext;
1515
import org.elasticsearch.test.cluster.ElasticsearchCluster;
1616
import org.elasticsearch.test.cluster.FeatureFlag;
17+
import org.elasticsearch.test.cluster.local.LocalClusterConfigProvider;
1718
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
1819
import org.elasticsearch.test.rest.ESRestTestCase;
1920
import org.junit.ClassRule;
@@ -24,12 +25,15 @@
2425
*/
2526
public abstract class DisabledSecurityDataStreamTestCase extends ESRestTestCase {
2627

28+
protected static LocalClusterConfigProvider clusterConfig = c -> {};
29+
2730
@ClassRule
2831
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
2932
.distribution(DistributionType.DEFAULT)
3033
.setting("xpack.security.enabled", "false")
3134
.setting("xpack.watcher.enabled", "false")
3235
.feature(FeatureFlag.INDEX_DIMENSIONS_TSID_OPTIMIZATION_FEATURE_FLAG)
36+
.apply(() -> clusterConfig) // allows sub-classes to apply a custom cluster configuration
3337
.build();
3438

3539
@Override

modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/TsdbDataStreamRestIT.java

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
*/
99
package org.elasticsearch.datastreams;
1010

11+
import org.elasticsearch.Build;
1112
import org.elasticsearch.client.Request;
1213
import org.elasticsearch.client.ResponseException;
14+
import org.elasticsearch.common.settings.Settings;
1315
import org.elasticsearch.common.time.DateFormatter;
1416
import org.elasticsearch.common.time.DateFormatters;
1517
import org.elasticsearch.common.time.FormatNames;
1618
import org.elasticsearch.index.mapper.DateFieldMapper;
19+
import org.elasticsearch.test.cluster.FeatureFlag;
1720
import org.elasticsearch.test.rest.ObjectPath;
1821
import org.junit.Before;
1922

@@ -25,6 +28,7 @@
2528
import java.util.Set;
2629

2730
import static org.elasticsearch.cluster.metadata.DataStreamTestHelper.backingIndexEqualTo;
31+
import static org.elasticsearch.index.IndexSettings.USE_SYNTHETIC_ID;
2832
import static org.hamcrest.Matchers.containsInAnyOrder;
2933
import static org.hamcrest.Matchers.containsString;
3034
import static org.hamcrest.Matchers.empty;
@@ -36,6 +40,10 @@
3640

3741
public class TsdbDataStreamRestIT extends DisabledSecurityDataStreamTestCase {
3842

43+
static {
44+
clusterConfig = config -> config.feature(FeatureFlag.TSDB_SYNTHETIC_ID_FEATURE_FLAG);
45+
}
46+
3947
private static final String COMPONENT_TEMPLATE = """
4048
{
4149
"template": {
@@ -53,7 +61,7 @@ public class TsdbDataStreamRestIT extends DisabledSecurityDataStreamTestCase {
5361
"number_of_replicas": 1,
5462
"number_of_shards": 2,
5563
"mode": "time_series"
56-
SOURCEMODE
64+
RANDOM_INDEX_SETTINGS
5765
}
5866
},
5967
"mappings":{
@@ -202,9 +210,51 @@ public class TsdbDataStreamRestIT extends DisabledSecurityDataStreamTestCase {
202210
""";
203211

204212
private static String getTemplate() {
205-
return TEMPLATE.replace("SOURCEMODE", randomFrom("", """
206-
, "mapping": { "source": { "mode": "stored" } }""", """
207-
, "mapping": { "source": { "mode": "synthetic" } }"""));
213+
String sourceMode = switch (randomInt(2)) {
214+
case 0 -> null;
215+
case 1 -> """
216+
"source": { "mode": "stored" }
217+
""";
218+
case 2 -> """
219+
"source": { "mode": "synthetic" }
220+
""";
221+
default -> throw new AssertionError("Unknown mode");
222+
};
223+
String idMode = null;
224+
if (Build.current().isSnapshot()) {
225+
idMode = switch (randomInt(2)) {
226+
case 0 -> null;
227+
case 1 -> """
228+
"use_synthetic_id": "false"
229+
""";
230+
case 2 -> """
231+
"use_synthetic_id": "true"
232+
""";
233+
default -> throw new AssertionError("Unknown mode");
234+
};
235+
} else {
236+
assertFalse(
237+
"Setting is enabled by default and must now be tested on non-snapshot build too ",
238+
USE_SYNTHETIC_ID.getDefault(Settings.EMPTY)
239+
);
240+
}
241+
if (sourceMode == null && idMode == null) {
242+
return TEMPLATE.replace("RANDOM_INDEX_SETTINGS", "");
243+
}
244+
var mapping = new StringBuilder("""
245+
, "mapping": {
246+
""");
247+
if (sourceMode != null) {
248+
mapping.append(sourceMode);
249+
}
250+
if (idMode != null) {
251+
if (sourceMode != null) {
252+
mapping.append(',');
253+
}
254+
mapping.append(idMode);
255+
}
256+
mapping.append('}');
257+
return TEMPLATE.replace("RANDOM_INDEX_SETTINGS", mapping.toString());
208258
}
209259

210260
private static boolean trialStarted = false;

0 commit comments

Comments
 (0)