How do I return MapReduce results in JSON format on HDInsight / Hadoop (C# only)? RRS feed

  • Question

  • Hi,

    I am trying to return my MapReduce results into a long JSON string, any ideas?

    This is my "reduce" code:

        public class NamespaceReducer : ReducerCombinerBase
            //Accepts each key and count the occurrances 
            public override void Reduce(string key, IEnumerable<string> values, ReducerCombinerContext context)
                //Write back 
                context.EmitKeyValue(key, values.Count().ToString());           


    Gabriel Renom - Business Systems Analyst - DWF LLP - Blog: www.gabrielrenom.net

    Thursday, June 27, 2013 10:11 AM

All replies

  • Hi,

    The link at : https://github.com/SaschaDittmann/MapReduceSamples/tree/master/MapReduceSamples/Average should help you to get the output in json format.

    I will be marking this thread as "proposed as answer" and you can always "unpropose" for continued discussion.



    Wednesday, September 9, 2015 1:41 AM