Skip to content

feat(storage): accept legacy unprefixed dataset paths for backward compatibility - #7622

Merged
aicam merged 26 commits into
apache:mainfrom
tanishqgandhi1908:feat/dataset-logical-path-prefix
Aug 13, 2026
Merged

aicam merged 26 commits into
apache:mainfrom
tanishqgandhi1908:feat/dataset-logical-path-prefix

Conversation

@tanishqgandhi1908

@tanishqgandhi1908 tanishqgandhi1908 commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

#6502 made the datasets resource-type prefix required on dataset logical paths. This PR makes the readers accept both forms again, so the prefix becomes required only once the ML-model work has landed and every stored path has been migrated.

prefixed (target): /datasets/<owner>/<name>/<version>/<file>
legacy (accepted): /<owner>/<name>/<version>/<file>

Motivation: sql/updates/36.sql rewrites the fileName and datasetVersionPath operator properties, but it cannot rewrite a path a user hardcoded inside a Python UDF (that lives in the operator's code property). Those paths worked before #6502 and started raising afterwards. Rewriting user source in a migration would be unsafe, so the readers tolerate the legacy form during the transition instead.

Disambiguation: a leading segment that names a known ResourceType commits to the prefixed form, so /datasets/<owner>/<name>/<version> (too few segments) is rejected rather than silently re-read as a legacy path with owner datasets.
Each tolerant branch carries a TODO(datasets-prefix) marker so the fallback can be removed in one pass.

Any related issues, documentation, discussions?

Follow-up to #6502 Part of the ML-model resource work tracked in #6495.

How was this PR tested?

Updated and added unit tests, all passing locally:

Also verified end-to-end against a local instance, using workflows whose stored paths had the prefix stripped:

  • CSV File Scan on /<owner>/reviews/v1/reviews.csv ran green and emitted rows, as did two further scan workflows.
  • A Python UDF calling DatasetFileDocument("/<owner>/iris/v2/Iris.csv") parsed the legacy path successfully

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

Generated-by: Claude Code (Claude Opus 4.8)

aicam and others added 26 commits July 1, 2026 13:57
… tests

Review fixes on apache#5911: use dataset owner email in retrieveLatestDatasetVersion,
replace brittle Option.get/.head with headOption, strip datasets prefix on
selection-modal reopen, clarify FileResolver docs; add FileResolver/DatasetFileNode
and frontend path-helper tests.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The datasets logical-path prefix strips four leading segments
(datasets/owner/dataset/version); update the cover-image test's input
path to include the prefix so the extracted relative path is the file
name, not an empty string.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Now that models are coming as a separate resource/table, the leading
resource-type segment is what selects the backing table, so an unprefixed
path can no longer be routed unambiguously. Make the "datasets" prefix
required instead of a tolerated fallback, and migrate existing data.

- FileResolver: a dataset path must start with the "datasets" segment;
  unprefixed paths are no longer treated as dataset paths.
- pytexera DatasetFileDocument: same rule, mirroring the backend.
- FileListerSourceOpExec: parse the now-prefixed datasetVersionPath
  (skip the "datasets" segment); extracted into a testable helper.
- Migration (sql/updates/29.sql): prepend "datasets/" to legacy paths
  stored in workflow.content and workflow_version.content, covering both
  the fileName (scan sources) and datasetVersionPath (file lister)
  operator properties. Only values whose first two segments match an
  existing (user.email, dataset.name) are rewritten, so local paths and
  URLs are left untouched; email format is irrelevant (owner may be a
  username without "@"). Uses create_missing=false and is idempotent.
- Example workflows: use datasets-prefixed paths.

Tests: FileResolverSpec and WorkflowExecutionsResourceSpec updated;
test_dataset_file_document.py updated; new FileListerSourceOpExecSpec.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…l-path-prefix

# Conflicts:
#	frontend/src/app/common/type/datasetVersionFileTree.spec.ts
…format python test

- dataset-selection-modal.component.spec.ts: expect the datasets-prefixed
  selectedPath in version (non-file) mode, matching the emitted path.
- test_dataset_file_document.py: apply ruff format (wrap an over-length line)
  so `ruff format --check` passes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The cover-image endpoints resolve a dataset path built as
{owner}/{name}/{coverImage}. With the prefix now required by FileResolver,
these must carry the datasets/ segment; add it in the set-cover,
get-cover redirect, and cover-url handlers so cover images resolve again.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…l-path-prefix

# Conflicts:
#	file-service/src/main/scala/org/apache/texera/service/type/dataset/DatasetFileNode.scala
#	file-service/src/test/scala/org/apache/texera/service/type/dataset/DatasetFileNodeSpec.scala
#	sql/changelog.xml
#	sql/updates/29.sql
…l-path-prefix

# Conflicts:
#	sql/changelog.xml
#	sql/updates/30.sql
…l-path-prefix

# Conflicts:
#	sql/changelog.xml
#	sql/updates/31.sql
…l-path-prefix

# Conflicts:
#	sql/changelog.xml
#	sql/updates/32.sql
@github-actions github-actions Bot added feature pyamber frontend Changes related to the frontend GUI labels Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

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

  • No candidates found from git blame history.

@tanishqgandhi1908

Copy link
Copy Markdown
Contributor Author

/request-review @aicam @mengw15

@github-actions
github-actions Bot requested review from aicam and mengw15 August 13, 2026 04:18
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main dd7d813 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 376 0.23 25,487/37,797/37,797 us 🔴 +16.0% / 🔴 +131.7%
⚪ bs=100 sw=10 sl=64 909 0.555 107,903/166,761/166,761 us ⚪ within ±5% / 🔴 +54.1%
⚪ bs=1000 sw=10 sl=64 1,104 0.674 900,601/1,008,480/1,008,480 us ⚪ within ±5% / 🟢 -9.6%
Baseline details

Latest main dd7d813 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 376 tuples/sec 428 tuples/sec 775.33 tuples/sec -12.1% -51.5%
bs=10 sw=10 sl=64 MB/s 0.23 MB/s 0.261 MB/s 0.473 MB/s -11.9% -51.4%
bs=10 sw=10 sl=64 p50 25,487 us 23,111 us 12,743 us +10.3% +100.0%
bs=10 sw=10 sl=64 p95 37,797 us 32,594 us 16,310 us +16.0% +131.7%
bs=10 sw=10 sl=64 p99 37,797 us 32,594 us 18,926 us +16.0% +99.7%
bs=100 sw=10 sl=64 throughput 909 tuples/sec 912 tuples/sec 1,001 tuples/sec -0.3% -9.2%
bs=100 sw=10 sl=64 MB/s 0.555 MB/s 0.557 MB/s 0.611 MB/s -0.4% -9.1%
bs=100 sw=10 sl=64 p50 107,903 us 105,743 us 101,399 us +2.0% +6.4%
bs=100 sw=10 sl=64 p95 166,761 us 161,215 us 108,206 us +3.4% +54.1%
bs=100 sw=10 sl=64 p99 166,761 us 161,215 us 118,195 us +3.4% +41.1%
bs=1000 sw=10 sl=64 throughput 1,104 tuples/sec 1,084 tuples/sec 1,026 tuples/sec +1.8% +7.6%
bs=1000 sw=10 sl=64 MB/s 0.674 MB/s 0.662 MB/s 0.626 MB/s +1.8% +7.6%
bs=1000 sw=10 sl=64 p50 900,601 us 922,824 us 996,304 us -2.4% -9.6%
bs=1000 sw=10 sl=64 p95 1,008,480 us 969,890 us 1,042,531 us +4.0% -3.3%
bs=1000 sw=10 sl=64 p99 1,008,480 us 969,890 us 1,074,934 us +4.0% -6.2%
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,531.39,200,128000,376,0.230,25486.98,37797.33,37797.33
1,100,10,64,20,2201.41,2000,1280000,909,0.555,107902.98,166761.48,166761.48
2,1000,10,64,20,18111.40,20000,12800000,1104,0.674,900600.54,1008480.19,1008480.19

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.89%. Comparing base (a5563a9) to head (395eaff).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7622      +/-   ##
============================================
- Coverage     88.96%   88.89%   -0.07%     
+ Complexity     4357     4347      -10     
============================================
  Files          1179     1178       -1     
  Lines         46919    46903      -16     
  Branches       5230     5229       -1     
============================================
- Hits          41742    41695      -47     
- Misses         3427     3458      +31     
  Partials       1750     1750              
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø)
agent-service 98.62% <ø> (ø) Carriedforward from 71faf44
amber 84.72% <ø> (-0.21%) ⬇️ Carriedforward from 71faf44
computing-unit-managing-service 60.38% <ø> (ø)
config-service 77.31% <ø> (ø)
file-service 68.90% <ø> (ø)
frontend 90.58% <100.00%> (+<0.01%) ⬆️
notebook-migration-service 78.89% <ø> (ø)
pyamber 97.48% <100.00%> (+<0.01%) ⬆️
workflow-compiling-service 57.89% <ø> (ø)

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

@aicam aicam 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!

@aicam
aicam added this pull request to the merge queue Aug 13, 2026
Merged via the queue into apache:main with commit baefb5d Aug 13, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common feature frontend Changes related to the frontend GUI pyamber

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants