The GitHub Actions job "Backport Approval Check" on 
texera.git/fix/reservoir-sampling-off-by-one has failed.
Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).

Head commit for run:
ff4ba06ab8bca497500d3a5e193a5c62234da772 / Matthew Ball <[email protected]>
fix(workflow-operator): correct reservoir sampling replacement odds

ReservoirSamplingOpExec draws the replacement index with Random.nextInt(n+1) 
instead of nextInt(n), where n is the number of tuples seen before the current 
one. Algorithm R replaces a reservoir slot for the (n+1)-th item with 
probability count/(n+1); the old nextInt(n) made the first item after the 
reservoir fills always replace (probability 1.0), biasing the sample toward 
later rows. A zero-length reservoir (k coerced to 0) now draws nextInt(1) and 
keeps nothing instead of throwing on nextInt(0).

ReservoirSamplingOpExecSpec adds a test that reproduces Algorithm R with the 
executor's seed and asserts the sampled reservoir matches it, pinning the 
off-by-one, and updates the k=0 case to expect an empty result rather than an 
IllegalArgumentException.

Report URL: https://github.com/apache/texera/actions/runs/44823291009

With regards,
GitHub Actions via GitBox

Reply via email to