MapReduce code for benchmark queries