Skip to content

Commit 9503e9f

Browse files
authored
Runtime fields core-with-mapped tests support tsdb (#83577)
As runtime fields not support `time_series_dimension` and `time_series_metric`, it will lead to the failure of tsdb test case. And tsdb indices require the @timestamp field. So I improve the `runtimeifyMappingProperties` method logic, add some skip rule. - skip `time_series_dimension` field. - skip `time_series_metric` field. - skip `@timestamp` field. And the PR fixed the failed test in #83431
1 parent fb00992 commit 9503e9f

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

docs/changelog/83577.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 83577
2+
summary: Runtime fields core-with-mapped tests support tsdb
3+
area: Mapping
4+
type: bug
5+
issues: []

x-pack/qa/runtime-fields/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ subprojects {
7979
//there is something wrong when using dotted document syntax here, passes in main yaml tests
8080
'search/330_fetch_fields/Test nested field inside object structure',
8181

82-
// AwaitsFix: https://github.com/elastic/elasticsearch/issues/83431
83-
'search.aggregation/450_time_series/Basic test',
8482
/////// TO FIX ///////
8583

8684
/////// NOT SUPPORTED ///////

x-pack/qa/runtime-fields/src/main/java/org/elasticsearch/xpack/runtimefields/test/CoreTestTranslater.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.elasticsearch.common.io.stream.BytesStreamOutput;
1212
import org.elasticsearch.core.RestApiVersion;
1313
import org.elasticsearch.index.mapper.BooleanFieldMapper;
14+
import org.elasticsearch.index.mapper.DataStreamTimestampFieldMapper;
1415
import org.elasticsearch.index.mapper.DateFieldMapper;
1516
import org.elasticsearch.index.mapper.GeoPointFieldMapper;
1617
import org.elasticsearch.index.mapper.IpFieldMapper;
@@ -292,6 +293,18 @@ protected final boolean runtimeifyMappingProperties(Map<String, Object> properti
292293
// Our source reading script doesn't emulate ignore_malformed
293294
continue;
294295
}
296+
if (propertyMap.containsKey("time_series_dimension")) {
297+
// time_series_dimension field can't emulate with scripts.
298+
continue;
299+
}
300+
if (propertyMap.containsKey("time_series_metric")) {
301+
// time_series_metric field can't emulate with scripts.
302+
continue;
303+
}
304+
if (name.equals(DataStreamTimestampFieldMapper.DEFAULT_PATH)) {
305+
// time_series and data stream indices need timestamp field
306+
continue;
307+
}
295308
if (RUNTIME_TYPES.contains(type) == false) {
296309
continue;
297310
}

0 commit comments

Comments
 (0)