Skip to content

Commit 3258c78

Browse files
authored
Merge pull request #14 from Sage-Bionetworks/SNOW-34-add-fileinventory-snapshot
[SNOW-34] Add in file inventory data
2 parents 3ccf400 + a3ece20 commit 3258c78

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
USE SCHEMA {{database_name}}.synapse_raw; --noqa: JJ01,PRS,TMP
2+
USE WAREHOUSE COMPUTE_MEDIUM;
3+
-- Create new tables
4+
CREATE TABLE IF NOT EXISTS fileinventory (
5+
bucket STRING,
6+
e_tag STRING,
7+
encryption_status STRING,
8+
intelligent_tiering_access_tier STRING,
9+
is_delete_marker BOOLEAN,
10+
is_latest BOOLEAN,
11+
is_multipart_uploaded BOOLEAN,
12+
key STRING,
13+
last_modified_date TIMESTAMP,
14+
object_owner STRING,
15+
size NUMBER,
16+
storage_class STRING
17+
);
18+
19+
-- initial load of data
20+
21+
copy into
22+
fileinventory
23+
from (
24+
select
25+
$1:bucket as bucket,
26+
$1:e_tag as e_tag,
27+
$1:encryption_status as encryption_status,
28+
$1:intelligent_tiering_access_tier as intelligent_tiering_access_tier,
29+
$1:is_delete_marker as is_delete_marker,
30+
$1:is_latest as is_latest,
31+
$1:is_multipart_uploaded as is_multipart_uploaded,
32+
$1:key as key,
33+
$1:last_modified_date as last_modified_date,
34+
$1:object_owner as object_owner,
35+
$1:size as size,
36+
$1:storage_class as storage_class
37+
from
38+
@{{stage_storage_integration}}_stage/inventory --noqa: TMP
39+
)
40+
pattern='.*defaultInventory/data/.*'
41+
;

0 commit comments

Comments
 (0)