From 6d63fbe35023000a46e2405e317320cc9e8221f3 Mon Sep 17 00:00:00 2001 From: stayseesong Date: Thu, 5 Dec 2024 10:53:17 -0800 Subject: [PATCH 1/9] edits --- .../data-graph/setup-guides/redshift-setup.md | 67 +++++++++++++++++-- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/src/unify/data-graph/setup-guides/redshift-setup.md b/src/unify/data-graph/setup-guides/redshift-setup.md index a6da05fd3e..495afef195 100644 --- a/src/unify/data-graph/setup-guides/redshift-setup.md +++ b/src/unify/data-graph/setup-guides/redshift-setup.md @@ -2,24 +2,77 @@ title: Redshift Data Graph Setup beta: true plan: unify -hidden: true redirect_from: - '/unify/linked-profiles/setup-guides/redshift-setup' --- -> info "Linked Audiences is in public beta" -> Linked Audiences (with Data Graph, Linked Events) is in public beta, and Segment is actively working on this feature. Some functionality may change before it becomes generally available. - > info "" -> At this time, you can only use Redshift with Linked Events. +> Redshift for Data Graph is in beta and Segment is actively working on this feature. Some functionality may change before it becomes generally available. This feature is governed by Twilio Segment’s [First Access and Beta Preview Terms](https://www.twilio.com/en-us/legal/tos){:target="_blank"}. -On this page, you'll learn how to connect your Redshift data warehouse to Segment. +Set up your Redshift data warehouse to Segment for the [Data Graph](/docs/unify/data-graph/). ## Getting started +You need to be an account admin to set up the Segment Redshift connector as well as write permissions for the `__segment_reverse_etl` dataset. + To get started with Redshift: 1. Log in to Redshift and select the Redshift cluster you want to connect. -2. Follow these [networking instructions](/docs/connections/storage/catalog/redshift/#networking) to configure network and security settings. +2. Follow the [networking instructions](/docs/connections/storage/catalog/redshift/#networking) to configure network and security settings. + +## Step 1: Roles and permissions +Segment recommends you to create a new Redshift user and role with only the required permissions. + +1. Create a new role and user for the Segment Data Graph. This new role will only have access to the datasets you provide access to for the Data Graph. +2. Provide write access to the database as Segment requires this in order to create a schema for internal bookkeeping and to store checkpoint tables for the queries that are executed. Segment recommends you to create a new database for this purpose. This is also the database you'll be required to specify for the **Database Name** when connecting Redshift with the Segment app. + +## Step 2: Create database for Segment to store checkpoint tables + +> info "" +> Segment recommends you to create a new database for the Data Graph. If you choose to use an existing database that has also been used for [Segment Reverse ETL](/docs/connections/reverse-etl/), you must follow the [additional instructions](#update-user-access-for-segment-reverse-etl-schema) to update user access for the Segment Reverse ETL schema. + +Run the following SQL commands in your Redshift cluster: + +```sql +-- ******** SET UP THE FOLLOWING WAREHOUSE PERMISSIONS ******** + +-- Create a user with role for the Data Graph +CREATE ROLE SEGMENT_LINKED_ROLE; +CREATE USER SEGMENT_LINKED_USER PASSWORD "your_password"; +GRANT ROLE SEGMENT_LINKED_ROLE TO SEGMENT_LINKED_USER; + +-- Create and Grant access to a Segment internal DB used for bookkeeping. This is the only DB that Segment requires write access to. This is also the DB you will use in the "Database Name" config while setting up the connection in the Segment app. + +CREATE DATABASE SEGMENT_LINKED_PROFILES_DB; +GRANT CREATE ON DATABASE SEGMENT_LINKED_PROFILES_DB TO ROLE SEGMENT_LINKED_ROLE; +``` + +## Step 3: Grant read-only access for the Data Graph +Give the Segment role read-only access to additional schemas you want to use for Data Graph including the Profiles Sync database. + +### Schemas +Grant schema permissions based on customer need. See Amazon’s docs to view [schema permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"} and [example commands](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT-examples.html){:target="_blank"} that you can use to grant permissions. Repeat the following SQL query for each schema you want to use for the Data Graph. + +```sql +-- ********** REPEAT THE SQL QUERY BELOW FOR EACH SCHEMA YOU WANT TO USE FOR THE DATA GRAPH ********** + +GRANT USAGE ON SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; +``` + +### Table +Grant table permissions based on your needs. Learn more about [Amazon’s table permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"}. + +Table permissions can either be handled in bulk: +```sql +-- query data from a all tables in a schema +GRANT SELECT ON ALL TABLES IN SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; +``` + +Or in a more granular fashion if needed: +```sql +-- query data from a specific table in a schema +GRANT SELECT ON TABLE . TO ROLE segment_linked_role; +``` + ## Create a new role and user From 5723d4838d1fb1fed8d50ab7134d6a3392493a38 Mon Sep 17 00:00:00 2001 From: stayseesong Date: Thu, 5 Dec 2024 10:55:06 -0800 Subject: [PATCH 2/9] edits --- src/unify/data-graph/setup-guides/databricks-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unify/data-graph/setup-guides/databricks-setup.md b/src/unify/data-graph/setup-guides/databricks-setup.md index 2303bb3594..202c0a6956 100644 --- a/src/unify/data-graph/setup-guides/databricks-setup.md +++ b/src/unify/data-graph/setup-guides/databricks-setup.md @@ -1,5 +1,5 @@ --- -title: Databricks Setup +title: Databricks Data Graph Setup plan: unify redirect_from: - '/unify/linked-profiles/setup-guides/databricks-setup' From a3a7d2b1e0f4780a0283ada5a479c4e63c6c5809 Mon Sep 17 00:00:00 2001 From: stayseesong Date: Mon, 9 Dec 2024 10:54:13 -0800 Subject: [PATCH 3/9] [netlify-build] --- .../data-graph/setup-guides/redshift-setup.md | 99 +++++++++---------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/src/unify/data-graph/setup-guides/redshift-setup.md b/src/unify/data-graph/setup-guides/redshift-setup.md index 495afef195..2af2b14ee6 100644 --- a/src/unify/data-graph/setup-guides/redshift-setup.md +++ b/src/unify/data-graph/setup-guides/redshift-setup.md @@ -11,6 +11,12 @@ redirect_from: Set up your Redshift data warehouse to Segment for the [Data Graph](/docs/unify/data-graph/). +## Prerequisites + +To use Linked Audiences with Redshift, Segment requires you to configure [Profiles Synce materialized views for the Data Graph](/docs/unify/data-graph/#prerequisites). You can read more about [Profile Sync materialized views](/docs/unify/profiles-sync/tables/#tables-segment-materializes). + +Even though Segment only supports Profile Sync materialized tables for the Data Graph, Linked Audiences require Profile Sync to be configured such that both the [Profile raw tables](/docs/unify/profiles-sync/tables/#profile-raw-tables) and the [Profile materialized tables](/docs/unify/profiles-sync/tables/#tables-segment-materializes) are synchronized with your Redshift instance. + ## Getting started You need to be an account admin to set up the Segment Redshift connector as well as write permissions for the `__segment_reverse_etl` dataset. @@ -22,17 +28,25 @@ To get started with Redshift: ## Step 1: Roles and permissions Segment recommends you to create a new Redshift user and role with only the required permissions. -1. Create a new role and user for the Segment Data Graph. This new role will only have access to the datasets you provide access to for the Data Graph. +1. Create a new role and user for the Segment Data Graph. This new role will only have access to the datasets you provide access to for the Data Graph. Run the SQL commands in your Redshift cluster: + + ``` + -- Create a user with role for the Data Graph + CREATE ROLE SEGMENT_LINKED_ROLE; + CREATE USER SEGMENT_LINKED_USER PASSWORD "your_password"; + GRANT ROLE SEGMENT_LINKED_ROLE TO SEGMENT_LINKED_USER; + ``` + 2. Provide write access to the database as Segment requires this in order to create a schema for internal bookkeeping and to store checkpoint tables for the queries that are executed. Segment recommends you to create a new database for this purpose. This is also the database you'll be required to specify for the **Database Name** when connecting Redshift with the Segment app. -## Step 2: Create database for Segment to store checkpoint tables +## Step 2: Create a database for Segment to store checkpoint tables > info "" > Segment recommends you to create a new database for the Data Graph. If you choose to use an existing database that has also been used for [Segment Reverse ETL](/docs/connections/reverse-etl/), you must follow the [additional instructions](#update-user-access-for-segment-reverse-etl-schema) to update user access for the Segment Reverse ETL schema. Run the following SQL commands in your Redshift cluster: -```sql +``` -- ******** SET UP THE FOLLOWING WAREHOUSE PERMISSIONS ******** -- Create a user with role for the Data Graph @@ -47,12 +61,14 @@ GRANT CREATE ON DATABASE SEGMENT_LINKED_PROFILES_DB TO ROLE SEGMENT_LINKED_ROLE; ``` ## Step 3: Grant read-only access for the Data Graph -Give the Segment role read-only access to additional schemas you want to use for Data Graph including the Profiles Sync database. +Grant the Segment role read-only access to additional schemas you want to use for the Data Graph including the Profiles Sync database. + +To locate the Profile Sync database, navigate to **Unify > Profiles Sync > Settings > Connection Settings**. You will see the database and schema name. ### Schemas Grant schema permissions based on customer need. See Amazon’s docs to view [schema permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"} and [example commands](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT-examples.html){:target="_blank"} that you can use to grant permissions. Repeat the following SQL query for each schema you want to use for the Data Graph. -```sql +``` -- ********** REPEAT THE SQL QUERY BELOW FOR EACH SCHEMA YOU WANT TO USE FOR THE DATA GRAPH ********** GRANT USAGE ON SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; @@ -62,64 +78,47 @@ GRANT USAGE ON SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; Grant table permissions based on your needs. Learn more about [Amazon’s table permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"}. Table permissions can either be handled in bulk: -```sql +``` -- query data from a all tables in a schema GRANT SELECT ON ALL TABLES IN SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; ``` Or in a more granular fashion if needed: -```sql +``` -- query data from a specific table in a schema GRANT SELECT ON TABLE . TO ROLE segment_linked_role; ``` +## Step 4: Validate permissions +To verify you have set up the right permissions for a specific table, log in with the username and password you created for `SEGMENT_LINKED_USER` 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. -## Create a new role and user - -Run the SQL commands below to create a role (`segment_entities`) and user (`segment_entities_user`). - -```sql --- create role -CREATE ROLE segment_entities; - --- allow the role to create new schemas on specified database. (This is the name you chose when provisioning your cluster) -GRANT CREATE ON DATABASE "" TO ROLE segment_entities; - --- create a user named "segment_entities_user" that Segment will use when connecting to your Redshift cluster. -CREATE USER segment_entities_user PASSWORD ''; - --- grant role permissions to the user -GRANT ROLE segment_entities TO segment_entities_user; ``` - -## Grant access to schemas and tables - -You'll need to grant access to schemas and tables that you'd like to enrich with. This allows Segment to list schemas, tables, and columns, as well as create entities with data extracted and ingested to Segment. - -### Schemas - -Grant schema permissions based on customer need. Visit Amazon's docs to view [schema permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"} and [example commands](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT-examples.html){:target="_blank"} that you can use to grant permissions. - -```ts --- view specific schemas in database -GRANT USAGE ON SCHEMA TO ROLE segment_entities; +SHOW SCHEMAS FROM DATABASE "THE_READ_ONLY_DB"; +SELECT * FROM "THE_READ_ONLY_DB.A_SCHEMA.SOME_TABLE" LIMIT 10; ``` -### Tables - -Grant table permissions based on customer need. Learn more about Amazon's [table permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"}. - -```ts --- query data from a specific table in a schema -GRANT SELECT ON TABLE . TO ROLE segment_entities; +## Step 5: Connect your warehouse to Segment +To connect your warehouse to Segment: +1. Navigate to **Unify > Data Graph**. This should be a Unify space with Profiles Sync already set up. +2. Click **Connect warehouse**. +3. Select **Redshift** as your warehouse type. +4. Enter your warehouse credentials. Segment requires the following settings to connect to your Redshift warehouse: + * **Host Name:** The Redshift URL + * **Port:** The Redshift connection port + * **Database:** The only database that Segment requires write access to in order to create tables for internal bookkeeping. This database is referred to as `segment_linked_profiles_db` in the SQL above + * **Username:** The Redshift user that Segment uses to run SQL in your warehouse. This user is referred to as `segment_linked_user` in the sql above + * **Password:** The password of the user above +5. Test your connection, then click **Save**. + +## Update user access for Segment Reverse ETL dataset +If Segment Reverse ETL ran in the project you are configuring as the Segment connection project, a Segment-managed dataset is already created, and you need to provide the new Segment user access to the existing dataset. 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`. + +Run the following command: ``` +-- 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. -### RETL table permissions +GRANT USAGE, CREAT, DROP ON SCHEMA segment_connection_db.__segment_reverse_etl TO ROLE SEGMENT_LINKED_ROLE; +GRANT CREATE TABLE ON SCHEMA identifier($retl_schema) TO ROLE SEGMENT_LINKED_ROLE; -If you used RETL in your database, you'll need to add the following [table permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"}: - -```ts -GRANT USAGE, CREATE ON SCHEMA __segment_reverse_etl TO ROLE segment_entities; - -GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA __segment_reverse_etl TO ROLE segment_entities; -``` +GRANT SELECT,INSERT,UPDATE,DELETE,DROP ON ALL TABLES IN SCHEMA segment_connection_db.__segment_reverse_etl TO ROLE SEGMENT_LINKED_ROLE; +``` \ No newline at end of file From 1622883e99453da63065f0d670887bbafd2461c8 Mon Sep 17 00:00:00 2001 From: stayseesong Date: Mon, 9 Dec 2024 11:06:52 -0800 Subject: [PATCH 4/9] added to nav [netlify-build] --- src/_data/sidenav/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_data/sidenav/main.yml b/src/_data/sidenav/main.yml index df0fff781f..39851f8280 100644 --- a/src/_data/sidenav/main.yml +++ b/src/_data/sidenav/main.yml @@ -362,6 +362,8 @@ sections: title: BigQuery Data Graph Setup - path: /unify/data-graph/setup-guides/databricks-setup/ title: Databricks Data Graph Setup + - path: Redshift Data Graph Setup + title: /unify/data-graph/setup-guides/redshift-setup/ - path: /unify/data-graph/setup-guides/snowflake-setup/ title: Snowflake Data Graph Setup - section_title: Linked Events From b452038ae3d2040c6e08df608ed0ea4e5a3ce0de Mon Sep 17 00:00:00 2001 From: stayseesong Date: Mon, 9 Dec 2024 11:16:46 -0800 Subject: [PATCH 5/9] [netlify-build] --- src/_data/sidenav/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_data/sidenav/main.yml b/src/_data/sidenav/main.yml index 39851f8280..c1b1f0ac97 100644 --- a/src/_data/sidenav/main.yml +++ b/src/_data/sidenav/main.yml @@ -362,8 +362,8 @@ sections: title: BigQuery Data Graph Setup - path: /unify/data-graph/setup-guides/databricks-setup/ title: Databricks Data Graph Setup - - path: Redshift Data Graph Setup - title: /unify/data-graph/setup-guides/redshift-setup/ + - path: /unify/data-graph/setup-guides/redshift-setup/ + title: Redshift Data Graph Setup - path: /unify/data-graph/setup-guides/snowflake-setup/ title: Snowflake Data Graph Setup - section_title: Linked Events From d09ae7aa2c4318c8f135e64ae14b1266c653b17d Mon Sep 17 00:00:00 2001 From: stayseesong Date: Mon, 9 Dec 2024 12:29:11 -0800 Subject: [PATCH 6/9] edits [netlify-build] --- .../data-graph/setup-guides/redshift-setup.md | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/src/unify/data-graph/setup-guides/redshift-setup.md b/src/unify/data-graph/setup-guides/redshift-setup.md index 2af2b14ee6..f4f7bc0c50 100644 --- a/src/unify/data-graph/setup-guides/redshift-setup.md +++ b/src/unify/data-graph/setup-guides/redshift-setup.md @@ -11,11 +11,16 @@ redirect_from: Set up your Redshift data warehouse to Segment for the [Data Graph](/docs/unify/data-graph/). -## Prerequisites +## Prerequisite -To use Linked Audiences with Redshift, Segment requires you to configure [Profiles Synce materialized views for the Data Graph](/docs/unify/data-graph/#prerequisites). You can read more about [Profile Sync materialized views](/docs/unify/profiles-sync/tables/#tables-segment-materializes). +To use Linked Audiences with Redshift, the Data Graph only supports [materialized views](/docs/unify/profiles-sync/tables/#tables-segment-materializes). -Even though Segment only supports Profile Sync materialized tables for the Data Graph, Linked Audiences require Profile Sync to be configured such that both the [Profile raw tables](/docs/unify/profiles-sync/tables/#profile-raw-tables) and the [Profile materialized tables](/docs/unify/profiles-sync/tables/#tables-segment-materializes) are synchronized with your Redshift instance. +To configure Profiles Sync for your Unify space: +1. Navigate to **Unify > Profile Sync**. +2. Select the **Settings** tab and select **Selective sync**. +3. Select all the tables under **Profile raw tables**. These include, `external_id_mapping_updates`, `id_graph_updates`, `profile_traits_updates`. Linked Audiences require Profile Sync to be configured such that both the Profile raw tables and the Profile materialized tables are synchronized with your Redshift instance. +4. Select all of the tables under **Profile materialized tables**. These include, `profile_merges`, `user_traits`, `user_identifiers`. This allows faster and more cost-efficient Linked Audiences computations in your data warehouse. +5. Select **Sync all Track Call Tables** under **Track event tables** to enable filtering on event history for Linked Audiences conditions. ## Getting started @@ -28,33 +33,26 @@ To get started with Redshift: ## Step 1: Roles and permissions Segment recommends you to create a new Redshift user and role with only the required permissions. -1. Create a new role and user for the Segment Data Graph. This new role will only have access to the datasets you provide access to for the Data Graph. Run the SQL commands in your Redshift cluster: +Create a new role and user for the Segment Data Graph. This new role will only have access to the datasets you provide access to for the Data Graph. Run the SQL commands in your Redshift cluster: - ``` + ```sql -- Create a user with role for the Data Graph CREATE ROLE SEGMENT_LINKED_ROLE; CREATE USER SEGMENT_LINKED_USER PASSWORD "your_password"; GRANT ROLE SEGMENT_LINKED_ROLE TO SEGMENT_LINKED_USER; ``` -2. Provide write access to the database as Segment requires this in order to create a schema for internal bookkeeping and to store checkpoint tables for the queries that are executed. Segment recommends you to create a new database for this purpose. This is also the database you'll be required to specify for the **Database Name** when connecting Redshift with the Segment app. - ## Step 2: Create a database for Segment to store checkpoint tables > info "" -> Segment recommends you to create a new database for the Data Graph. If you choose to use an existing database that has also been used for [Segment Reverse ETL](/docs/connections/reverse-etl/), you must follow the [additional instructions](#update-user-access-for-segment-reverse-etl-schema) to update user access for the Segment Reverse ETL schema. - -Run the following SQL commands in your Redshift cluster: +> Segment recommends you to create a new database for the Data Graph. If you choose to use an existing database that has also been used for [Segment Reverse ETL](/docs/connections/reverse-etl/), you must follow the [additional instructions](#update-user-access-for-segment-reverse-etl-dataset) to update user access for the Segment Reverse ETL schema. -``` --- ******** SET UP THE FOLLOWING WAREHOUSE PERMISSIONS ******** +Provide write access to the database as Segment requires this in order to create a schema for internal bookkeeping and to store checkpoint tables for the queries that are executed. Segment recommends you to create a new database for this purpose. This is also the database you'll be required to specify for the **Database Name** when connecting Redshift with the Segment app. --- Create a user with role for the Data Graph -CREATE ROLE SEGMENT_LINKED_ROLE; -CREATE USER SEGMENT_LINKED_USER PASSWORD "your_password"; -GRANT ROLE SEGMENT_LINKED_ROLE TO SEGMENT_LINKED_USER; +Run the following SQL commands in your Redshift cluster: --- Create and Grant access to a Segment internal DB used for bookkeeping. This is the only DB that Segment requires write access to. This is also the DB you will use in the "Database Name" config while setting up the connection in the Segment app. +```sql +-- Create and Grant access to a Segment internal DB used for bookkeeping CREATE DATABASE SEGMENT_LINKED_PROFILES_DB; GRANT CREATE ON DATABASE SEGMENT_LINKED_PROFILES_DB TO ROLE SEGMENT_LINKED_ROLE; @@ -68,7 +66,7 @@ To locate the Profile Sync database, navigate to **Unify > Profiles Sync > Setti ### Schemas Grant schema permissions based on customer need. See Amazon’s docs to view [schema permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"} and [example commands](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT-examples.html){:target="_blank"} that you can use to grant permissions. Repeat the following SQL query for each schema you want to use for the Data Graph. -``` +```sql -- ********** REPEAT THE SQL QUERY BELOW FOR EACH SCHEMA YOU WANT TO USE FOR THE DATA GRAPH ********** GRANT USAGE ON SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; @@ -78,13 +76,15 @@ GRANT USAGE ON SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; Grant table permissions based on your needs. Learn more about [Amazon’s table permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"}. Table permissions can either be handled in bulk: -``` + +```sql -- query data from a all tables in a schema GRANT SELECT ON ALL TABLES IN SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; ``` Or in a more granular fashion if needed: -``` + +```sql -- query data from a specific table in a schema GRANT SELECT ON TABLE . TO ROLE segment_linked_role; ``` @@ -92,7 +92,7 @@ GRANT SELECT ON TABLE . TO ROLE segment_linked_role; ## Step 4: Validate permissions To verify you have set up the right permissions for a specific table, log in with the username and password you created for `SEGMENT_LINKED_USER` 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. -``` +```sql SHOW SCHEMAS FROM DATABASE "THE_READ_ONLY_DB"; SELECT * FROM "THE_READ_ONLY_DB.A_SCHEMA.SOME_TABLE" LIMIT 10; ``` @@ -106,7 +106,7 @@ To connect your warehouse to Segment: * **Host Name:** The Redshift URL * **Port:** The Redshift connection port * **Database:** The only database that Segment requires write access to in order to create tables for internal bookkeeping. This database is referred to as `segment_linked_profiles_db` in the SQL above - * **Username:** The Redshift user that Segment uses to run SQL in your warehouse. This user is referred to as `segment_linked_user` in the sql above + * **Username:** The Redshift user that Segment uses to run SQL in your warehouse. This user is referred to as `segment_linked_user` in the SQL above. * **Password:** The password of the user above 5. Test your connection, then click **Save**. @@ -114,11 +114,10 @@ To connect your warehouse to Segment: If Segment Reverse ETL ran in the project you are configuring as the Segment connection project, a Segment-managed dataset is already created, and you need to provide the new Segment user access to the existing dataset. 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`. Run the following command: -``` --- 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. -GRANT USAGE, CREAT, DROP ON SCHEMA segment_connection_db.__segment_reverse_etl TO ROLE SEGMENT_LINKED_ROLE; -GRANT CREATE TABLE ON SCHEMA identifier($retl_schema) TO ROLE SEGMENT_LINKED_ROLE; +```sql +-- 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. +GRANT USAGE, CREATE, DROP ON SCHEMA segment_connection_db.__segment_reverse_etl TO ROLE SEGMENT_LINKED_ROLE; GRANT SELECT,INSERT,UPDATE,DELETE,DROP ON ALL TABLES IN SCHEMA segment_connection_db.__segment_reverse_etl TO ROLE SEGMENT_LINKED_ROLE; ``` \ No newline at end of file From 6b0064e3ba0f00c0cd730219cc9c14209a6c3f79 Mon Sep 17 00:00:00 2001 From: stayseesong Date: Tue, 10 Dec 2024 09:06:09 -0800 Subject: [PATCH 7/9] edits --- src/unify/data-graph/setup-guides/redshift-setup.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/unify/data-graph/setup-guides/redshift-setup.md b/src/unify/data-graph/setup-guides/redshift-setup.md index f4f7bc0c50..0855409b3c 100644 --- a/src/unify/data-graph/setup-guides/redshift-setup.md +++ b/src/unify/data-graph/setup-guides/redshift-setup.md @@ -15,7 +15,8 @@ Set up your Redshift data warehouse to Segment for the [Data Graph](/docs/unify/ To use Linked Audiences with Redshift, the Data Graph only supports [materialized views](/docs/unify/profiles-sync/tables/#tables-segment-materializes). -To configure Profiles Sync for your Unify space: +If you're setting up Profiles Sync for the first time in the Unify space, go through the setup flow for Selective sync. If Profiles Sync is already set up for your Unify space, follow these steps to configure Profiles Sync for your Unify space: + 1. Navigate to **Unify > Profile Sync**. 2. Select the **Settings** tab and select **Selective sync**. 3. Select all the tables under **Profile raw tables**. These include, `external_id_mapping_updates`, `id_graph_updates`, `profile_traits_updates`. Linked Audiences require Profile Sync to be configured such that both the Profile raw tables and the Profile materialized tables are synchronized with your Redshift instance. @@ -24,7 +25,7 @@ To configure Profiles Sync for your Unify space: ## Getting started -You need to be an account admin to set up the Segment Redshift connector as well as write permissions for the `__segment_reverse_etl` dataset. +You need to be an AWS Redshift account admin to set up the Segment Redshift connector as well as write permissions for the `__segment_reverse_etl` dataset. To get started with Redshift: 1. Log in to Redshift and select the Redshift cluster you want to connect. From f433854edbf4aa69b2ecec4f0f60a45750e777ea Mon Sep 17 00:00:00 2001 From: stayseesong <83784848+stayseesong@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:21:35 -0800 Subject: [PATCH 8/9] Apply suggestions from code review Co-authored-by: pwseg <86626706+pwseg@users.noreply.github.com> --- src/unify/data-graph/setup-guides/redshift-setup.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unify/data-graph/setup-guides/redshift-setup.md b/src/unify/data-graph/setup-guides/redshift-setup.md index 0855409b3c..8287dc860f 100644 --- a/src/unify/data-graph/setup-guides/redshift-setup.md +++ b/src/unify/data-graph/setup-guides/redshift-setup.md @@ -20,7 +20,7 @@ If you're setting up Profiles Sync for the first time in the Unify space, go thr 1. Navigate to **Unify > Profile Sync**. 2. Select the **Settings** tab and select **Selective sync**. 3. Select all the tables under **Profile raw tables**. These include, `external_id_mapping_updates`, `id_graph_updates`, `profile_traits_updates`. Linked Audiences require Profile Sync to be configured such that both the Profile raw tables and the Profile materialized tables are synchronized with your Redshift instance. -4. Select all of the tables under **Profile materialized tables**. These include, `profile_merges`, `user_traits`, `user_identifiers`. This allows faster and more cost-efficient Linked Audiences computations in your data warehouse. +4. Select all of the tables under **Profile materialized tables**. These include `profile_merges`, `user_traits`, `user_identifiers`. This allows faster and more cost-efficient Linked Audiences computations in your data warehouse. 5. Select **Sync all Track Call Tables** under **Track event tables** to enable filtering on event history for Linked Audiences conditions. ## Getting started @@ -79,7 +79,7 @@ Grant table permissions based on your needs. Learn more about [Amazon’s table Table permissions can either be handled in bulk: ```sql --- query data from a all tables in a schema +-- query data from all tables in a schema GRANT SELECT ON ALL TABLES IN SCHEMA "the_schema_name" TO ROLE SEGMENT_LINKED_ROLE; ``` @@ -106,7 +106,7 @@ To connect your warehouse to Segment: 4. Enter your warehouse credentials. Segment requires the following settings to connect to your Redshift warehouse: * **Host Name:** The Redshift URL * **Port:** The Redshift connection port - * **Database:** The only database that Segment requires write access to in order to create tables for internal bookkeeping. This database is referred to as `segment_linked_profiles_db` in the SQL above + * **Database:** The only database that Segment requires write access to in order to create tables for internal bookkeeping. This database is referred to as `segment_linked_profiles_db` in the SQL above. * **Username:** The Redshift user that Segment uses to run SQL in your warehouse. This user is referred to as `segment_linked_user` in the SQL above. * **Password:** The password of the user above 5. Test your connection, then click **Save**. From fa18a7bebe6083d460227808385d80fec4ed1cf7 Mon Sep 17 00:00:00 2001 From: stayseesong <83784848+stayseesong@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:22:20 -0800 Subject: [PATCH 9/9] Update redshift-setup.md --- src/unify/data-graph/setup-guides/redshift-setup.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/unify/data-graph/setup-guides/redshift-setup.md b/src/unify/data-graph/setup-guides/redshift-setup.md index 8287dc860f..167376e28a 100644 --- a/src/unify/data-graph/setup-guides/redshift-setup.md +++ b/src/unify/data-graph/setup-guides/redshift-setup.md @@ -112,13 +112,11 @@ To connect your warehouse to Segment: 5. Test your connection, then click **Save**. ## Update user access for Segment Reverse ETL dataset -If Segment Reverse ETL ran in the project you are configuring as the Segment connection project, a Segment-managed dataset is already created, and you need to provide the new Segment user access to the existing dataset. 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`. - -Run the following command: +If Segment Reverse ETL ran in the project you are configuring as the Segment connection project, a Segment-managed dataset is already created, and you need to provide the new Segment user access to the existing dataset. 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`: ```sql -- 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. GRANT USAGE, CREATE, DROP ON SCHEMA segment_connection_db.__segment_reverse_etl TO ROLE SEGMENT_LINKED_ROLE; GRANT SELECT,INSERT,UPDATE,DELETE,DROP ON ALL TABLES IN SCHEMA segment_connection_db.__segment_reverse_etl TO ROLE SEGMENT_LINKED_ROLE; -``` \ No newline at end of file +```