Skip to content

feat(amber): report the owner's email in dataset search - #7875

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:fix/dataset-search-owner-email
Aug 31, 2026
Merged

aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:fix/dataset-search-owner-email

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Why it was never populated. Every LakeFS-backed resource hydrates its dashboard entry through VersionedResourceTables.hydrate, which reads the owner out of the joined USER row:

record.into(USER).into(classOf[User]).getEmail

joinWithAccessAndOwner writes that join for every versioned resource. But the select list comes entirely from each subclass's mappedResourceSchema, and UnifiedResourceSchema.apply defaults userEmail to DSL.inline("") — a slot DatasetSearchQueryBuilder never named. So hydrate reads the owner out of a record that has no owner in it.

Two steps turn the missing projection into a null:

schema slot  userEmail = DSL.inline("")        <- default, never overridden
                 |
SQL          '' as email                       <- USER is joined, never read
                 |
translateRecord  dedupes by ORIGINAL field, and jOOQ compares fields by
                 rendered SQL, so projectsOfWorkflow / userName / userEmail /
                 projectColor -- all DSL.inline("") -- collapse to ONE entry
                 keyed on the first of them
                 |
record       no `email` column at all  ->  record.into(USER) = empty User
                 |
entry        DashboardDataset.ownerEmail = null      (not "")

Change. Name the slot — in the base class, so every versioned resource gets it (see below). hydrate is untouched.

Before → after:

before after
projection '' as email texera_db.user.email as email
DashboardDataset.ownerEmail null, every row the dataset owner's address
owner leftJoin(USER) joined, selected from, never read read

WorkflowSearchQueryBuilder is the sibling that shows the step that was missed: it opts into the USER column it reads (userName = USER.NAME), and VersionedResourceSearchQueryBuilder already filters on USER.EMAIL for the owners query param — the email was reachable through the join all along, only the projection was absent. HubResource and file-service's /dataset/list both populate the same field correctly; dataset search was the one producer that did not.

Scope of the impact, stated precisely because it is narrower than it looks: DashboardEntry.ownerEmail (dashboard-entry.ts:132) receives the null, and no frontend code reads that field for datasets today, so no screen was visibly wrong. It was a trap rather than a broken page — dataset-selection-modal.component.ts:127 builds the storage logical path /${ResourceType.Dataset}/${ownerEmail}/${name}/${version} out of a DashboardDataset, and only escapes /dataset/null/... because it lists via file-service.

The slot lives in the base class, per @mengw15's review. hydrate is final on VersionedResourceTables and reads USER.EMAIL for every versioned resource, so leaving the projection to each subclass meant the next resource type would inherit the same trap. VersionedResourceSearchQueryBuilder now builds the whole UnifiedResourceSchema as a final lazy val a subclass cannot replace:

final override protected lazy val mappedResourceSchema: UnifiedResourceSchema =
  UnifiedResourceSchema(
    resourceType = DSL.inline(tables.resourceType),
    name = tables.nameColumn,
    ...
    userEmail = USER.EMAIL,
    repositoryName = repositoryNameColumn,
    ...
  )

Eight of the twelve fields come off the tables descriptor, userEmail is fixed here, and a subclass supplies only the three columns the descriptor does not name:

object DatasetSearchQueryBuilder
    extends VersionedResourceSearchQueryBuilder(VersionedResourceTables.DatasetTables) {
  override protected val repositoryNameColumn: Field[String] = DATASET.REPOSITORY_NAME
  override protected val isDownloadableColumn: Field[java.lang.Boolean] = DATASET.IS_DOWNLOADABLE
  override protected val coverImageColumn: Field[String] = DATASET.COVER_IMAGE
}

A new versioned resource now gets the owner email whether or not its author thinks about it. It also removes the duplication where the descriptor and the projection each spelled out DATASET.NAME / DATASET.DESCRIPTION / DATASET.DID, so the FROM clause and the select list can no longer disagree about which column they mean.

Two things worth a reviewer's eye:

  • lazy is load-bearing, not decoration. The abstract projection members are subclass vals, so a plain val here reads them before they are initialised. Verified: it dies with NullPointerException: Cannot invoke "org.jooq.Field.as(String)" because "repositoryName" is null.
  • The rendered projection is otherwise unchanged. Every pre-existing per-alias assertion in the projection test passes untouched; only the email column is added. That is what confirms tables.nameColumn and friends are the same fields the subclass used to name by hand.

Any related issues, documentation, discussions?

Closes #7874

How was this PR tested?

DatasetSearchQueryBuilderSpec goes from 21 tests to 24, reusing the fixture and lakeFS loopback stub #7855 built.

test what it pins
carry the owner's email address the value on the entry — the assertion that kills the mutant below
take the email from the dataset's owner, not from the caller fetched as otherUid, who reaches the dataset only because it is public, so a lookup that echoed the signed-in caller back would fail
project every dataset column under the alias its schema slot names (extended) user.email as email in the SELECT. Now that the slot is the base class's, this guards every versioned resource: dropping it from VersionedResourceSearchQueryBuilder fails 3 tests here
stay union-compatible with the workflow and project branches new — see below

The mutation #7855 recorded as surviving now dies. Replacing the record.into(USER).into(classOf[User]) in hydrate with a fresh User:

before this PR after
new User mutant survives the whole suite (equivalent mutant, given the defect) succeeded 22, failed 2 — both owner-email tests

Verified in order, one sbt JVM each, all after merging main:

run result
with the change succeeded 24, failed 0, canceled 0
new User mutant in hydrate succeeded 22, failed 2, canceled 0
userEmail slot dropped from the base class succeeded 21, failed 3, canceled 0
base schema as a plain val instead of lazy val NullPointerException on repositoryName — why the lazy is there
the 7 dashboard suites (adds UnifiedResourceSchemaSpec, WorkflowSearchQueryBuilderSpec, ProjectSearchQueryBuilderSpec) Suites: completed 7, Tests: succeeded 113, failed 0, canceled 0
scalafmtCheckAll + Test/scalafixAll --check clean
sbt "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec"

Two notes for a reviewer:

What the union test is and is not for. @mengw15 is right that the hazard is not new: userName already has exactly this shape — only the workflow branch projects a real column, dataset and project both project DSL.inline("") — and that union runs in production today, so a varchar-vs-'' mix in one slot is not something this PR introduces. I have corrected the test's comment and dropped the overstated claim that was in this description. The test is still worth keeping: DashboardResource.searchAllResources stacks the three builders with unionAll for the dashboard's default view, nothing else in the suite executes that union, and the contract is invisible from inside a single builder.

canceled is the failure mode to watch, and it moved. The stub binds the configured port (localhost:8000) rather than an ephemeral one, because LakeFSStorageClient.apiClient is a lazy val capturing StorageConfig.lakefsEndpoint once per JVM and amber runs every suite in one unforked JVM. If something else holds that port — a local bin/local-dev.sh up — the stub-dependent tests cancel, and that count goes from 4 to 6 with the owner-email pair added. A cancel is quiet: sbt prints All tests passed at exit 0. Measured on the merged suite, with the port held and size mutated to 0L in hydrate, the run reports succeeded 18, failed 0, canceled 6 and still exits green — so the owner-email pair is disarmed alongside the rest of the toEntry half. The class comment carries these numbers and I re-measured them after the merge. CI has no lakeFS in this job, so it is deterministic there.

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

Generated-by: Claude Code (claude-opus-5)

Copilot AI lite review requested due to automatic review settings August 23, 2026 05:34

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 23, 2026
@github-actions
github-actions Bot requested a review from xuang7 August 23, 2026 05:34
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
✅ release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@github-actions github-actions Bot added the fix label Aug 23, 2026
@github-actions

github-actions Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @tanishqgandhi1908
    You can notify them by mentioning @tanishqgandhi1908 in a comment.

@github-actions

github-actions Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 12 worse · ⚪ 1 noise (<±5%) · 0 without baseline

Compared against main 50321e4 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 431 0.263 22,332/27,578/27,578 us 🔴 +15.5% / 🔴 +77.3%
🔴 bs=100 sw=10 sl=64 904 0.552 106,312/152,367/152,367 us 🔴 +13.9% / 🔴 +42.1%
🔴 bs=1000 sw=10 sl=64 1,047 0.639 943,518/1,105,820/1,105,820 us 🔴 +8.1% / 🔴 +8.1%
Baseline details

Latest main 50321e4 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 431 tuples/sec 476 tuples/sec 787.98 tuples/sec -9.5% -45.3%
bs=10 sw=10 sl=64 MB/s 0.263 MB/s 0.291 MB/s 0.481 MB/s -9.6% -45.3%
bs=10 sw=10 sl=64 p50 22,332 us 19,334 us 12,593 us +15.5% +77.3%
bs=10 sw=10 sl=64 p95 27,578 us 30,926 us 15,579 us -10.8% +77.0%
bs=10 sw=10 sl=64 p99 27,578 us 30,926 us 18,786 us -10.8% +46.8%
bs=100 sw=10 sl=64 throughput 904 tuples/sec 970 tuples/sec 1,008 tuples/sec -6.8% -10.3%
bs=100 sw=10 sl=64 MB/s 0.552 MB/s 0.592 MB/s 0.615 MB/s -6.8% -10.3%
bs=100 sw=10 sl=64 p50 106,312 us 99,933 us 100,701 us +6.4% +5.6%
bs=100 sw=10 sl=64 p95 152,367 us 133,819 us 107,244 us +13.9% +42.1%
bs=100 sw=10 sl=64 p99 152,367 us 133,819 us 116,122 us +13.9% +31.2%
bs=1000 sw=10 sl=64 throughput 1,047 tuples/sec 1,103 tuples/sec 1,042 tuples/sec -5.1% +0.5%
bs=1000 sw=10 sl=64 MB/s 0.639 MB/s 0.673 MB/s 0.636 MB/s -5.1% +0.5%
bs=1000 sw=10 sl=64 p50 943,518 us 906,641 us 981,959 us +4.1% -3.9%
bs=1000 sw=10 sl=64 p95 1,105,820 us 1,022,566 us 1,023,080 us +8.1% +8.1%
bs=1000 sw=10 sl=64 p99 1,105,820 us 1,022,566 us 1,051,697 us +8.1% +5.1%
Raw 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,464.41,200,128000,431,0.263,22331.80,27577.99,27577.99
1,100,10,64,20,2213.07,2000,1280000,904,0.552,106311.85,152366.70,152366.70
2,1000,10,64,20,19102.08,20000,12800000,1047,0.639,943517.85,1105819.95,1105819.95

@aglinxinyuan aglinxinyuan added backend Anything related to backend services and removed fix release/v1.2 back porting to release/v1.2 engine labels Aug 23, 2026
@aglinxinyuan
aglinxinyuan requested review from mengw15 and removed request for xuang7 August 23, 2026 06:47
`DatasetSearchQueryBuilder` joins USER on the dataset's owner but never
projected a USER column: `UnifiedResourceSchema` defaults `userEmail` to
`DSL.inline("")` and the dataset schema left the slot alone, so the query
rendered `'' as email`. `translateRecord` then dedupes the four
`inline("")` defaults into one field, so the translated record carried no
`email` at all, `record.into(USER)` yielded an empty POJO, and
`DashboardDataset.ownerEmail` was null on every row — the owner email has
never actually been reported by dataset search.

Name the slot `userEmail = USER.EMAIL`, matching the workflow sibling,
which already opts into the USER column it reads.

The suite gains the owner-email pair that kills the
`record.into(USER).into(classOf[User])` -> `new User` mutant apache#7855
recorded as surviving, plus a projection assertion and the first test to
execute the three-way `unionAll` the dashboard's default view builds.
@aglinxinyuan
aglinxinyuan force-pushed the fix/dataset-search-owner-email branch from c1b76f5 to efeb472 Compare August 23, 2026 06:48
@aglinxinyuan aglinxinyuan changed the title fix(amber): dataset search reports a null owner email feat(amber): report the owner's email in dataset search Aug 23, 2026
@mengw15
mengw15 requested a balanced review from Copilot August 31, 2026 11:36

@mengw15 mengw15 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.

The fix is right and still needed — main's refactor moved the read into VersionedResourceTables.hydrate:91 but it still does record.into(USER)...getEmail, and DatasetSearchQueryBuilder still names no userEmail, so the null is unchanged.

It won't merge as-is, though, and the rebase is more than conflict markers: main turned DatasetSearchQueryBuilder into a 44-line subclass of a new VersionedResourceSearchQueryBuilder, renamed the schema slots around the one you add (did → versionedResourceId, isDatasetPublic → isVersionedResourcePublic, and so on), moved toEntryImpl into VersionedResourceTables.hydrate, and changed DatasetSearchQueryBuilderSpec itself — which this PR rewrites by 63 lines.

Two notes for the rebase:

  • The union argument is stronger than the description makes it. userName is already in exactly this shape — only the workflow branch projects a real varchar, dataset and project both project DSL.inline("") — and that union runs in production today, so a varchar-vs-'' mix in one slot isn't new. Worth keeping the test regardless.
  • After the refactor, hydrate reads a column the base class doesn't require a subclass to project. DatasetTables is the only entry today, but the next one picks up the same trap unless its builder remembers userEmail. Might be worth pinning in the base rather than per-subclass.

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

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

main refactored `DatasetSearchQueryBuilder` into a subclass of the new
`VersionedResourceSearchQueryBuilder`, renamed the schema slots around the
one this branch adds, and moved the owner-email read into
`VersionedResourceTables.hydrate`. The defect is unchanged: `hydrate` still
does `record.into(USER)...getEmail` and no builder names `userEmail`.

Conflicts, both keeping the intent of each side:

- DatasetSearchQueryBuilder: main's `versionedResourceId = DATASET.DID`
  (and the rest of the renamed slots) plus this branch's
  `userEmail = USER.EMAIL`, whose `USER` import main had dropped.
- DatasetSearchQueryBuilderSpec: main's resource-neutral alias assertions
  plus this branch's `user.email as email` assertion and the union test.

Comment references repointed from `toEntryImpl` to
`VersionedResourceTables.hydrate`, and the class comment's measured
port-held counts re-measured on the merged suite (`succeeded 18, failed 0,
canceled 6`; was 15/0/6 against the smaller pre-merge suite).

@mengw15 mengw15 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.

LGTM — re-checked after the rebase: the fix landed in the refactored schema, and the inherited getGroupByFields is still Seq.empty, so the added projection needs no group-by change.

…class

Per review: the owner-email slot belongs to `VersionedResourceSearchQueryBuilder`,
not to each subclass. `VersionedResourceTables.hydrate` is `final` and reads
`USER.EMAIL` for every versioned resource, but the projection was per-subclass and
`userEmail` defaults to `DSL.inline("")` — so omitting it cost nothing at compile
time and silently made `ownerEmail` null. `DatasetTables` is the only entry today;
the next one would have inherited the same trap.

The base now builds the whole `UnifiedResourceSchema` as a `final lazy val` a
subclass cannot replace, taking the eight shared fields off the `tables`
descriptor and `userEmail` from `USER.EMAIL`. `DatasetSearchQueryBuilder` keeps
only the three columns the descriptor does not name. This also removes the
duplication where the descriptor and the projection each spelled out
DATASET.NAME, DATASET.DESCRIPTION, DATASET.DID and so on, so the FROM clause and
the select list can no longer disagree about which column they mean.

`lazy` is load-bearing: with a plain `val` the base constructor reads the
subclass's not-yet-initialised `val`s and dies with
`NullPointerException: ... because "repositoryName" is null`. Verified both ways.

The rendered projection is unchanged apart from the added `email` column — the
existing per-alias assertions pass untouched. Dropping `userEmail` from the base
now fails 3 tests (was: unnoticed).
@aglinxinyuan
aglinxinyuan enabled auto-merge August 31, 2026 14:00
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.91%. Comparing base (50321e4) to head (7f75fbd).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ashboard/VersionedResourceSearchQueryBuilder.scala 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7875      +/-   ##
============================================
- Coverage     93.93%   93.91%   -0.02%     
- Complexity     4762     4763       +1     
============================================
  Files          1191     1185       -6     
  Lines         48308    47641     -667     
  Branches       5377     5297      -80     
============================================
- Hits          45380    44744     -636     
+ Misses         1494     1472      -22     
+ Partials       1434     1425       -9     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 70c2114
agent-service 99.32% <ø> (ø) Carriedforward from 70c2114
amber 90.01% <94.11%> (-0.02%) ⬇️
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 70c2114
config-service 86.86% <ø> (ø) Carriedforward from 70c2114
file-service 87.91% <ø> (ø) Carriedforward from 70c2114
frontend 96.46% <ø> (+0.04%) ⬆️ Carriedforward from 70c2114
notebook-migration-service 79.31% <ø> (ø) Carriedforward from 70c2114
pyamber 98.87% <ø> (ø) Carriedforward from 70c2114
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 70c2114

*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.

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 31, 2026
Merged via the queue into apache:main with commit 0298a3b Aug 31, 2026
25 checks passed
@aglinxinyuan
aglinxinyuan deleted the fix/dataset-search-owner-email branch August 31, 2026 15:35
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

backend Anything related to backend services engine fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataset search leaves the owner email null on every entry

5 participants