dimanche 2 novembre 2008

Map / reduce

Reading this article about the functional aspects of Python made me ponder about the meaning of the 'map' function.

I can understand the instruction 'map this function to a list', meaning 'apply this function' to every entry of the list:
In [1]: result = map(lambda x : x + 1, [1,2,3,4,5])

In [2]: print result
[2, 3, 4, 5, 6]

What I failed to comprehend is: how does this relate to the 'map' part 
of the map/reduce algorithm (hadoop) ?
Here, mapping a list aims at splitting the list into smaller buckets, 
then applying an algorithm to this list of lists.

Wikipedia to the rescue: 
I was relieved to read that the semantics attached
 to the infamous Google algorithm are not the same as 
the original functional programming concepts.

Aucun commentaire: