Remove ownership auto confirm by SCM

This commit is contained in:
Yi Wang 2017-04-05 09:01:48 -07:00 committed by Mars Lan
parent d1e644a7ec
commit 5ff2c85fee
2 changed files with 4 additions and 8 deletions

View File

@ -91,7 +91,7 @@ class CodeSearchLoad:
'SCM' n_owner_source, null db_ids, 'SCM' n_owner_source, null db_ids,
IF(r.app_id = 301, 'Y', 'N') is_group, IF(r.app_id = 301, 'Y', 'N') is_group,
'Y' is_active, 0 source_time, unix_timestamp(NOW()) created_time, r.wh_etl_exec_id, 'Y' is_active, 0 source_time, unix_timestamp(NOW()) created_time, r.wh_etl_exec_id,
'system' confirmed_by, unix_timestamp(NOW()) confirmed_on null confirmed_by, null confirmed_on
FROM dict_dataset ds FROM dict_dataset ds
JOIN stg_database_scm_map r JOIN stg_database_scm_map r
ON ds.urn LIKE concat(r.database_type, ':///', r.database_name,'/%') ON ds.urn LIKE concat(r.database_type, ':///', r.database_name,'/%')
@ -108,9 +108,7 @@ class CodeSearchLoad:
WHEN owner_source LIKE '%SCM%' THEN owner_source ELSE CONCAT(owner_source, ',SCM') END, WHEN owner_source LIKE '%SCM%' THEN owner_source ELSE CONCAT(owner_source, ',SCM') END,
namespace = COALESCE(namespace, n.n_namespace), namespace = COALESCE(namespace, n.n_namespace),
wh_etl_exec_id = n.wh_etl_exec_id, wh_etl_exec_id = n.wh_etl_exec_id,
modified_time = unix_timestamp(NOW()), modified_time = unix_timestamp(NOW());
confirmed_by = 'system',
confirmed_on = unix_timestamp(NOW());
-- reset dataset owner sort id -- reset dataset owner sort id
UPDATE dataset_owner d UPDATE dataset_owner d

View File

@ -150,7 +150,7 @@ class MultiproductLoad:
'SCM' n_owner_source, null db_ids, 'SCM' n_owner_source, null db_ids,
IF(r.app_id = 301, 'Y', 'N') is_group, IF(r.app_id = 301, 'Y', 'N') is_group,
'Y' is_active, 0 source_time, unix_timestamp(NOW()) created_time, r.wh_etl_exec_id, 'Y' is_active, 0 source_time, unix_timestamp(NOW()) created_time, r.wh_etl_exec_id,
'system' confirmed_by, unix_timestamp(NOW()) confirmed_on null confirmed_by, null confirmed_on
FROM (SELECT id, urn, substring_index(substring_index(urn, '/', 4), '/', -1) ds_group FROM (SELECT id, urn, substring_index(substring_index(urn, '/', 4), '/', -1) ds_group
FROM dict_dataset WHERE urn regexp '^(dalids|espresso|oracle)\:\/\/\/.*$') ds FROM dict_dataset WHERE urn regexp '^(dalids|espresso|oracle)\:\/\/\/.*$') ds
JOIN stg_repo_owner r JOIN stg_repo_owner r
@ -169,9 +169,7 @@ class MultiproductLoad:
WHEN owner_source LIKE '%SCM%' THEN owner_source ELSE CONCAT(owner_source, ',SCM') END, WHEN owner_source LIKE '%SCM%' THEN owner_source ELSE CONCAT(owner_source, ',SCM') END,
namespace = COALESCE(namespace, n.n_namespace), namespace = COALESCE(namespace, n.n_namespace),
wh_etl_exec_id = n.wh_etl_exec_id, wh_etl_exec_id = n.wh_etl_exec_id,
modified_time = unix_timestamp(NOW()), modified_time = unix_timestamp(NOW());
confirmed_by = 'system',
confirmed_on = unix_timestamp(NOW());
-- reset dataset owner sort id -- reset dataset owner sort id
UPDATE dataset_owner d UPDATE dataset_owner d