String dir = System.getProperty("test.dir", ".") + "/mapred";
Path inputPath = new Path(dir + "/out" + "/myavro1-r-00000.avro");
FileStatus fileStatus = FileSystem.get(job).getFileStatus(inputPath);
FileSplit fileSplit = new FileSplit(inputPath, 0, fileStatus.getLen(), job);
AvroWrapper<Utf8> inputPair = new AvroWrapper<Utf8>(null);
NullWritable ignore = NullWritable.get();
AvroRecordReader<Utf8> recordReader = new AvroRecordReader<Utf8>(job, fileSplit);
long sumOfCounts = 0;
long numOfCounts = 0;
while(recordReader.next(inputPair, ignore)) {
sumOfCounts += Long.parseLong(inputPair.datum().toString().split(":")[2].replace("}","").trim());