use of org.apache.apex.malhar.lib.appdata.gpo.Serde in project apex-malhar by apache.
the class AggregatorUtils method getOutputFieldsDescriptor.
public static FieldsDescriptor getOutputFieldsDescriptor(FieldsDescriptor inputFieldsDescriptor, CompositeAggregator compositeAggregator) {
Map<String, Type> fieldToType = Maps.newHashMap();
Map<String, Serde> fieldToSerde = Maps.newHashMap();
for (Map.Entry<String, Type> entry : inputFieldsDescriptor.getFieldToType().entrySet()) {
String fieldName = entry.getKey();
Type outputType = compositeAggregator.getOutputType();
fieldToType.put(fieldName, outputType);
fieldToSerde.put(fieldName, SerdeMapPrimitive.INSTANCE);
}
return new FieldsDescriptor(fieldToType, fieldToSerde);
}
Aggregations