Skip to content

Commit 8062beb

Browse files
committed
redshift unload lineage
1 parent 6cc20b6 commit 8062beb

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

databases/redshift/readme.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# AWS redshift database column-level data lineage
1+
# AWS redshift database SQL column-level data lineage
22

33
Discover and visualization lineage from AWS redshift database and SQL script.
44

5-
### Copy command
5+
### 1. Copy command
66

77
```sql
88
copy catdemo
@@ -29,3 +29,16 @@ data lineage diagram:
2929
[![redshift data lineage copy ](redshift-data-linage-copy-with-columns.png)](https://sqlflow.gudusoft.com)
3030

3131

32+
### 2. Unload command
33+
```sql
34+
CREATE TABLE a_table(an_int INT, b_int INT);
35+
INSERT INTO a_table VALUES (1,1), (2,1), (3,1), (4,1), (1,2), (2,2), (3,2), (4,2), (5,2), (6,2);
36+
37+
CREATE TABLE hll_table (sketch HLLSKETCH);
38+
INSERT INTO hll_table select hll_create_sketch(an_int) from a_table group by b_int;
39+
40+
UNLOAD ('select * from hll_table') TO 's3://mybucket/unload/'
41+
IAM_ROLE 'arn:aws:iam::0123456789012:role/MyRedshiftRole' NULL AS 'null' ALLOWOVERWRITE CSV;
42+
```
43+
44+
[![redshift sql data lineage unload](redshift-data-linage-unload.png)](https://sqlflow.gudusoft.com)
7.51 KB
Loading

0 commit comments

Comments
 (0)