Skip to content

feat(bench): add Arrow Flight E2E benchmark + Benchmarks CI workflow - #5557

Merged
Yicong-Huang merged 8 commits into
apache:mainfrom
Yicong-Huang:bench/arrow-flight-e2e
Jun 11, 2026
Merged

Yicong-Huang merged 8 commits into
apache:mainfrom
Yicong-Huang:bench/arrow-flight-e2e

Conversation

@Yicong-Huang

@Yicong-Huang Yicong-Huang commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

A bench-agnostic CI lifecycle that future suites (e.g. JMH for ArrowUtils micros) plug into by appending one line to bin/run-benchmarks.sh, plus the first concrete suite: an end-to-end Arrow Flight + PythonWorkflowWorker micro-bench.

Lifecycle

Trigger Mode PR comment Publish to gh-pages
pull_request (label-gated, mirrors amber-integration's set) pr — 3 configs × 20 batches (~5 min) ✓ —
push to main pr (post-merge fast signal) — ✓
schedule Sundays 08:00 UTC full — 36 configs × 200 batches (~50-60 min) — ✓
workflow_dispatch full — —

PR runs upload the bench as an artifact + render a markdown summary table on the workflow page; the workflow_run-triggered Benchmarks PR Comment listener (separate file because pull_request from forks gets a read-only token and zero secret access) downloads the artifact, sanitizes the CSV, and upserts a single marker-tagged PR comment. Non-blocking — not part of required-checks.yml's aggregator.

First benchmark: Arrow Flight E2E (ArrowFlightActorBench)

Spawns a real PythonWorkflowWorker actor (real Pekko mailbox + real texera_run_python_worker.py subprocess + real Arrow Flight gRPC) wired to an identity Python UDF, then times per-batch send→echo round-trip across a sweep of batch_size × schema_width × string_len. Per-config output: throughput (tuples/s, MB/s), latency p50/p95/p99, total ms. Each config writes incrementally so a killed sweep still leaves usable artifacts.

ASF: benchmark-action/github-action-benchmark is SHA-pinned to 52576c92bccf6ac60c8223ec7eb2565637cae9ba (v1.22.1) per the apache-infrastructure-actions allow-list.

Any related issues, documentation, discussions?

Closes #5556

How was this PR tested?

End-to-end validated on a fork-internal PR — Yicong-Huang/texera#17 ran the full Benchmarks workflow, the workflow_run listener fired, and a marker-tagged comment landed and upserted across two push cycles (rendered example). workflow_run only listens on the default branch, so the loop can't be tested from a non-default branch — that's why the dry-run lived on a fork; after merge, the same flow takes effect on apache/texera:main automatically.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.7)

Adds an end-to-end micro-benchmark of the Arrow Flight data path that
spawns a real PythonWorkflowWorker actor (real Pekko + real Python
subprocess via texera_run_python_worker.py + real Arrow Flight gRPC),
wires an identity Python UDF, and times per-batch send→echo round-trip
across a 36-config sweep (batch_size × schema_width × string_len).

CI integration is bench-agnostic: a single `Benchmarks` workflow calls
`bin/run-benchmarks.sh` as an opaque entry point. Future benches (e.g.
JMH for ArrowUtils micros) plug in by appending one line to that script
and adding a Publish step block. Trigger gate mirrors amber-integration
via PR labels (no file-path filters); failure does not block merges
(workflow stays out of required-checks.yml's aggregator). Results upload
to gh-pages dashboard via SHA-pinned benchmark-action (v1.22.1, on ASF
allow-list); auto-push gated on push-to-main so PRs do not pollute the
baseline.
@github-actions github-actions Bot added engine ci changes related to CI infra labels Jun 8, 2026
@codecov-commenter

codecov-commenter commented Jun 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.46%. Comparing base (75b4619) to head (bdd79c7).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5557      +/-   ##
============================================
+ Coverage     52.16%   52.46%   +0.29%     
- Complexity     2482     2488       +6     
============================================
  Files          1067     1071       +4     
  Lines         41273    41415     +142     
  Branches       4437     4442       +5     
============================================
+ Hits          21532    21728     +196     
+ Misses        18479    18420      -59     
- Partials       1262     1267       +5     
Flag Coverage Δ *Carryforward flag
access-control-service 64.61% <ø> (ø)
agent-service 33.76% <ø> (ø)
amber 53.32% <ø> (+0.09%) ⬆️
computing-unit-managing-service 1.65% <ø> (ø)
config-service 56.71% <ø> (+0.65%) ⬆️
file-service 38.21% <ø> (-0.11%) ⬇️
frontend 46.97% <ø> (+0.50%) ⬆️
pyamber 90.72% <ø> (+0.02%) ⬆️
python 90.83% <ø> (ø) Carriedforward from f6c4da0
workflow-compiling-service 58.69% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The bench job's sbt compile transitively reaches `common/auth` which
imports JOOQ-generated classes from `org.apache.texera.dao.jooq.generated.*`.
JOOQ codegen at sbt compile time requires a live Postgres connection to
introspect schema; without it the auth module's `User` / `UserRoleEnum`
symbols fail to resolve and the whole compile aborts. The bench itself
doesn't touch the DB at runtime — this is purely a build dependency.

Mirrors the same `services.postgres` block and `Create Databases` step
that amber-integration in build.yml uses (minus the iceberg / lakefs /
lakekeeper SQL since the bench never reads from those schemas).

Local builds didn't surface this because they had cached JOOQ classes
from prior runs against a developer Postgres.
PR and post-merge runs now use a trimmed 3-config grid (`pr` mode: 3
batch sizes × single schema × single string len × 20 batches) targeting
~5 min in CI. The full 36-config grid (`full` mode: 4 × 3 × 3 × 200
batches) runs weekly on a scheduled trigger and on workflow_dispatch.

Trigger → mode → publish mapping:
  pull_request                        → pr   → no gh-pages push
  push to main                        → pr   → publishes baseline
  schedule (Sundays 08:00 UTC)        → full → publishes baseline
  workflow_dispatch                   → full → no publish

Bench-side: `BENCH_MODE` env var selects between two GridSpec cases.
`BENCH_NUM_BATCHES` still overrides numBatches if set (for local smoke).
Bench step itself ran fine on the prior CI; the Publish throughput /
latency steps failed with `fatal: couldn't find remote ref gh-pages`
because apache/texera has no gh-pages branch yet. The action attempts
to fetch gh-pages even when auto-push is false (it normally wants the
branch to compare against baseline).

Add `skip-fetch-gh-pages: true` to bypass the fetch — auto-push on
push-to-main / schedule still creates the branch on first write. Once
the dashboard is seeded, flip this to false to re-enable baseline
comparison + alert-threshold logic.

Add `continue-on-error: true` on each publish step as a safety net:
the bench data is already preserved in the uploaded artifact, so any
gh-pages-side surprise (permissions glitch, transient git failure)
shouldn't fail the bench job overall.
Three things:

1. Rename bench job's display name to `Bench` (was lowercase `bench`).

2. Bench job → Python 3.12 (was 3.11). Matches the local dev venv and
   the runtime Python texera_run_python_worker.py spawns; consistency
   removes a class of "works locally, drifts in CI" surprises.

3. PR-side comment with bench results. The Benchmarks workflow runs on
   `pull_request` events from forks, where GitHub forces GITHUB_TOKEN
   to read-only and refuses to inject any secret (AUTO_MERGE_TOKEN
   included — that restriction applies to ALL secrets, not just
   GITHUB_TOKEN). The fix is the ASF-approved `workflow_run` pattern:
   a separate workflow file that triggers when Benchmarks completes,
   runs in the base repo's trusted context, and has `pull-requests:
   write`.

   Bench-side: write the PR number to bench-results/pr-number.txt
   (workflow_run.pull_requests is empty for fork PRs, so we ferry the
   number via artifact); render a markdown summary table to the
   $GITHUB_STEP_SUMMARY for one-click visibility on the workflow page.

   Comment-side (benchmarks-pr-comment.yml): download the artifact,
   read + strict-validate (`^[0-9]+$`) the PR number, sanitize the CSV
   (cap at 32 KB, neutralize any triple-backtick sequence so a
   malicious fork can't escape the code fence and inject arbitrary
   markdown), then upsert a marker-tagged comment so subsequent runs
   update in place rather than spam.
The previous comment dumped raw CSV inside a `csv` code block, which
forced reviewers to mentally column-align 13 fields per row. Render
the actionable subset as a right-aligned markdown table (batch /
schema_w / str_len / n_batches / tuples-s / MB-s / p50 ms / p99 ms /
total ms), convert lat_*_us to milliseconds, drop redundant fields
(config_idx, total_tuples, total_bytes, lat_p95_us), and tuck the raw
sanitized CSV into a collapsed `<details>` for verifiability.

Per-cell sanitizer escapes pipes and strips newlines to defeat table
injection from the still-untrusted fork-PR-controlled CSV. Falls back
to the raw-CSV view if header parsing fails.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a bench-agnostic CI workflow for performance benchmarks and introduces the first suite: an end-to-end Arrow Flight ↔ PythonWorkflowWorker benchmark that emits CSV + GitHub Action Benchmark JSON outputs and can publish historical results to gh-pages and post summarized PR comments via a workflow_run listener.

Changes:

  • Add bin/run-benchmarks.sh as a single entry point for running all benchmark suites and writing artifacts to bench-results/.
  • Introduce ArrowFlightActorBench (Scala) to measure per-batch round-trip latency percentiles and throughput across a config grid, emitting CSV + JSON for github-action-benchmark.
  • Add two GitHub Actions workflows: one to run/publish benchmarks (benchmarks.yml) and one to upsert a marker-tagged PR comment with sanitized results (benchmarks-pr-comment.yml).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
bin/run-benchmarks.sh Adds a unified benchmark runner invoked by CI and standardizes artifact output under bench-results/.
amber/src/test/scala/.../ArrowFlightActorBench.scala Implements the Arrow Flight E2E benchmark and writes CSV/JSON outputs for CI consumption and dashboard publishing.
.github/workflows/benchmarks.yml Adds the main benchmark CI workflow with label-gated PR runs and publish-to-gh-pages behavior for main/schedule.
.github/workflows/benchmarks-pr-comment.yml Adds a workflow_run listener that downloads benchmark artifacts and upserts a sanitized PR comment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/benchmarks.yml Resolved
- benchmarks.yml: TRIGGER_LABELS used `python`; required-checks.yml's
  LABEL_STACKS keys this stack as `pyamber` per labeler.yml, so PRs
  labeled `pyamber` were silently skipping the bench. Swap to the
  correct key.
- benchmarks-pr-comment.yml: switch listComments to paginate so the
  marker comment can still be located on PRs with >100 comments;
  prevents duplicate-comment-spam on long-running PRs.
- ArrowFlightActorBench.awaitOneDataFrameEcho: each receiveOne now uses
  the remaining time to the absolute deadline rather than the full
  timeout per loop iteration. A flood of ACK/ECM messages can no
  longer extend the overall wait beyond the caller's deadline.
- ArrowFlightActorBench scaladoc: replace stale `benchmark-results.csv`
  with the actual `bench-results/arrow-flight-e2e.{csv,*.json}` paths.

@aglinxinyuan aglinxinyuan left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change needs more discussion since it is fundamentally different from our regular test cases.

We can either:

  1. Have a discussion of design for how benchmark results should be shown to developers.
  2. Turn this into a regular test by having the benchmark enforce a threshold and return a pass/fail result, so it can guard against regressions like other tests.

Comment thread .github/workflows/benchmarks.yml Resolved
@Yicong-Huang

Copy link
Copy Markdown
Contributor Author

It is not a test case. This is a bench case. I hope to use it for informative purpose only, and do not block PR from merging. What do you think?

@aglinxinyuan

Copy link
Copy Markdown
Contributor

It is not a test case. This is a bench case. I hope to use it for informative purpose only, and do not block PR from merging. What do you think?

Sure. Whether to run it in CI or not is a minor issue. Please address the other comments as well.

…bench

Address review: the bench class has no pass/fail outcome, so placing it
under src/test/scala alongside ScalaTest specs conflates "performance
measurement" with "regression assertion". Mirrors how src/test/integration
is wired today: add src/bench/scala as an additional Test source dir so
scalafmt / scalafix still cover it and `sbt Test/runMain` keeps working,
just from a physically separate directory.

- amber/src/bench/scala/org/apache/texera/amber/bench/ArrowFlightActorBench.scala
  (was amber/src/test/scala/.../pythonworker/bench/ArrowFlightActorBench.scala)
- bin/run-benchmarks.sh: update main class FQN
- amber/build.sbt: declare the new bench source dir
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Jun 11, 2026
@Yicong-Huang
Yicong-Huang added this pull request to the merge queue Jun 11, 2026
Merged via the queue into apache:main with commit 8001e4c Jun 11, 2026
26 checks passed
@Yicong-Huang
Yicong-Huang deleted the bench/arrow-flight-e2e branch June 11, 2026 22:39
ELin2025 pushed a commit to ELin2025/texera that referenced this pull request Jun 16, 2026
…pache#5557)

### What changes were proposed in this PR?

A bench-agnostic CI lifecycle that future suites (e.g. JMH for
`ArrowUtils` micros) plug into by appending one line to
`bin/run-benchmarks.sh`, plus the first concrete suite: an end-to-end
Arrow Flight + `PythonWorkflowWorker` micro-bench.

**Lifecycle**

| Trigger | Mode | PR comment | Publish to gh-pages |
|---|---|---|---|
| `pull_request` (label-gated, mirrors `amber-integration`'s set) | `pr`
— 3 configs × 20 batches (~5 min) | ✓ | — |
| `push` to `main` | `pr` (post-merge fast signal) | — | ✓ |
| `schedule` Sundays 08:00 UTC | `full` — 36 configs × 200 batches
(~50-60 min) | — | ✓ |
| `workflow_dispatch` | `full` | — | — |

PR runs upload the bench as an artifact + render a markdown summary
table on the workflow page; the `workflow_run`-triggered `Benchmarks PR
Comment` listener (separate file because `pull_request` from forks gets
a read-only token and zero secret access) downloads the artifact,
sanitizes the CSV, and upserts a single marker-tagged PR comment.
Non-blocking — not part of `required-checks.yml`'s aggregator.

**First benchmark: Arrow Flight E2E (`ArrowFlightActorBench`)**

Spawns a real `PythonWorkflowWorker` actor (real Pekko mailbox + real
`texera_run_python_worker.py` subprocess + real Arrow Flight gRPC) wired
to an identity Python UDF, then times per-batch send→echo round-trip
across a sweep of `batch_size × schema_width × string_len`. Per-config
output: throughput (tuples/s, MB/s), latency p50/p95/p99, total ms. Each
config writes incrementally so a killed sweep still leaves usable
artifacts.

ASF: `benchmark-action/github-action-benchmark` is SHA-pinned to
`52576c92bccf6ac60c8223ec7eb2565637cae9ba` (v1.22.1) per the
apache-infrastructure-actions allow-list.

### Any related issues, documentation, discussions?

Closes apache#5556

### How was this PR tested?

End-to-end validated on a fork-internal PR —
[Yicong-Huang#17](Yicong-Huang#17)
ran the full `Benchmarks` workflow, the `workflow_run` listener fired,
and a marker-tagged comment landed and upserted across two push cycles
([rendered
example](Yicong-Huang#17 (comment))).
`workflow_run` only listens on the default branch, so the loop can't be
tested from a non-default branch — that's why the dry-run lived on a
fork; after merge, the same flow takes effect on `apache/texera:main`
automatically.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.7)
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
…pache#5557)

### What changes were proposed in this PR?

A bench-agnostic CI lifecycle that future suites (e.g. JMH for
`ArrowUtils` micros) plug into by appending one line to
`bin/run-benchmarks.sh`, plus the first concrete suite: an end-to-end
Arrow Flight + `PythonWorkflowWorker` micro-bench.

**Lifecycle**

| Trigger | Mode | PR comment | Publish to gh-pages |
|---|---|---|---|
| `pull_request` (label-gated, mirrors `amber-integration`'s set) | `pr`
— 3 configs × 20 batches (~5 min) | ✓ | — |
| `push` to `main` | `pr` (post-merge fast signal) | — | ✓ |
| `schedule` Sundays 08:00 UTC | `full` — 36 configs × 200 batches
(~50-60 min) | — | ✓ |
| `workflow_dispatch` | `full` | — | — |

PR runs upload the bench as an artifact + render a markdown summary
table on the workflow page; the `workflow_run`-triggered `Benchmarks PR
Comment` listener (separate file because `pull_request` from forks gets
a read-only token and zero secret access) downloads the artifact,
sanitizes the CSV, and upserts a single marker-tagged PR comment.
Non-blocking — not part of `required-checks.yml`'s aggregator.

**First benchmark: Arrow Flight E2E (`ArrowFlightActorBench`)**

Spawns a real `PythonWorkflowWorker` actor (real Pekko mailbox + real
`texera_run_python_worker.py` subprocess + real Arrow Flight gRPC) wired
to an identity Python UDF, then times per-batch send→echo round-trip
across a sweep of `batch_size × schema_width × string_len`. Per-config
output: throughput (tuples/s, MB/s), latency p50/p95/p99, total ms. Each
config writes incrementally so a killed sweep still leaves usable
artifacts.

ASF: `benchmark-action/github-action-benchmark` is SHA-pinned to
`52576c92bccf6ac60c8223ec7eb2565637cae9ba` (v1.22.1) per the
apache-infrastructure-actions allow-list.

### Any related issues, documentation, discussions?

Closes apache#5556

### How was this PR tested?

End-to-end validated on a fork-internal PR —
[Yicong-Huang#17](Yicong-Huang#17)
ran the full `Benchmarks` workflow, the `workflow_run` listener fired,
and a marker-tagged comment landed and upserted across two push cycles
([rendered
example](Yicong-Huang#17 (comment))).
`workflow_run` only listens on the default branch, so the loop can't be
tested from a non-default branch — that's why the dry-run lived on a
fork; after merge, the same flow takes effect on `apache/texera:main`
automatically.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.7)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 25, 2026
)

### What changes were proposed in this PR?

Remove unused imports, bindings, helpers and fields, and settings that
repeat a default or another entry, from the Amber Python runtime, the
Python test resources of the workflow compiler and operators, the `bin/`
licensing, local-dev and observability scripts, repository
configuration, and three GitHub workflows (**+102/-172 lines**). There
is no behavior change.

- **Amber Python runtime:** `StatisticsManager` uses `defaultdict`
instead of the deprecated `typing.DefaultDict`, and
`BroadcastPartitioner` builds its batch with `[]`.
`LargeBinaryOutputStream` raises and documents `OSError` (which
`IOError` aliases), wraps its best-effort cleanup delete in
`contextlib.suppress`, and drops the `pass` after `flush`'s docstring.
- **Operator verification test resources:** `py_op_driver.py` drops ten
`pytexera` imports and `RAW_TYPE_MAPPING` that it never reads. User code
runs in its own namespace seeded by `from pytexera import *`, so the
"used dynamically" note on those imports did not hold. `compare.py`
drops the uncalled `_string_columns` helper and two dict copies of
`double_kinds_a`/`double_kinds_e`, and `hf_parse_probe.py` drops unused
`io` and `re` imports. Quoted annotations, `open(..., "r")`,
`startswith` plus a slice, and a placeholder-free f-string take their
plain forms here and in `standalone_worker.py`, `py_compile_worker.py`
and `hf_binary_value_probe.py`.
- **`bin/` scripts:** the licensing tools use a tuple `startswith`, read
the one regex group they need instead of unpacking all four, print plain
strings where f-strings had no placeholders, return a `bool` expression
directly, drop annotation quotes under `from __future__ import
annotations`, use `removesuffix`, and name unused loop values `_`. Two
licensing tests drop `# noqa: E402` comments that suppress nothing under
Ruff, and `test_local_dev_tui.py` drops the never-passed `version`
parameter of `_seed_jvm_layout` together with the docstring sentence
about a jar it never wrote. `bin/observability/smoke_test.py` stops
returning an unread status from `_post`, builds the trace id from one
`uuid4().hex` (the first 32 hex digits of two concatenated ones were
always the first), and drops a `leaked = False` that both branches of
the following `try` overwrite.
- **Repository configuration:** `amber/pyproject.toml` drops
`line-length = 88` and `max-complexity = 10`, which are Ruff's defaults
(and `C901` is not selected). `.dockerignore` drops a root
`user-resources/` entry that its first rule, `**/user-resources/`,
already covers. `bin/fix-format.sh` drops the `""` case that
`TARGET="${1:-all}"` makes unreachable, and `bin/frontend-proto-gen.sh`
drops a `--proto_path` that repeats its `-I`.
`bin/k8s/templates/aws/.gitkeep` goes, since the folder holds
`s3-credentials-secret.yaml`. `bin/y-websocket-server/package.json`
drops npm-init's `main` and placeholder `test` script (the image runs
`npx y-websocket`), and a `bin/observability/docker-compose.yml` comment
stops pointing at a `start_app.sh` that the repository does not have.
- **GitHub workflows:** `comment-commands.yml` drops `github.event_name
== 'issue_comment' && github.event.action == 'created'` from three job
conditions, because the workflow only runs on `issue_comment:
[created]`. `pr-assignment.yml` drops a `|| ''` that follows a `typeof
... === 'string'` guard. `benchmarks-pr-comment.yml` stops storing
per-benchmark commit and date, a sample count and delta labels that
nothing reads, takes each row's status from the deltas it already
computed instead of a second `deltaInfo` pass, reuses each metric's
7-day delta, and builds the PR-only CSV table only when there is no
comparison to show.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Amber Python runtime: apache#1891 (2023-05-01), apache#3262
(2025-02-18), apache#4100 (2025-12-15), apache#4707 (2026-05-03), apache#5249
(2026-06-06), apache#8260 (2026-11-18); test resources: apache#7207 (2026-08-14),
apache#8617 (2026-10-15), apache#9306 (2026-11-10), apache#8357 (2026-11-17), apache#8358
(2026-11-18), apache#8359 (2026-11-19); `bin/` scripts: apache#4387 (2026-04-29),
apache#4668 (2026-05-02), apache#4693 (2026-05-02), apache#4711 (2026-05-03), apache#5057
(2026-05-15), apache#5417 (2026-06-10), apache#5961 (2026-06-28), apache#5377
(2026-10-28); configuration: apache#3019 (2024-11-20), apache#3335 (2025-03-23),
apache#3441 (2025-05-19), apache#3890 (2025-10-14), apache#4005 (2025-10-29), apache#4105
(2025-12-05), apache#5757 (2026-06-24); workflows: apache#4885 (2026-05-03), apache#4986
(2026-05-08), apache#5148 (2026-05-22), apache#5557 (2026-06-11), apache#5639 (2026-06-12)
|
| Usage removed by | `issue_comment` checks: apache#4899 (2026-05-04, `ci:
drop the triage label, use is:open no:assignee filter`) moved `/take`
out of `issue-triage.yml`, which also ran on `issues` events, into a
workflow that only runs on created comments, and apache#4986 and apache#5148 copied
the checks into two new jobs; `aws/.gitkeep`: apache#5932 (2026-07-01,
`feat(k8s): make app-tier object storage configurable via storage.s3`)
added the folder's first template; PR-only CSV table: apache#5639 (2026-06-12,
`ci: compare benchmark PRs with main`) shows it only when there is no
comparison; everything else: unused or redundant since introduction |

As of 2026-11-23, the unread test-resource code is under a week old, the
`.gitkeep` placeholder and the unread benchmark fields have been
redundant for about 5 months, the `issue_comment` checks for over 6
months, and the duplicate `.dockerignore` entry and `--proto_path` for
20 and 24 months.

### Any related issues, documentation, discussions?

Closes apache#9676.

### How was this PR tested?

Ran on `525f8ce3fb` and on `main` at `89a492f97e` (Windows 11, Python
3.12 with CI's pinned `ruff` 0.14.7, `pytest` 9.0.3 and `textual` 8.2.8,
JDK 17):

```bash
cd amber
ruff check src/main/python src/test/python
ruff format --check src/main/python src/test/python
pytest -m "not integration"
cd ..
ruff check $(git diff --name-only origin/main -- '*.py' ':!amber/')
python -m pytest bin/ -v --tb=short
sbt "WorkflowCompilingService/testOnly org.apache.texera.amber.translator.verify.ComparatorSpec org.apache.texera.amber.translator.verify.HarnessSpec org.apache.texera.amber.translator.verify.PyOpExecHarnessSpec org.apache.texera.amber.translator.verify.VisualizationJsonComparatorSpec"
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.huggingFace.codegen.HuggingFaceBinaryValueBehaviorSpec org.apache.texera.amber.operator.huggingFace.codegen.HuggingFaceParseBehaviorSpec org.apache.texera.amber.util.PythonCodeRawInvalidTextSpec"
```

- Ruff: passed on `amber/` (218 files already formatted) and on the 14
changed Python files outside `amber/`.
- `pytest -m "not integration"` in `amber/` (JUnit XML): each of the
1,524 tests has the same outcome as on `main`: 1,496 passed, 10 skipped,
and the same 18 platform-dependent tests (Iceberg catalog on PostgreSQL
and `s3fs`, time zones, object reprs) fail on this Windows machine on
both.
- `python -m pytest bin/` (JUnit XML): each of the 196 tests has the
same outcome as on `main`: 186 passed, and nine `bin/mounter` tests plus
`test_stamp_dir_for_matches_shell_sha1`, which assume POSIX paths and
shells, fail on Windows on both.
- sbt (JUnit XML, `UDF_PYTHON_PATH` set to Python 3.12 because Windows
has no `python3`): these seven suites load the edited test resources.
`WorkflowCompilingService` passed 52 of 52 in 4 suites and
`WorkflowOperator` 11 of 11 in 3 suites, with 0 canceled, the same as on
`main`.
- Licensing scripts: `concat_license_binary.py` writes byte-identical
combined licenses for the Python and frontend images, and
`check_binary_deps.py jar` prints byte-identical reports and exit codes
for a synthetic lib folder with missing, extra and version-mismatched
jars, with and without `--ignore-transitive-version`.
- Workflows: the three edited workflows run only from the default branch
(`issue_comment`, `pull_request_target` and `workflow_run`), so this
PR's CI cannot run them. Each edited `github-script` body ran before and
after under Node with recording stubs for `github`, `core`, `fs` and
`fetch`, over 496 fixtures (missing or malformed CSV and baseline data,
failed API calls, body edits with and without closing references). Every
API call, comment body and log line is identical, and a one-line change
to each script does show up in its traces. The `comment-commands.yml`
conditions differ from `main` only by the two removed checks.
- `bash -n` passes on `bin/fix-format.sh` and
`bin/frontend-proto-gen.sh`, and the edited YAML, TOML and JSON files
parse.
- After review, `f84888ca6c` changes only three docstrings in
`large_binary_output_stream.py` and inlines one local in
`py_op_driver.py`. On it, Ruff passes as above, each of the 1,524
`amber` tests again has the same outcome as on `main`, the four
`WorkflowCompilingService` suites pass 52 of 52, and `_jsonify` returns
the same strings as on `525f8ce3fb` for seven `BINARY` inputs, with and
without the pickle marker.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 25, 2026
### What changes were proposed in this PR?

Remove unused code from the Scala sources and tests of the Amber engine
and web server, `workflow-core`, `workflow-operator`, `observability`
and the notebook-migration service, and narrow the database reads of the
account, notification, dashboard-search, Hub and Jupyter-registration
lookups to the columns and rows they use (**+285/-316 lines**).
Production behavior does not change. Two CSV tests that are named for
multi-line data now read the multi-line file.

**Unused code**

- **Unused bindings:** pattern, `catch` and callback bindings that
nothing reads become `_` in `ClusterListener`, `DeadLetterMonitorActor`,
`Utils`, `SequentialRecordStorage`, the argument parsers of
`ComputingUnitMaster` and `ComputingUnitWorker`, `WebsocketInput`,
`WorkflowWebsocketResource`, `AiAssistantManager`, `ExecFactory`,
`VirtualIdentityUtils`, `URLFetchUtil` and `HtmlVizOpDesc`. The two
argument parsers end in `case _`, since `case Nil` already takes the
empty list.
- **`S3StorageClient.uploadObject`:**
- `readChunk` uses a plain `while` loop instead of assigning inside the
loop condition.
- The parts upload in a `while` loop that adds each `CompletedPart` to
the Java list the SDK takes. Before, an `Iterator` of `(partNumber,
size)` tuples became a Scala `List` and then went back through
`.asJava`.
- Each part is copied out of the reused buffer once and streamed from
that copy. `buffer.take` and `RequestBody.fromBytes`, which calls
`Arrays.copyOf` itself, copied it twice. The content provider gives each
SDK attempt a fresh stream over the same bytes.
- Part numbers, upload order, part sizes, the `application/octet-stream`
content type and the read of the next chunk after each upload are
unchanged.
- **`SQLSourceOpExec.fetchBatchByBoundary`:** returns the result of the
type `match` as a `val` instead of overwriting a `var` that starts as
`null`.
- **Worker statistics:** `StatisticsManager.getStatistics` drops the
executor parameter it has not read since its sink-operator check went
away. `DataProcessor` and both statistics specs stop passing an executor
to it.
- **Telemetry:** `WorkflowMetricsRecorder` drops a `LazyLogging` it
never logs with, and `WorkflowMetrics` drops the `Cancelled` outcome and
the `Unknown` workflow kind that nothing records.
- **Scan sources:** `SkippedRowReporter` drops its uncalled `count`, and
`ArrowSourceOpExec` drops a batch counter it only increments.
- **Arrow Flight benchmark:** sorts each run's latencies once, instead
of once per percentile.
- **Test helpers:**
- `DPThreadSpec.awaitCond` drops its unused default budget, and the
spec's callbacks name their unused argument `_`.
- `ExternalAuthProvisionerSpec`'s `seedUser` and `seedUserWithEmail`
drop the `avatar` parameter that no test passes.
- `DictionaryMatcherOpExecSpec.withExecutor`, `HashJoinOpSpec.tuple` and
the tuple builders of `IntervalOpExecSpec` drop defaults that every
caller overrides.
- `PythonWorkerPool` starts its stdout and stderr reader threads without
keeping the references it never reads.
- **Test fixtures:**
- `TestOperators` drops `asterixDBSourceOpDesc`, a descriptor for the
AsterixDB server at `ipubmed4.ics.uci.edu` that only its own
`TestOperatorsSpec` case still built. It also drops the `multiLine`
parameter that `getCsvScanOpDesc` never read.
- `headerlessSmallMultiLineDataCsvScanOpDesc` reads
`country_sales_headerless_small_multi_line.csv` again, so
`DataProcessingSpec`'s headerless multi-line case runs on multi-line
data.
- The matching `CSVScanSourceOpDescSpec` case now reads that file too,
and checks the scanned rows: 100 rows of 14 fields, a quoted value with
commas, and two values with line breaks.

**Database reads**

- **Account, login and notification queries:**
- `AuthResource`'s login query selects the user columns and the password
hash, instead of every column of the joined `auth_provider` and `user`
rows. `ExternalAuthProvisioner`'s lookup selects only the user columns.
- The admin-bootstrap and add-email checks in `AuthResource`, the
duplicate-email check in `AdminUserResource` and
`UserResource.isJoiningReasonRequired` read one column, or use
`selectOne`, instead of a full user row.
- `GmailResource` reads only the requester's name and the admins' email
addresses, compiles its email regex once, and passes the subject and the
domain-suffixed content to `createMimeMessage` instead of copying the
`EmailMessage`.
- **Dashboard search:**
- `searchAllResources` builds its results in one pass over the first
`count` rows. Before, it built a list of entries, filtered out the
omitted ones, and scanned the list again for `hasMismatch`.
- `getOrderFields` drops the `case None` branch and the private
`getColumnField` with its `case _ => null`, which its regex makes
unreachable, and compiles the regex once.
- `WorkflowSearchQueryBuilder` builds its access condition as a `val`
instead of overwriting a `DSL.trueCondition()` initializer.
`VersionedResourceSearchQueryBuilder` drops a `getGroupByFields`
override that returns the base default.
- `VersionedResourceTables.hydrate` stops pairing each entry with a
resource ID that every caller discarded, drops `idOf`, and reads the
owner email from the record without building a `User` POJO.
- **Hub (`HubResource`):**
- The versioned-resource lookup selects the resource columns, the owner
email and the privilege that `hydrate` reads, instead of every joined
column. `VersionedResourceTables.hydrationFields` defines that list next
to `hydrate`, because a query that left a column out would get a `null`
email or privilege without an error.
- `isLikedHelper` collects the liked IDs with `fetchSet`. Like/unlike
and clone check for an existing row with `fetchExists` instead of
fetching it, and like/unlike no longer goes through the batch helper.
- `getCounts` reuses each entity type's request group, and drops the
zero entries it added for missing view counts, since the lookup already
defaults to 0.
- **Notebook migration:** `NotebookMigrationResource` stops selecting
the notebook ID it never reads, and drops `JSONB` casts that its typed
fields make redundant. `JupyterEndpointResolver` selects the two
registration URLs instead of a full `user_jupyter` row, and
`JupyterProvisioner` derives a healthy registration's token once instead
of twice.

**Tests for rewritten paths no test reached**

- `DatasetSearchQueryBuilderSpec` runs a dataset search over a dataset
that lakeFS rejects, and expects it left out with `hasMismatch` set.
- `HubResourceSpec` fetches such a dataset by ID and expects it dropped.
- `AdminUserResourceSpec` moves a user to an address no other account
uses.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Amber engine and web server: apache#945 (2021-01-05), apache#1101
(2021-05-03), apache#1387 (2022-02-10), apache#1381 (2022-05-13), apache#1671
(2022-11-07), apache#1677 (2022-11-07), apache#2060 (2023-07-14), apache#2529
(2024-03-29), apache#2570 (2024-04-07), apache#2808 (2024-09-02); account and
notification queries: apache#3080 (2024-11-19), apache#3393 (2025-04-29), apache#3440
(2025-06-08), apache#4185 (2026-02-16), apache#7055 (2026-08-10), apache#7758
(2026-08-21), apache#7639 (2026-08-30), apache#7978 (2026-08-31); dashboard search
and Hub: apache#2358 (2024-02-23), apache#2838 (2024-09-25), apache#3252 (2025-02-09),
apache#3446 (2025-05-26), apache#3442 (2025-06-28), apache#3519 (2025-07-09), apache#7928
(2026-08-26), apache#7930 (2026-09-01), apache#8890 (2026-10-27); `workflow-core`:
apache#2271 (2024-01-18), apache#3183 (2024-12-31), apache#4067 (2025-11-25);
`workflow-operator`: apache#1013 (2021-02-11), apache#1866 (2023-03-23), apache#3139
(2024-12-06), apache#3186 (2024-12-31), apache#6947 (2026-10-02); `observability`:
apache#5376 (2026-10-27); notebook migration: apache#5258 (2026-06-24), apache#8032
(2026-09-03); tests and benchmark: apache#1044 (2021-02-25), apache#1083
(2021-04-25), apache#1227 (2021-07-25), apache#2254 (2023-12-13), apache#2302
(2024-02-05), apache#3425 (2025-05-26), apache#4836 (2026-05-03), apache#5439
(2026-06-06), apache#5557 (2026-06-11), apache#6077 (2026-07-03), apache#7116
(2026-07-31), apache#7207 (2026-08-14), apache#7870 (2026-08-23), apache#7875
(2026-08-31), apache#9534 (2026-11-19), apache#9518 (2026-11-21) |
| Usage removed by | AsterixDB fixture: apache#1118 (2021-05-11, `Disable
dependent tests with AsterixDB`) commented out its only test use, which
apache#3294 (2025-03-04) deleted; multi-line fixture: apache#3111 (2024-11-26,
`Update amber to depend on sub projects`) pointed
`headerlessSmallMultiLineDataCsvScanOpDesc` at the single-line file;
`awaitCond`'s default budget: apache#9534 (2026-11-19, `test(amber): share
engine and service test fixtures`) routed its last callers through a
helper that always passes one; `getStatistics`' executor parameter:
apache#3312 (2025-03-12, `Remove Sink Operator in the Backend`) dropped its
only read, the sink-operator check; everything else: unused or redundant
since introduction |

As of 2026-11-24, the AsterixDB fixture has had no test use for over 5
years, and the headerless multi-line CSV fixture has read single-line
data for about 12 months.

### Any related issues, documentation, discussions?

Closes apache#9680.

### How was this PR tested?

The first commit (`cb95cd29b7`) ran on its base, `main` at `de3f021dec`.
The second commit ran on this branch before it (`2e980903c8`, after
merging `main`) and after it, the third likewise on `dee7711a88`, the
fourth on `3870a2da97`, and the fifth on `4c244837bf`. Both used Windows
11, JDK 17, `UDF_PYTHON_PATH` set to Python 3.12, and Docker for the
RustFS container that `S3StorageClientSpec` starts. The e2e case uses
the Hadoop Iceberg catalog because no REST catalog runs on this machine:

```bash
WUNUSED='set ThisBuild / scalacOptions += "-Wunused:patvars,params,privates"'
sbt "$WUNUSED" "WorkflowCore/testOnly org.apache.texera.amber.core.executor.CoreExecutorReflectionSpec org.apache.texera.amber.util.VirtualIdentityUtilsSpec org.apache.texera.service.util.S3StorageClientSpec"
sbt "$WUNUSED" "WorkflowOperator/testOnly org.apache.texera.amber.operator.TestOperatorsSpec org.apache.texera.amber.operator.dictionary.DictionaryMatcherOpExecSpec org.apache.texera.amber.operator.hashJoin.HashJoinOpSpec org.apache.texera.amber.operator.intervalJoin.IntervalOpExecSpec org.apache.texera.amber.operator.source.fetcher.URLFetchUtilSpec org.apache.texera.amber.operator.source.fetcher.URLFetcherOpExecSpec org.apache.texera.amber.operator.source.scan.csv.CSVScanSourceOpDescSpec org.apache.texera.amber.operator.source.scan.csv.CSVScanSourceOpExecSpec org.apache.texera.amber.operator.source.sql.* org.apache.texera.amber.operator.visualization.htmlviz.HtmlVizOpDescSpec org.apache.texera.amber.util.python.PythonWorkerPoolSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.clustering.ClusterListenerSpec org.apache.texera.amber.engine.architecture.messaginglayer.DeadLetterMonitorActorSpec org.apache.texera.amber.engine.architecture.worker.DPThreadSpec org.apache.texera.amber.engine.common.UtilsSpec org.apache.texera.amber.engine.common.storage.SequentialRecordStorageSpec org.apache.texera.web.ComputingUnitMasterSpec org.apache.texera.web.ComputingUnitWorkerSpec org.apache.texera.web.WebsocketInputSpec org.apache.texera.web.resource.WorkflowWebsocketResourceSpec org.apache.texera.web.resource.aiassistant.AiAssistantManagerSpec org.apache.texera.web.resource.auth.ExternalAuthProvisionerSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.TexeraWebApplicationSpec org.apache.texera.web.resource.GmailResourceSpec org.apache.texera.web.resource.auth.AuthResourceSpec org.apache.texera.web.resource.auth.ExternalAuthProvisionerSpec org.apache.texera.web.resource.auth.OrcidAuthResourceSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.ModelSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.UnifiedResourceSchemaSpec org.apache.texera.web.resource.dashboard.VersionedResourceTablesSpec org.apache.texera.web.resource.dashboard.WorkflowSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.admin.user.AdminUserResourceSpec org.apache.texera.web.resource.dashboard.file.DatasetResourceSpec org.apache.texera.web.resource.dashboard.file.WorkflowResourceSpec org.apache.texera.web.resource.dashboard.hub.EntityTablesSpec org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec org.apache.texera.web.resource.dashboard.user.UserResourceSpec org.apache.texera.web.resource.dashboard.user.workflow.WorkflowPublishSpec org.apache.texera.web.service.WorkflowEmailNotifierSpec"
STORAGE_ICEBERG_CATALOG_TYPE=hadoop sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.e2e.DataProcessingSpec -- -z headerlessMultiLineDataCsv"
sbt "$WUNUSED" Observability/test NotebookMigrationService/test "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.scan.*"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.coordinator.promisehandlers.ConsoleMessageHandlerSpec org.apache.texera.amber.engine.architecture.messaginglayer.WorkerTimerServiceSpec org.apache.texera.amber.engine.architecture.worker.DPThreadSpec org.apache.texera.amber.engine.architecture.worker.DataProcessorRPCHandlerInitializerSpec org.apache.texera.amber.engine.architecture.worker.DataProcessorSpec org.apache.texera.amber.engine.architecture.worker.WorkerSpec org.apache.texera.amber.engine.architecture.worker.WorkflowWorkerSpec org.apache.texera.amber.engine.architecture.worker.managers.StatisticsManagerSpec org.apache.texera.amber.engine.architecture.worker.managers.WorkerManagersSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.EndChannelHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.EndHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.FinalizeCheckpointHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.StartChannelHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.StartHandlerSpec org.apache.texera.amber.engine.common.UtilsSpec org.apache.texera.amber.engine.faulttolerance.CheckpointSpec org.apache.texera.web.observability.WorkflowMetricsRecorderSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.admin.user.AdminUserResourceSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec org.apache.texera.web.ComputingUnitMasterSpec org.apache.texera.web.ComputingUnitWorkerSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.ModelSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.VersionedResourceTablesSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.hub.EntityTablesSpec org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec"
sbt WorkflowCore/scalafmtCheckAll WorkflowOperator/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll Observability/scalafmtCheckAll NotebookMigrationService/scalafmtCheckAll "WorkflowCore/scalafixAll --check" "WorkflowOperator/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check" "Observability/scalafixAll --check" "NotebookMigrationService/scalafixAll --check"
```

- JUnit XML, compared per test:
- First commit: the first three test commands and the e2e case run 36
suites that load every file the commit changes, and
`SQLSourceOpExecSpec` calls `fetchBatchByBoundary` for each numeric type
through a mocked JDBC result. All 554 tests pass on `main` and all 553
with the commit. Each test has the same outcome as on `main`; the
missing one is the removed `asterixDBSourceOpDesc` case.
- Second commit: the fourth command runs the 20 suites that load the
account, notification, dashboard-search and Hub code, against an
embedded PostgreSQL. All 525 tests pass before and after the commit,
each with the same outcome.
- Third commit: the sixth and seventh test commands run every
`Observability`, `NotebookMigrationService` and scan-source suite, plus
the worker, statistics, checkpoint and telemetry suites that load the
changed classes. Before and after it, 581 of the 595 tests in these 48
suites pass, each with the same outcome. The other 14 fail on both sides
on this machine: 13 `ParquetScanSourceOpDescSpec` cases need Hadoop's
Windows binaries, and one `FileScanSourceOpDescSpec` case hits a Windows
temp-file lock.
- Fourth commit: the eighth test command runs the six suites it touches.
All 179 tests pass, the three new ones included.
- Fifth commit: the ninth test command runs the seven suites that load
`VersionedResourceTables` or the Hub query. All 182 tests pass.
- On the second commit's head, all 55 suites of the first two rounds
pass, the e2e case included: 1,059 tests.
- `S3StorageClientSpec` runs its 34 cases against RustFS 1.0.0 in
Testcontainers on both sides. They include a 6 MiB upload (a 5 MiB part
and a 1 MiB tail) that downloads back byte for byte, an empty upload,
and the abort when the input stream fails after the first part.
- With the fixture pointed back at `country_sales_headerless_small.csv`,
the strengthened `CSVScanSourceOpDescSpec` case fails: row 8 reads
`Republic of the Congo` instead of `Republic,of,the,Congo`. The
`DataProcessingSpec` case runs the multi-line file through the engine
and gets the same 100 rows that the single-line file gives on `main`.
- scalafmt and scalafix pass on all five touched modules.
- With `-Wunused:patvars,params,privates`, the compiler reports 26
unused names in the files of the first commit on `main`. That commit
removes 24 of them. The other two are `config` and `cr`, which the
`@OnOpen` and `@OnClose` methods of `WorkflowWebsocketResource` need for
the WebSocket API's signatures; they are reported on both.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci changes related to CI dependencies Pull requests that update a dependency file engine infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add end-to-end Arrow Flight benchmark with CI dashboard integration

4 participants