RUBY-596 Map reduce