use inline map_reduce