-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Encode field attributes as predicates #48864
Copy link
Copy link
Open
Labels
:Analytics/AggregationsAggregationsAggregations>refactoring>tech-debtTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
Currently, the aggregations framework uses instanceof operations in many places to figure out what type of values we are getting. For example:
if (indexFieldData instanceof IndexOrdinalsFieldData) {
dataSource = new ValuesSource.Bytes.WithOrdinals.FieldData((IndexOrdinalsFieldData) indexFieldData);
} else {
dataSource = new ValuesSource.Bytes.FieldData(indexFieldData);
}
(
Lines 353 to 357 in 4a66cfc
| if (indexFieldData instanceof IndexOrdinalsFieldData) { | |
| dataSource = new ValuesSource.Bytes.WithOrdinals.FieldData((IndexOrdinalsFieldData) indexFieldData); | |
| } else { | |
| dataSource = new ValuesSource.Bytes.FieldData(indexFieldData); | |
| } |
As part of our effort to get away from hard coding type information in the core aggregations framework, we'd like to explore replacing these with predicates on the Field Data classes. For example, the above case could use a hasOrdinals() predicate instead of the instanceof check.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Analytics/AggregationsAggregationsAggregations>refactoring>tech-debtTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Type
Fields
Give feedbackNo fields configured for issues without a type.