Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@
public class StandardVersusLogsIndexModeChallengeRestIT extends AbstractChallengeRestTest {
private final int numShards = randomBoolean() ? randomIntBetween(2, 5) : 0;
private final int numReplicas = randomBoolean() ? randomIntBetween(1, 3) : 0;
private final boolean fullyDynamicMapping = randomBoolean();

public StandardVersusLogsIndexModeChallengeRestIT() {
super("standard-apache-baseline", "logs-apache-contender", "baseline-template", "contender-template", 101, 101);
}

@Override
public void baselineMappings(XContentBuilder builder) throws IOException {
if (randomBoolean()) {
if (fullyDynamicMapping == false) {
builder.startObject()
.startObject("properties")

Expand Down Expand Up @@ -108,7 +109,7 @@ public void contenderMappings(XContentBuilder builder) throws IOException {
builder.startObject();
builder.field("subobjects", false);

if (randomBoolean()) {
if (fullyDynamicMapping == false) {
builder.startObject("properties")

.startObject("@timestamp")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,21 @@ private Optional<MatchResult> matchWithFieldSpecificMatcher(String fieldName, Li
}

var expectedFieldMapping = expectedNormalizedMapping.get(fieldName);
if (expectedFieldMapping == null || Objects.equals(actualFieldType, expectedFieldMapping.get("type")) == false) {
throw new IllegalStateException("Field type of a leaf field [" + fieldName + "] differs between expected and actual mapping");
if (expectedFieldMapping == null) {
throw new IllegalStateException("Leaf field [" + fieldName + "] is present in actual mapping but absent in expected mapping");
} else {
var expectedFieldType = expectedFieldMapping.get("type");
if (Objects.equals(actualFieldType, expectedFieldType) == false) {
throw new IllegalStateException(
"Leaf field ["
+ fieldName
+ "] has type ["
+ actualFieldType
+ "] in actual mapping but a different type ["
+ expectedFieldType
+ "] in expected mapping"
);
}
}

var fieldSpecificMatcher = fieldSpecificMatchers.get(actualFieldType);
Expand Down
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ tests:
- class: org.elasticsearch.xpack.esql.analysis.VerifierTests
method: testMatchCommand
issue: https://github.com/elastic/elasticsearch/issues/111661
- class: org.elasticsearch.datastreams.logsdb.qa.StandardVersusLogsIndexModeChallengeRestIT
method: testMatchAllQuery
issue: https://github.com/elastic/elasticsearch/issues/111664
- class: org.elasticsearch.datastreams.logsdb.qa.StandardVersusLogsIndexModeChallengeRestIT
method: testTermsQuery
issue: https://github.com/elastic/elasticsearch/issues/111666

# Examples:
#
Expand Down