Ma77Ball opened a new issue, #9569: URL: https://github.com/apache/texera/issues/9569
### What happened? The Reservoir Sampling operator does not produce a uniform random sample. The replacement probability is off by one, so the first input tuple after the reservoir fills is always kept (probability 1.0 instead of count/(count+1)), biasing the final sample toward tuples that arrive later in the stream. ### How to reproduce? Run a workflow with a Reservoir Sampling operator (small k, e.g. 5) over an input much larger than k (100+ rows); across runs the sampled rows skew toward the end of the input. In code, ReservoirSamplingOpExec.processTuple draws rand.nextInt(n) where n is the number of tuples already seen, instead of the Algorithm R bound nextInt(n+1). ### Version/Branch main -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
