Map data = (Map) context[1];
FieldAlias alias = (FieldAlias) context[2];
if (entry.getFields().isDefined()) {
// lookup using writables
Text lookupKey = new Text();
// TODO: it's worth benchmarking whether using an index/offset yields significantly better performance
for (Comparable<?> field : entry.getFields()) {
if (IS_ES_10) {
// check for multi-level alias
Object result = data;
for (String level : StringUtils.tokenize(alias.toES(field.toString()), ".")) {
lookupKey.set(level);
result = ((Map) result).get(lookupKey);
if (result == null) {
break;
}
}
CascadingUtils.setObject(entry, field, result);
}
else {
lookupKey.set(alias.toES(field.toString()));
CascadingUtils.setObject(entry, field, data.get(lookupKey));
}
}
}
else {