Open
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);
}
(
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.