Changeset 24244 for branches/cnb_branches/cnb_branch_20090301/ippTools/share/disttool_pendingcomponent.sql
- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/share (modified) (1 prop)
-
ippTools/share/disttool_pendingcomponent.sql (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ippTools/share
- Property svn:ignore
-
old new 1 1 Makefile.in 2 2 Makefile 3 pxadmin_create_mirror_tables.sql
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090301/ippTools/share/disttool_pendingcomponent.sql
r23594 r24244 1 1 SELECT * FROM ( 2 -- raw stage 2 3 SELECT 3 4 distRun.dist_id, … … 8 9 clean, 9 10 rawExp.camera, 10 outroot,11 CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir, 11 12 rawImfile.uri as path_base, -- change this once rawImfile has path_base 12 13 chipProcessedImfile.path_base as chip_path_base, 13 14 NULL as state, 14 15 NULL as data_state, 16 0 as quality, 17 distRun.no_magic, 15 18 rawImfile.magicked 16 19 FROM distRun 17 20 JOIN rawExp ON exp_id = stage_id 18 JOIN ( -- find the last magicked chip run 21 JOIN ( -- find the last satisfactory chip run 22 -- note this requires that a chip run have been completed even when 23 -- magic is not required for the run 19 24 SELECT 20 25 exp_id, 21 26 MAX(chip_id) AS chip_id 22 27 FROM chipRun 28 JOIN distRun ON stage_id = exp_id AND stage = 'raw' 23 29 WHERE 24 30 chipRun.state = 'full' 25 31 AND chipRun.exp_id = exp_id 26 -- AND chipRun.magicked 27 -- magicked hook 1 %s 32 AND (chipRun.magicked OR distRun.no_magic) 28 33 GROUP BY exp_id 29 34 ) AS bestChipRun … … 37 42 WHERE 38 43 distRun.state = 'new' 44 AND distRun.clean = 0 39 45 AND distRun.stage = 'raw' 40 46 AND distComponent.dist_id IS NULL 41 -- if magicked add AND rawImfile.magicked here47 AND (rawExp.magicked OR distRun.no_magic) 42 48 -- where hook 1 %s 49 UNION 50 -- raw stage clean (dbinfo only) 51 SELECT 52 distRun.dist_id, 53 distRun.label, 54 stage, 55 stage_id, 56 'exposure' AS component, 57 clean, 58 rawExp.camera, 59 CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir, 60 NULL, 61 NULL, 62 NULL as state, 63 NULL as data_state, 64 0 as quality, 65 distRun.no_magic, 66 rawExp.magicked 67 FROM distRun 68 JOIN rawExp ON exp_id = stage_id 69 LEFT JOIN distComponent 70 ON distRun.dist_id = distComponent.dist_id 71 WHERE 72 distRun.state = 'new' 73 AND distRun.stage = 'raw' 74 AND distRun.clean 75 AND distComponent.dist_id IS NULL 76 -- where hook 2 %s 43 77 44 78 -- chip stage … … 52 86 clean, 53 87 rawExp.camera, 54 outroot,88 CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir, 55 89 chipProcessedImfile.path_base, 56 90 chipProcessedImfile.path_base as chip_path_base, 57 91 chipRun.state, 58 92 chipProcessedImfile.data_state, 93 chipProcessedImfile.quality, 94 distRun.no_magic, 59 95 chipProcessedImfile.magicked 60 96 FROM distRun … … 69 105 AND distRun.stage = 'chip' 70 106 AND distComponent.dist_id IS NULL 71 -- where hook 2 %s 72 UNION 73 SELECT 74 distRun.dist_id, 75 distRun.label, 76 stage, 77 stage_id, 78 chipProcessedImfile.class_id AS component, 79 clean, 80 rawExp.camera, 81 outroot, 107 AND (distRun.clean OR chipRun.magicked OR distRun.no_magic) 108 AND (chipRun.state = 'full' OR (distRun.clean AND chipRun.state = 'cleaned')) 109 -- where hook 3 %s 110 UNION 111 SELECT 112 distRun.dist_id, 113 distRun.label, 114 stage, 115 stage_id, 116 'exposure' AS component, 117 -- chipProcessedImfile.class_id AS component, 118 clean, 119 rawExp.camera, 120 CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir, 82 121 camProcessedExp.path_base, 83 chipProcessedImfile.path_baseas chip_path_base,122 NULL as chip_path_base, 84 123 camRun.state, 85 124 NULL, 86 0 125 camProcessedExp.quality, 126 distRun.no_magic, 127 chipRun.magicked 87 128 FROM distRun 88 129 JOIN camRun ON camRun.cam_id = distRun.stage_id 89 130 JOIN camProcessedExp USING(cam_id) 90 131 JOIN chipRun USING(chip_id) 91 JOIN chipProcessedImfile USING(exp_id, chip_id)92 JOIN rawExp using(exp_id) 93 LEFT JOIN distComponent 94 ON distRun.dist_id = distComponent.dist_id 95 AND chipProcessedImfile.class_id = distComponent.component132 -- JOIN chipProcessedImfile USING(exp_id, chip_id) 133 JOIN rawExp using(exp_id) 134 LEFT JOIN distComponent 135 ON distRun.dist_id = distComponent.dist_id 136 -- AND chipProcessedImfile.class_id = distComponent.component 96 137 WHERE 97 138 distRun.state = 'new' 98 139 AND distRun.stage = 'camera' 99 140 AND distComponent.dist_id IS NULL 100 -- where hook 3 %s 141 AND (distRun.clean OR chipRun.magicked OR distRun.no_magic) 142 AND (camRun.state = 'full' OR (distRun.clean AND camRun.state = 'cleaned')) 143 -- where hook 4 %s 101 144 UNION 102 145 SELECT … … 108 151 clean, 109 152 rawExp.camera, 110 outroot,153 CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir, 111 154 fakeProcessedImfile.path_base, 112 155 NULL, 113 156 fakeRun.state, 114 157 NULL, 158 0 as quality, 159 distRun.no_magic, 115 160 0 116 161 FROM distRun … … 127 172 AND distRun.stage = 'fake' 128 173 AND distComponent.dist_id IS NULL 129 -- where hook 4%s174 -- where hook 5 %s 130 175 UNION 131 176 SELECT … … 137 182 clean, 138 183 rawExp.camera, 139 outroot,184 CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir, 140 185 warpSkyfile.path_base, 141 186 NULL as chip_path_base, 142 187 warpRun.state, 143 188 warpSkyfile.data_state, 189 warpSkyfile.quality, 190 distRun.no_magic, 144 191 warpSkyfile.magicked 145 192 FROM distRun … … 157 204 AND distRun.stage = 'warp' 158 205 AND distComponent.dist_id IS NULL 159 -- where hook 5 %s 206 AND (distRun.clean OR warpRun.magicked OR distRun.no_magic) 207 AND (warpRun.state = 'full' OR (distRun.clean AND warpRun.state = 'cleaned')) 208 -- where hook 6 %s 160 209 UNION 161 210 SELECT … … 167 216 clean, 168 217 rawExp.camera, 169 outroot,218 CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir, 170 219 diffSkyfile.path_base, 171 220 NULL as chip_path_base, … … 174 223 -- diffSkyfile.data_state, 175 224 'full' AS data_state, 225 diffSkyfile.quality, 226 distRun.no_magic, 176 227 diffSkyfile.magicked 177 228 FROM distRun 178 229 JOIN diffRun ON stage_id = diff_id 179 230 JOIN diffSkyfile using(diff_id) 180 JOIN rawExp using(exp_id) 231 JOIN diffInputSkyfile USING(diff_id, skycell_id) 232 JOIN warpRun 233 ON warpRun.warp_id = diffInputSkyfile.warp1 234 JOIN fakeRun USING(fake_id) 235 JOIN camRun USING(cam_id) 236 JOIN chipRun USING(chip_id) 237 JOIN rawExp USING(exp_id) 181 238 LEFT JOIN distComponent 182 239 ON distRun.dist_id = distComponent.dist_id … … 186 243 AND distRun.stage = 'diff' 187 244 AND distComponent.dist_id IS NULL 188 -- where hook 6 %s 245 AND (distRun.clean OR diffRun.magicked OR distRun.no_magic) 246 AND (diffRun.state = 'full' OR (distRun.clean AND diffRun.state = 'cleaned')) 247 -- where hook 7 %s 189 248 UNION 190 249 SELECT DISTINCT … … 196 255 clean, 197 256 rawExp.camera, 198 outroot,257 CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir, 199 258 stackSumSkyfile.path_base, 200 259 NULL as chip_path_base, … … 203 262 -- stackSumSkyfile.data_state, 204 263 'full' AS data_state, 264 stackSumSkyfile.quality, 265 1 AS no_magic, 205 266 0 AS magicked 206 267 FROM distRun … … 232 293 AND distRun.stage = 'stack' 233 294 AND distComponent.dist_id IS NULL 234 -- where hook 7 %s 295 AND (stackRun.state = 'full' OR (distRun.clean AND stackRun.state = 'cleaned')) 296 -- where hook 8 %s 235 297 ) as Foo
Note:
See TracChangeset
for help on using the changeset viewer.
