test(workflow-operator): add ReservoirSamplingOpExec spec#5384
Merged
aglinxinyuan merged 8 commits intoJun 7, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5384 +/- ##
============================================
- Coverage 51.61% 51.45% -0.16%
- Complexity 2448 2460 +12
============================================
Files 1067 1065 -2
Lines 41255 41203 -52
Branches 4437 4426 -11
============================================
- Hits 21292 21202 -90
- Misses 18712 18754 +42
+ Partials 1251 1247 -4
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/request-review @aglinxinyuan |
Yicong-Huang
reviewed
Jun 6, 2026
Yicong-Huang
approved these changes
Jun 6, 2026
aglinxinyuan
approved these changes
Jun 6, 2026
Contributor
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
### What changes were proposed in this PR? - Add `ReservoirSamplingOpExecSpec`, the first dedicated spec for the streaming reservoir-sampling executor. - Cover `processTuple` buffering (emits nothing per tuple), and `onFinish` returning all input tuples in order when input size equals k. - Cover keeping exactly k unique, input-drawn samples when input exceeds k, determinism of the seeded RNG (with a check that replacement actually happens), multi-worker partitioning of k via `equallyPartitionGoal` (k=10 across 3 workers yields 4,3,3), and `open` resetting state for executor reuse. - Characterize the input-size-below-k edge case, where the unfilled fixed-size reservoir emits null padding on finish (flagged in the spec as a likely bug for a follow-up fix). ### Any related issues, documentation, or discussions? Closes: apache#5383 ### How was this PR tested? - Run `sbt "WorkflowOperator/testOnly *ReservoirSamplingOpExecSpec"` and expect all 7 examples to pass. - This is a test-only PR (no production code changed), so the spec itself is the verification; the input-below-k example intentionally asserts the current null-padding behavior, so a green run confirms that characterization rather than a fix. ### Was this PR authored or co-authored using generative AI tooling? Co-authored with Claude Opus 4.8 in compliance with ASF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
ReservoirSamplingOpExecSpec, the first dedicated spec for the streaming reservoir-sampling executor.processTuplebuffering (emits nothing per tuple), andonFinishreturning all input tuples in order when input size equals k.equallyPartitionGoal(k=10 across 3 workers yields 4,3,3), andopenresetting state for executor reuse.Any related issues, documentation, or discussions?
Closes: #5383
How was this PR tested?
sbt "WorkflowOperator/testOnly *ReservoirSamplingOpExecSpec"and expect all 7 examples to pass.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF