Ma77Ball opened a new pull request, #9572:
URL: https://github.com/apache/texera/pull/9572

   ### What changes were proposed in this PR?
   - ReservoirSamplingOpExec draws the replacement index with nextInt(n+1) 
instead of nextInt(n), matching Algorithm R so each item is kept with 
probability count/(n+1) and the sample is uniform.
   - A zero-length reservoir (k coerced to 0) now keeps nothing instead of 
throwing on nextInt(0).
   ### Any related issues, documentation, discussions?
   Closes: #9569
   ### How was this PR tested?
   - Run `sbt "WorkflowOperator/testOnly *ReservoirSamplingOpExecSpec"` under 
JDK 17; expect 14 passing, including a new case that reproduces Algorithm R 
with the executor's seed and asserts the reservoir matches, and the updated k=0 
case that now expects an empty result.
   - Drag a Reservoir Sampling operator onto a workflow with k well below the 
input size, run it a few times, and confirm the sampled rows are not clustered 
at the end of the input.
   ### Was this PR authored or co-authored using generative AI tooling?
   Co-authored with Claude Opus 4.8 in compliance with ASF
   


-- 
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]

Reply via email to