The bulk of the literature is focused on the first step . In Section 3 , we show how to efficiently implement both steps in a single - pass over the data and provide the details of a MapReduce implementation .