tanishqgandhi1908 commented on code in PR #7789:
URL: https://github.com/apache/texera/pull/7789#discussion_r3826191204
##########
sql/updates/36.sql:
##########
@@ -80,22 +98,32 @@ BEGIN
op,
'{operatorProperties,fileName}',
CASE
- WHEN f.fn IS NOT NULL AND left(f.fn, 10) <>
'/datasets/'
+ WHEN f.fn ~ '^/datasets/'
+ AND EXISTS (SELECT 1 FROM dataset d JOIN "user" u
ON d.owner_uid = u.uid
+ WHERE u.email =
split_part(ltrim(f.fn, '/'), '/', 2)
+ AND d.name =
split_part(ltrim(f.fn, '/'), '/', 3))
+ THEN to_jsonb(regexp_replace(f.fn, '^/datasets/',
'/dataset/'))
Review Comment:
Got it, Done
36.sql is restored and the normalization moved to 39.sql — 38 is taken by
your user_warehouse rename. The (user.email, dataset.name) EXISTS guard came
along as you suggested, so local mounts that already look like /datasets/...
stay untouched.
39 handles both shapes rather than only the plural rewrite, so it converges
regardless of whether 36 ran:
fresh DB 36 prefixes -> /datasets/, 39 rewrites -> /dataset/
recorded id 36 36 skipped, 39 repairs -> /dataset/
And on your point that the fixtures covered the statements but not the
tracking —
Re-tested through the id check itself, emulating main.sh against a real
databasechangelog table:
fresh: changeSet 36 ran, 39 rewrote ->
/dataset/[email protected]/ds/v1/a.csv
ran old 36: changeSet 36 SKIPPED, 39 rewrote ->
/dataset/[email protected]/ds/v1/a.csv
Also covered 39 alone with no 36, 39 twice (second run reports 0 rows), and
39
before 36 out of order — 36 then finds no user emailed "dataset" and reports
0.
All four land on the same state, with the local mount untouched throughout.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]