Commit 7bdcea7f authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

[CASTOR migration] better logic for the CTA path

parent 36a19181
......@@ -178,8 +178,12 @@ BEGIN
storage_class_id, creation_time, reconciliation_time) (
SELECT /*+ PARALLEL(F) PARALLEL(D) */
F.fileid, inEOSCTAInstance, F.fileid,
'/eos/cta' || inEOSCTAInstance || D.path || '/' || F.filename,
F.disk_uid, F.disk_gid, F.filesize, F.classid, F.btime, 0
-- The decode expression strips off a top-level directory if it matches the target instance:
-- e.g. a /atlas/raw path becomes /eos/ctaatlas/raw as opposed to /eos/ctaatlas/atlas/raw
'/eos/cta' || inEOSCTAInstance || decode(instr(D.path, '/'||inEOSCTAInstance),
1, substr(D.path, length('/'||inEOSCTAInstance||'/')),
D.path) || '/' || F.filename,
F.disk_uid, F.disk_gid, F.filesize, F.checksum, F.classid, F.btime, 0
FROM CNS_CTAFilesHelper F, CNS_CTADirsHelper D
WHERE D.fileid = F.parent_fileid
-- exclude the already existing files because of dual copies
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment