SPARK 의 헷갈림 reduce(), fold()
아래와 같은 현상이 이상했다. >>> reduce(lambda x, y: (x*2) + y, [1,2,3,4])26>>> sc.parallelize([1,2,3,4]).reduce(lambda x, y: (x*2) + y)18>>> sc.parallelize([1,2,3,4],1).reduce(lambda x, y: (x*2) + y)26>>> sc.parallelize([1,2,3,4],2).reduce(lambda x, y: (x*2) + y)18>>> sc.parallelize([1,2,3,4],3).reduce(lambda x, y: (x*2) + y)18>>> sc.parallelize([1,2,3,4],4).reduce(lambda x, y: (x*2) + y)26 뭐지? partition 을..
2017. 2. 16.