You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "suyashj1231 (via GitHub)" <gi...@apache.org> on 2026/06/10 15:32:08 UTC
[PR] fix(workflow-operator): no null padding in reservoir sampling [texera]
suyashj1231 opened a new pull request, #5606:
URL: https://github.com/apache/texera/pull/5606
### What changes were proposed in this PR?
`ReservoirSamplingOpExec` allocates a fixed-size reservoir of length `count` (the per-worker share of `k`). When a worker receives fewer tuples than `count`, only the first `n` slots are filled, but `onFinish` returned the whole array, yielding `count - n` trailing `null` entries. The nulls are currently swallowed by a distant null-guard in `DataProcessor`, so the bug is latent — but the operator violates the "do not emit null tuples" contract and breaks if that guard is ever narrowed or bypassed.
```
Before: input < k -> onFinish emits [t0 .. tn-1, null, ..., null] (engine guard hides them)
After: input < k -> onFinish emits [t0 .. tn-1] (no nulls emitted at all)
```
The fix emits only the filled prefix:
```scala
override def onFinish(port: Int): Iterator[TupleLike] = reservoir.iterator.take(n)
```
`take(n)` is a no-op when `n >= count` (input ≥ k), so the sampled output is unchanged in the normal case.
### Any related issues, documentation, discussions?
Closes #5592
### How was this PR tested?
Added three regression cases to `ReservoirSamplingOpExecSpec`:
| Case | Asserts |
| --- | --- |
| `input size < k` | only the received tuples are emitted, in order, no nulls |
| empty input | `onFinish` emits nothing |
| skewed partitioning (`k=10`, 3 workers, worker 0 gets 2 tuples) | no null padding for an under-filled worker share |
All three fail against the old `reservoir.iterator` and pass with `reservoir.iterator.take(n)`; the 9 pre-existing cases stay green (TDD red → green verified by stashing the source fix).
```
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.reservoirsampling.ReservoirSamplingOpExecSpec"
# Tests: succeeded 12, failed 0, canceled 0, ignored 0, pending 0
```
`sbt WorkflowOperator/scalafixAll` and `sbt WorkflowOperator/scalafmtAll` produce no further diff.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.7), reviewed and verified by the author.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(workflow-operator): no null padding in reservoir sampling [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5606:
URL: https://github.com/apache/texera/pull/5606#issuecomment-4671859084
<!-- texera:welcome-first-time-contributor -->
👋 Thanks for your first contribution to Texera, @suyashj1231!
You can drive common housekeeping tasks just by leaving a comment. Type the command on its own line.
### On issues
| Command | What it does |
|---|---|
| `/take` | Assign the issue to yourself (self-claim it) |
| `/untake` | Remove yourself as assignee |
To find unclaimed work, search `is:issue is:open no:assignee` — there's no "triage" label; the search filter *is* the triage state.
### Linking sub-issues
| Command | Where to run it | What it does |
|---|---|---|
| `/sub-issue #12 #13` | On the **parent** | Links #12 and #13 as children of this issue |
| `/unsub-issue #12 #13` | On the **parent** | Unlinks those children |
| `/parent-issue #5` | On the **child** | Sets #5 as this issue's parent |
| `/unparent-issue` | On the **child** | Removes this issue's parent (auto-detected) |
| `/unparent-issue #5` | On the **child** | Removes parent #5 explicitly |
You can write references as `#12` or bare `12`. Cross-repo references like `owner/repo#12` aren't supported and are ignored.
### On pull requests (author only)
| Command | What it does |
|---|---|
| `/request-review @user [@user ...]` | Request reviews from those users |
| `/unrequest-review @user [@user ...]` | Cancel those review requests |
You can mention teams as `@org/team`, and `@copilot` works too. Only the PR **author** can use these commands.
> **Note:** Commands must match exactly — `/take this` won't work, only `/take`. Bots are ignored, and you can't self-link an issue or set an issue as its own parent.
For the full contribution flow, see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md).
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(workflow-operator): no null padding in reservoir sampling [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on PR #5606:
URL: https://github.com/apache/texera/pull/5606#issuecomment-4675780903
@xuang7 shall we backport this fix to v1.2?
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(workflow-operator): no null padding in reservoir sampling [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5606:
URL: https://github.com/apache/texera/pull/5606#issuecomment-4695232851
Backport to [`release/v1.2`](https://github.com/apache/texera/tree/release/v1.2) succeeded as [`b876b47`](https://github.com/apache/texera/commit/b876b475d93c37696b8da0436d7ad3e7263e6317). [Run](https://github.com/apache/texera/actions/runs/27441715509)
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(workflow-operator): no null padding in reservoir sampling [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang merged PR #5606:
URL: https://github.com/apache/texera/pull/5606
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(workflow-operator): no null padding in reservoir sampling [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #5606:
URL: https://github.com/apache/texera/pull/5606#issuecomment-4672771285
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/5606?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 52.42%. Comparing base ([`cd60535`](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`72721e8`](https://app.codecov.io/gh/apache/texera/commit/72721e88b520e83141715b6e79f4bd2e1a420e5f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #5606 +/- ##
============================================
- Coverage 52.42% 52.42% -0.01%
+ Complexity 2481 2480 -1
============================================
Files 1070 1070
Lines 41359 41358 -1
Branches 4441 4441
============================================
- Hits 21682 21681 -1
Misses 18406 18406
Partials 1271 1271
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `64.61% <ø> (ø)` | | |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `33.76% <ø> (ø)` | | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.27% <ø> (-0.01%)` | :arrow_down: | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `1.65% <ø> (ø)` | | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.06% <ø> (ø)` | | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.21% <ø> (ø)` | | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `47.03% <ø> (ø)` | | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `90.72% <ø> (ø)` | | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [python](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `90.75% <ø> (ø)` | | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/5606/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.69% <ø> (ø)` | | Carriedforward from [cd60535](https://app.codecov.io/gh/apache/texera/commit/cd6053567094fcab1dfffd91e070411f64769d14?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/5606?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(workflow-operator): no null padding in reservoir sampling [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5606:
URL: https://github.com/apache/texera/pull/5606#issuecomment-4694475185
<!-- texera-benchmarks-comment -->
## ⚠️ Benchmark changes need a look
🟢 2 better · 🔴 13 worse · ⚪ 0 noise (<±5%) · 0 without baseline
> CI benchmark results are noisy; treat <±5% as noise unless repeated.
[Dashboard](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/27437265300)
| | config | throughput | MB/s | latency | max Δ latest / 7d |
|---|---|---:|---:|---:|---:|
| 🔴 | bs=10 sw=10 sl=64 | 356 | 0.217 | 24,233/40,913/40,913 us | 🔴 +19.6% / 🔴 +14.0% |
| 🔴 | bs=100 sw=10 sl=64 | 802 | 0.489 | 125,608/141,217/141,217 us | 🔴 +17.0% / 🔴 +11.5% |
| 🔴 | bs=1000 sw=10 sl=64 | 917 | 0.559 | 1,100,271/1,130,579/1,130,579 us | 🔴 +19.0% / 🔴 +12.7% |
<details><summary>Baseline details</summary>
Latest main `227cbd7` from 2026-06-12T19:07:43.071Z
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---:|---:|---:|---:|---:|
| bs=10 sw=10 sl=64 | throughput | 356 tuples/sec | 422.14 tuples/sec | 398.78 tuples/sec | -15.7% | -10.7% |
| bs=10 sw=10 sl=64 | MB/s | 0.217 MB/s | 0.258 MB/s | 0.243 MB/s | -15.8% | -10.8% |
| bs=10 sw=10 sl=64 | p50 | 24,233 us | 22,135 us | 24,396 us | +9.5% | -0.7% |
| bs=10 sw=10 sl=64 | p95 | 40,913 us | 34,198 us | 35,892 us | +19.6% | +14.0% |
| bs=10 sw=10 sl=64 | p99 | 40,913 us | 34,198 us | 35,892 us | +19.6% | +14.0% |
| bs=100 sw=10 sl=64 | throughput | 802 tuples/sec | 894.49 tuples/sec | 886.25 tuples/sec | -10.3% | -9.5% |
| bs=100 sw=10 sl=64 | MB/s | 0.489 MB/s | 0.546 MB/s | 0.541 MB/s | -10.4% | -9.6% |
| bs=100 sw=10 sl=64 | p50 | 125,608 us | 107,334 us | 112,613 us | +17.0% | +11.5% |
| bs=100 sw=10 sl=64 | p95 | 141,217 us | 160,327 us | 135,197 us | -11.9% | +4.5% |
| bs=100 sw=10 sl=64 | p99 | 141,217 us | 160,327 us | 135,197 us | -11.9% | +4.5% |
| bs=1000 sw=10 sl=64 | throughput | 917 tuples/sec | 1,077 tuples/sec | 1,029 tuples/sec | -14.9% | -10.9% |
| bs=1000 sw=10 sl=64 | MB/s | 0.559 MB/s | 0.657 MB/s | 0.628 MB/s | -15.0% | -11.0% |
| bs=1000 sw=10 sl=64 | p50 | 1,100,271 us | 928,059 us | 976,698 us | +18.6% | +12.7% |
| bs=1000 sw=10 sl=64 | p95 | 1,130,579 us | 950,455 us | 1,032,282 us | +19.0% | +9.5% |
| bs=1000 sw=10 sl=64 | p99 | 1,130,579 us | 950,455 us | 1,032,282 us | +19.0% | +9.5% |
</details>
<details><summary>Raw CSV</summary>
```csv
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,561.58,200,128000,356,0.217,24232.85,40913.07,40913.07
1,100,10,64,20,2495.13,2000,1280000,802,0.489,125608.21,141216.54,141216.54
2,1000,10,64,20,21820.77,20000,12800000,917,0.559,1100270.64,1130578.84,1130578.84
```
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org