# map reduce is so repigged

okay, so here’s a problem I ran into today. In PigLatin, I needed to calculate the following:

A = group TABLE by (f1,f2,f3);
B = foreach A generate group, SUM(f4), MIN(f5), MAX(f6), (f7 is null)?1:0;

My problem is that for the data that I have (about 100gb) there are actually only about a dozzen combinations of (f1,f2,f3), so the consequence is that the execution crashes with the reducer running out of memory.

The question is, is it possible to make this calculation even with sparse keys?
{"ft_lang_label":"__label__en","ft_lang_prob":0.93498224,"math_prob":0.9907187,"size":493,"snap":"2020-45-2020-50","text_gpt3_token_len":132,"char_repetition_ratio":0.09815951,"word_repetition_ratio":0.0,"special_character_ratio":0.27789047,"punctuation_ratio":0.1754386,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96605533,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-12-03T20:14:47Z\",\"WARC-Record-ID\":\"<urn:uuid:abfbf094-4a55-4b36-804a-421b556343fb>\",\"Content-Length\":\"66448\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:cf0ac6bb-10ae-48b3-942e-3c2175d982bb>\",\"WARC-Concurrent-To\":\"<urn:uuid:f9244f5a-a140-4c41-a07e-9b9dfd4f24c2>\",\"WARC-IP-Address\":\"192.0.78.24\",\"WARC-Target-URI\":\"https://f-art-museum.com/2010/08/04/map-reduce-is-so-repigged/\",\"WARC-Payload-Digest\":\"sha1:WAF4TWMDMXI7DPGWVF6RSK5BCGLLPSJW\",\"WARC-Block-Digest\":\"sha1:5MHFTTWRONAF5QHJ7MHUFJN2PWBWH3UV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141732696.67_warc_CC-MAIN-20201203190021-20201203220021-00365.warc.gz\"}"}