Skip to content

Commit ab9e7ba

Browse files
committed
Change
1 parent 38ceb29 commit ab9e7ba

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,27 +126,14 @@ public String documentDescription() {
126126

127127
private XContentParser getParser(SourceToParse source, @Nullable Map<String, Object> structuredSource, XContentType xContentType)
128128
throws IOException {
129+
XContentParserConfiguration config = parserConfiguration.withIncludeSourceOnError(source.getIncludeSourceOnError());
129130
if (structuredSource == null) {
130-
return XContentHelper.createParser(
131-
parserConfiguration.withIncludeSourceOnError(source.getIncludeSourceOnError()),
132-
source.source(),
133-
xContentType
134-
);
131+
return XContentHelper.createParser(config, source.source(), xContentType);
135132
} else {
136133
if (structuredSource instanceof ESONSource.ESONObject esonObject) {
137-
return new ESONXContentParser(
138-
esonObject,
139-
NamedXContentRegistry.EMPTY,
140-
DeprecationHandler.IGNORE_DEPRECATIONS,
141-
xContentType
142-
);
134+
return new ESONXContentParser(esonObject, config.registry(), config.deprecationHandler(), xContentType);
143135
} else {
144-
return new MapXContentParser(
145-
NamedXContentRegistry.EMPTY,
146-
DeprecationHandler.IGNORE_DEPRECATIONS,
147-
structuredSource,
148-
xContentType
149-
);
136+
return new MapXContentParser(config.registry(), config.deprecationHandler(), structuredSource, xContentType);
150137
}
151138
}
152139
}

server/src/main/java/org/elasticsearch/ingest/IngestService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,8 @@ private void executePipelines(
11951195
ingestDocument.doNoSelfReferencesCheck(false);
11961196
}
11971197
} catch (IllegalArgumentException ex) {
1198+
// TODO: Hack to delete mutated source
1199+
indexRequest.source(indexRequest.source(), indexRequest.getContentType());
11981200
// An IllegalArgumentException can be thrown when an ingest processor creates a source map that is self-referencing.
11991201
// In that case, we catch and wrap the exception, so we can include more details
12001202
exceptionHandler.accept(

x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlTestCase.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,6 @@ public void testSelectGroupByScore() throws Exception {
440440
public void testCountAndCountDistinct() throws IOException {
441441
String mode = randomMode();
442442
index(
443-
"test",
444443
"{\"gender\":\"m\", \"langs\": 1}",
445444
"{\"gender\":\"m\", \"langs\": 1}",
446445
"{\"gender\":\"m\", \"langs\": 2}",

0 commit comments

Comments
 (0)