-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Analytics/AggregationsAggregationsAggregations>bug>testIssues or PRs that are addressing/adding testsIssues or PRs that are addressing/adding testsTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
DateRangeAggregatorTests#testCase() has the following code in it, which is supposed to change the resolution at which aggregations on date range fields are run:
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(DATE_FIELD_NAME)
.withResolution(resolution);
DateFieldMapper.DateFieldType fieldType = builder.fieldType();
fieldType.setHasDocValues(true);
fieldType.setName(DATE_FIELD_NAME);
However, DateFieldMapper.Builder.withResolution() doesn't actually make any changes to the underlying MappedFieldType, so this means that tests are always run with the default resolution (Resolution.MILLISECONDS). The tests fail if the resolution is set explicitly on the fieldtype.
RangeAggregatorTests#testDateFieldNanosecondResolution has the same test bug, and also fails when the fieldType resolution is set correctly.
Metadata
Metadata
Assignees
Labels
:Analytics/AggregationsAggregationsAggregations>bug>testIssues or PRs that are addressing/adding testsIssues or PRs that are addressing/adding testsTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)