You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"SELECT d.* from datasets_view d inner join job_versions_io_mapping m on m.dataset_uuid = d.uuid where m.job_version_uuid = :jobVersionUuid and io_type = :ioType")
112
+
"SELECT d.* from datasets_view d inner join job_io_mapping m on m.dataset_uuid = d.uuid where m.job_version_uuid = :jobVersionUuid and io_type = :ioType")
+ " inner join jobs_view j ON j.uuid=jv.job_uuid "
@@ -196,14 +196,14 @@ WITH RECURSIVE search_graph(job_name, namespace_name, depth, path, cycle) AS (
196
196
(
197
197
select j.name AS job_name, j.namespace_name, j.name as jx
198
198
from jobs_view j
199
-
inner join job_versions_io_mapping io_in on io_in.job_version_uuid = j.current_version_uuid and io_in.io_type = 'INPUT'
200
-
inner join job_versions_io_mapping io_out on io_out.dataset_uuid = io_in.dataset_uuid and io_out.io_type = 'OUTPUT'
199
+
inner join job_io_mapping io_in on io_in.job_version_uuid = j.current_version_uuid and io_in.io_type = 'INPUT'
200
+
inner join job_io_mapping io_out on io_out.dataset_uuid = io_in.dataset_uuid and io_out.io_type = 'OUTPUT'
201
201
inner join job_versions jv on jv.uuid = io_out.job_version_uuid
202
202
UNION ALL
203
203
select j.name AS job_name, jv.namespace_name, j.name as jx
204
204
from jobs_view j
205
-
inner join job_versions_io_mapping io_out on io_out.job_version_uuid = j.current_version_uuid and io_out.io_type = 'OUTPUT'
206
-
inner join job_versions_io_mapping io_in on io_in.dataset_uuid = io_out.dataset_uuid and io_in.io_type = 'INPUT'
205
+
inner join job_io_mapping io_out on io_out.job_version_uuid = j.current_version_uuid and io_out.io_type = 'OUTPUT'
206
+
inner join job_io_mapping io_in on io_in.dataset_uuid = io_out.dataset_uuid and io_in.io_type = 'INPUT'
207
207
inner join job_versions jv on jv.uuid = io_in.job_version_uuid
208
208
) l where l.jx = sg.job_name and NOT cycle
209
209
)
@@ -214,21 +214,21 @@ WITH RECURSIVE search_graph(job_name, namespace_name, depth, path, cycle) AS (
214
214
-- input datasets
215
215
left outer join (
216
216
select io_out.job_version_uuid, jsonb_agg((SELECT x FROM (SELECT ds_in.name, ds_in.namespace_name as namespace, o.out_agg as "inEdges", i.in_agg as "outEdges") AS x)) as agg
217
-
from job_versions_io_mapping io_out
217
+
from job_io_mapping io_out
218
218
inner join datasets_view ds_in on ds_in.uuid = io_out.dataset_uuid
219
219
-- output jobs for each input dataset
220
220
left outer join (
221
221
select io_of_in.dataset_uuid, jsonb_agg((select x from (select j_of_in.name, j_of_in.namespace_name as namespace) as x)) as in_agg
222
222
from jobs_view j_of_in
223
-
left outer join job_versions_io_mapping io_of_in on io_of_in.job_version_uuid = j_of_in.current_version_uuid
223
+
left outer join job_io_mapping io_of_in on io_of_in.job_version_uuid = j_of_in.current_version_uuid
224
224
and io_of_in.io_type = 'INPUT'
225
225
group by io_of_in.dataset_uuid
226
226
) i on i.dataset_uuid = io_out.dataset_uuid
227
227
-- input jobs for each input dataset
228
228
left outer join (
229
229
select io_of_out.dataset_uuid, jsonb_agg((select x from (select j_of_out.name, j_of_out.namespace_name as namespace) as x)) as out_agg
230
230
from jobs_view j_of_out
231
-
left outer join job_versions_io_mapping io_of_out
231
+
left outer join job_io_mapping io_of_out
232
232
on io_of_out.job_version_uuid = j_of_out.current_version_uuid
233
233
and io_of_out.io_type = 'OUTPUT'
234
234
group by io_of_out.dataset_uuid
@@ -240,21 +240,21 @@ select io_of_out.dataset_uuid, jsonb_agg((select x from (select j_of_out.name, j
240
240
--output datasets
241
241
left outer join(
242
242
select io_out.job_version_uuid, jsonb_agg((SELECT x FROM (SELECT ds_in.name, ds_in.namespace_name as namespace, o.out_agg as "inEdges", i.in_agg as "outEdges") AS x)) as agg
243
-
from job_versions_io_mapping io_out
243
+
from job_io_mapping io_out
244
244
inner join datasets_view ds_in on ds_in.uuid = io_out.dataset_uuid
245
245
-- output jobs for each output dataset
246
246
left outer join (
247
247
select io_of_in.dataset_uuid, jsonb_agg((select x from (select j_of_in.name, j_of_in.namespace_name as namespace) as x)) as in_agg
248
248
from jobs_view j_of_in
249
-
left outer join job_versions_io_mapping io_of_in on io_of_in.job_version_uuid = j_of_in.current_version_uuid
249
+
left outer join job_io_mapping io_of_in on io_of_in.job_version_uuid = j_of_in.current_version_uuid
250
250
and io_of_in.io_type = 'INPUT'
251
251
group by io_of_in.dataset_uuid
252
252
) i on i.dataset_uuid = io_out.dataset_uuid
253
253
-- input jobs for each output dataset
254
254
left outer join (
255
255
select io_of_out.dataset_uuid, jsonb_agg((select x from (select j_of_out.name, j_of_out.namespace_name as namespace) as x)) as out_agg
256
256
from jobs_view j_of_out
257
-
left outer join job_versions_io_mapping io_of_out
257
+
left outer join job_io_mapping io_of_out
258
258
on io_of_out.job_version_uuid = j_of_out.current_version_uuid
-- To add job_uuid to the unique constraint, we first drop the primary key, then recreate it; note given that job_version_uuid can be NULL, we need to check that job_version_uuid != NULL before inserting (duplicate columns otherwise)
6
+
ALTERTABLE job_versions_io_mapping DROP CONSTRAINT job_versions_io_mapping_pkey;
7
+
8
+
ALTERTABLE job_versions_io_mapping RENAME TO job_io_mapping;
9
+
ALTERTABLE job_io_mapping ALTER COLUMN job_version_uuid DROP NOT NULL;
10
+
11
+
-- TODO: create index for lineage query and update
0 commit comments