Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SNOW-42] Append to file inventory task #15

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
use role accountadmin;
use schema {{database_name}}.synapse_raw; --noqa: JJ01,PRS,TMP
alter task refresh_synapse_warehouse_s3_stage_task suspend;
create task if not exists append_to_fileinventory_task
user_task_managed_initial_warehouse_size = 'SMALL'
AFTER refresh_synapse_warehouse_s3_stage_task
as
copy into
fileinventory
from (
select
$1:bucket as bucket,
$1:e_tag as e_tag,
$1:encryption_status as encryption_status,
$1:intelligent_tiering_access_tier as intelligent_tiering_access_tier,
$1:is_delete_marker as is_delete_marker,
$1:is_latest as is_latest,
$1:is_multipart_uploaded as is_multipart_uploaded,
$1:key as key,
$1:last_modified_date as last_modified_date,
$1:object_owner as object_owner,
$1:size as size,
$1:storage_class as storage_class
from
@{{stage_storage_integration}}_stage/inventory --noqa: TMP
)
pattern='.*defaultInventory/data/.*';

alter task append_to_fileinventory_task resume;
alter task refresh_synapse_warehouse_s3_stage_task resume;