|
| 1 | +use role accountadmin; |
| 2 | +use schema {{database_name}}.synapse_raw; --noqa: JJ01,PRS,TMP |
| 3 | +alter task refresh_synapse_warehouse_s3_stage_task suspend; |
| 4 | +alter task NODESNAPSHOT_TASK suspend; |
| 5 | +alter task UPSERT_TO_NODE_LATEST_TASK suspend; |
| 6 | +alter task REMOVE_DELETE_NODES_TASK suspend; |
| 7 | +alter task NODESNAPSHOT_TASK MODIFY AS |
| 8 | + copy into |
| 9 | + nodesnapshots |
| 10 | + from ( |
| 11 | + select |
| 12 | + $1:change_type as change_type, |
| 13 | + $1:change_timestamp as change_timestamp, |
| 14 | + $1:change_user_id as change_user_id, |
| 15 | + $1:snapshot_timestamp as snapshot_timestamp, |
| 16 | + $1:id as id, |
| 17 | + $1:benefactor_id as benefactor_id, |
| 18 | + $1:project_id as project_id, |
| 19 | + $1:parent_id as parent_id, |
| 20 | + $1:node_type as node_type, |
| 21 | + $1:created_on as created_on, |
| 22 | + $1:created_by as created_by, |
| 23 | + $1:modified_on as modified_on, |
| 24 | + $1:modified_by as modified_by, |
| 25 | + $1:version_number as version_number, |
| 26 | + $1:file_handle_id as file_handle_id, |
| 27 | + $1:name as name, |
| 28 | + $1:is_public as is_public, |
| 29 | + $1:is_controlled as is_controlled, |
| 30 | + $1:is_restricted as is_restricted, |
| 31 | + NULLIF( |
| 32 | + REGEXP_REPLACE( |
| 33 | + metadata$filename, |
| 34 | + '.*nodesnapshots\/snapshot_date\=(.*)\/.*', '\\1' |
| 35 | + ), |
| 36 | + '__HIVE_DEFAULT_PARTITION__' |
| 37 | + ) as snapshot_date, |
| 38 | + $1:effective_ars as effective_ars |
| 39 | + from @{{stage_storage_integration}}_stage/nodesnapshots/ --noqa: TMP |
| 40 | + ) |
| 41 | + pattern = '.*nodesnapshots/snapshot_date=.*/.*'; |
| 42 | + |
| 43 | +alter task REMOVE_DELETE_NODES_TASK resume; |
| 44 | +alter task UPSERT_TO_NODE_LATEST_TASK resume; |
| 45 | +alter task NODESNAPSHOT_TASK resume; |
| 46 | +alter task refresh_synapse_warehouse_s3_stage_task resume; |
0 commit comments