Hacker News new | ask | show | jobs
by snoble 4947 days ago
the magic of reservoir sampling is the memory footprint is the size of the output while being completely random. In this particular implementation the order of the output is slightly biased but each row has an equal chance of being in the output.
1 comments

but yes. it has to wait until the stream is done before producing any output.