Skip to content

Commit d7f6ee6

Browse files
committed
Stakeholder feedback [netlify-build]
1 parent c5191a0 commit d7f6ee6

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/unify/images/snowflake-setup.png

-59.1 KB
Loading

src/unify/linked-profiles/data-graph.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The parameters are:
8383

8484
| Parameters | Definition |
8585
| ----------- | --------------------------------------------------------------------- |
86-
| `profile_folder` | This is the folder or schema location for the profile tables. |
86+
| `profile_folder` | This is the fully qualified path of the folder or schema location for the profile tables. |
8787
| `materialization` | Identifies the type of materialization (`none`). |
8888

8989
Example:
@@ -92,7 +92,7 @@ Example:
9292
# Define a profile entity
9393

9494
profile {
95-
profile_folder = "segment"
95+
profile_folder = "PRODUCTION.segment"
9696
materialization = "none"
9797

9898
}
@@ -278,7 +278,7 @@ data_graph {
278278

279279
#define a profile entity
280280
profile {
281-
profile_folder = "segment"
281+
profile_folder = "PRODUCTION.segment"
282282
materialization = "none"
283283

284284
#relate accounts to profiles with an external ID

src/unify/linked-profiles/setup-guides/snowflake-setup.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,23 @@ Segment requires the following settings to connect to your Snowflake warehouse.
2424

2525
- **Account ID**: The Snowflake account ID that uniquely identifies your organization account.
2626
- **Database Name**: The only database that Segment requires write access to in order to create tables for internal bookkeeping. This database is referred to as `segment_connection_db` in the script below.
27-
- **Warehouse**: The warehouse in your Snowflake account that you want to use for Segment to run the SQL queries. This warehouse is referred to as `segment_connection_warehouse` in the script below.
27+
- **Warehouse**: The [warehouse](https://docs.snowflake.com/en/user-guide/warehouses){:target="_blank”} in your Snowflake account that you want to use for Segment to run the SQL queries. This warehouse is referred to as `segment_connection_warehouse` in the script below.
2828
- **Username**: The Snowflake user that Segment uses to run SQL in your warehouse. This user is referred to as `segment_connection_username` in the script below.
2929
- **Password**: The password of the user above. This password is referred to as `segment_connection_password` in the script below.
3030

3131
## Set up Snowflake credentials
3232

3333
Segment recommends setting up a new Snowflake user and only giving this user permissions to access the required databases and schemas for Segment Linked Profiles.
3434

35-
Segment only requires write access to one database where it creates a schema for internal bookkeeping. Segment recommends creating an empty database for this purpose using the script below. All other databases and schemas require read-only access granted to the Segment user.
36-
35+
### Create Segment user and internal database
3736

3837
Use the following steps to set up your Snowflake credentials:
3938

4039
- Create a new role and user for Segment Linked Profiles.
4140
- Grant the Segment user access to the warehouse of your choice. If you'd like to create a new warehouse, uncomment the SQL below.
42-
- Create a new database that Segment will use for internal bookkeeping. You'll need to grant the Segment user **write** access to this database that is used to store checkpoint tables for the queries that are executed. This is the database you'll be required to specify for the "Database Name" when connecting Snowflake with the Segment app.
43-
41+
- Create a new database for Segment Linked Profiles. Segment only requires write access to this one database to create a schema for internal bookkeeping, and to store checkpoint tables for the queries that are executed. Segment recommends creating an empty database for this purpose using the script below. This is also the database you'll be required to specify for the "Database Name" when connecting Snowflake with the Segment app.
4442

45-
```ts
43+
```
4644
-- ********** SET UP THE FOLLOWING WAREHOUSE PERMISSIONS **********
4745
-- Edit the following variables
4846
SET segment_connection_username='SEGMENT_LINKED_USER';
@@ -91,11 +89,13 @@ GRANT CREATE SCHEMA ON DATABASE identifier($segment_connection_db) TO ROLE iden
9189
9290
```
9391

92+
### Grant access to other databases
93+
9494
Next, give the Segment user **read-only** access to all the other databases you want to use for Linked Profiles.
9595

9696
Run the SQL query below for **each** database you want to use for Linked Profiles:
9797

98-
```ts
98+
```
9999
100100
SET segment_connection_role='SEGMENT_LINKED_ROLE';
101101
@@ -115,11 +115,11 @@ GRANT SELECT ON FUTURE MATERIALIZED VIEWS IN DATABASE identifier($linked_read_on
115115
116116
```
117117

118-
### (Optional) Snowflake schema access
118+
### (Optional) Restrict Snowflake schema access
119119

120-
[Snowflake schema access](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges){:target="_blank”}: If you want to restrict access to specific schemas or tables, run the following commands:
120+
If you want to restrict access to specific [Snowflake schemas and tables](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges){:target="_blank”}, run the following commands:
121121

122-
```ts
122+
```
123123
-- [Optional] Further restrict access to only specific schemas and tables
124124
SET db='MY_DB';
125125
SET schema='MY_DB.MY_SCHEMA_NAME';
@@ -138,18 +138,18 @@ GRANT SELECT ON FUTURE TABLES IN SCHEMA identifier($schema) TO ROLE identifier($
138138
139139
```
140140

141-
### (If applicable) Add Snowflake table permissions
142-
Run the following SQL if you run into an error on the Segment app indicating that the user doesn't have sufficient privileges on an existing `_segment_reverse_etl` schema.
143-
144-
If Segment Reverse ETL has ever run in the database you are configuring as the Segment connection database, a Segment-managed schema is already created and you need to provide the new Segment user access to the existing schema.
141+
### (If applicable) Update user acccess for Segment Reverse ETL schema
145142

146143
> warning ""
147144
> This is only applicable if you choose to use an existing database as the Segment connection database that has also been used for Segment Reverse ETL.
148145
146+
Run the following SQL if you run into an error on the Segment app indicating that the user doesn't have sufficient privileges on an existing `_segment_reverse_etl` schema.
147+
148+
If Segment Reverse ETL has ever run in the database you are configuring as the Segment connection database, a Segment-managed schema is already created and you need to provide the new Segment user access to the existing schema.
149149

150150
Add the Snowflake table permissions by running the following commands:
151151

152-
```ts
152+
```
153153
-- If you want to use an existing database that already has Segment Reverse ETL schemas, you’ll need to run some additional steps below to grant the role access to the existing schemas.
154154
155155
SET retl_schema = concat($segment_internal_database,'.__segment_reverse_etl');
@@ -166,7 +166,7 @@ GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA identifier($retl_schem
166166

167167
To verify you have set up the right permissions for a specific table, log in with the username and password you created for `SEGMENT_CONNECTION_USERNAME` and run the following command to verify the role you created has the correct permissions. If this command succeeds, you should be able to view the respective table.
168168

169-
```ts
169+
```
170170
set segment_connection_role='SEGMENT_LINKED_ROLE';
171171
set linked_read_only_database='YOUR_DB';
172172
set table_name = 'YOUR_DB.SCHEMA.TABLE';

0 commit comments

Comments
 (0)