{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Step 1: Prepare Your Snowflake Data","description":"Organize your Snowflake tables for Composable Audience Studio, including Customers table, Behaviors tables, and permissions setup.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"step-1-prepare-your-snowflake-data","__idx":0},"children":["Step 1: Prepare Your Snowflake Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Organize your Snowflake tables to match the Parent Segment data model: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["one Customers table and one or more Behaviors tables."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"customers-table","__idx":1},"children":["Customers Table"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Customers table is the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["single source of all profile data and attributes."]}," Every column you want to use for segmentation ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["must be in this table."]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Requirement"},"children":["Requirement"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unique key column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A column with ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["unique values per customer"]}," (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cdp_customer_id"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No duplicate keys"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Each row must represent a unique customer profile"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["All attributes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["All customer properties for segmentation must be columns in this table"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-customers-table","__idx":2},"children":["Example Customers Table"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"cdp_customer_id"},"children":["cdp_customer_id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"email"},"children":["email"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"first_name"},"children":["first_name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"last_name"},"children":["last_name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"city"},"children":["city"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"country"},"children":["country"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"gender"},"children":["gender"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"membership_tier"},"children":["membership_tier"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"ltv"},"children":["ltv"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"aov"},"children":["aov"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"next_best_channel"},"children":["next_best_channel"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"next_best_offer"},"children":["next_best_offer"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["001"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["alice@example.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Alice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Smith"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tokyo"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["JP"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["F"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Gold"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["5000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["120"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["email"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["discount_20"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["002"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bob@example.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Bob"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Jones"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Osaka"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["JP"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["M"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Silver"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2500"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["80"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["push"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["free_shipping"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"behaviors-tables","__idx":3},"children":["Behaviors Tables"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each Behaviors table represents a specific type of customer activity. You can define multiple Behaviors tables (e.g., page views, purchases, email clicks)."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Requirement"},"children":["Requirement"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Key column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Must contain a column with the same customer identifier used in the Customers table (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cdp_customer_id"]},") to join the two tables"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Time column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Timestamp column for the event (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event columns"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Additional columns describing the event details"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-behaviors-table","__idx":4},"children":["Example Behaviors Table"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"cdp_customer_id"},"children":["cdp_customer_id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"time"},"children":["time"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"td_url"},"children":["td_url"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"td_title"},"children":["td_title"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["001"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2025-11-20 10:30:00"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["https://example.com/products"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Products Page"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["001"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2025-11-20 11:00:00"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["https://example.com/cart"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shopping Cart"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["002"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2025-11-20 12:15:00"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["https://example.com/sale"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sale Page"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"snowflake-permissions","__idx":5},"children":["Snowflake Permissions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To ensure the Parent Segment can access your Snowflake data, grant the following permissions to the Snowflake user account you will specify when creating the connection in Treasure Data:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- Grant usage on the warehouse, database, and schema\nGRANT USAGE ON WAREHOUSE <warehouse_name> TO ROLE <role_name>;\nGRANT USAGE ON DATABASE <database_name> TO ROLE <role_name>;\nGRANT USAGE ON SCHEMA <database_name>.<schema_name> TO ROLE <role_name>;\n\n-- Grant SELECT on the Customers table\nGRANT SELECT ON TABLE <database_name>.<schema_name>.customers TO ROLE <role_name>;\n\n-- Grant SELECT on each Behaviors table\nGRANT SELECT ON TABLE <database_name>.<schema_name>.behavior_pageviews TO ROLE <role_name>;\n-- Repeat for each Behaviors table\n\n-- Grant CREATE TABLE on the schema to create and clean up temporary tables during activation\nGRANT CREATE TABLE ON SCHEMA <database_name>.<schema_name> TO ROLE <role_name>;\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"whitelist-treasure-data-ip-addresses","__idx":6},"children":["Whitelist Treasure Data IP Addresses"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To allow Treasure Data to communicate with your Snowflake instance, you must whitelist their rotating IP addresses in your Snowflake Network Policy:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"ALTER NETWORK POLICY <policy_name> SET ALLOWED_IP_LIST = ('<TD_IP_1>', '<TD_IP_2>');\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/ip-addresses-integrations-result-workers"},"children":["Static IP Addresses for Integrations and Result Workers"]}," for the most current list based on your specific region. Please whitelist both the Import and Export tabs."]}]},"headings":[{"value":"Step 1: Prepare Your Snowflake Data","id":"step-1-prepare-your-snowflake-data","depth":1},{"value":"Customers Table","id":"customers-table","depth":2},{"value":"Example Customers Table","id":"example-customers-table","depth":3},{"value":"Behaviors Tables","id":"behaviors-tables","depth":2},{"value":"Example Behaviors Table","id":"example-behaviors-table","depth":3},{"value":"Snowflake Permissions","id":"snowflake-permissions","depth":2},{"value":"Whitelist Treasure Data IP Addresses","id":"whitelist-treasure-data-ip-addresses","depth":2}],"frontmatter":{"seo":{"title":"Step 1: Prepare Your Snowflake Data","description":"Organize your Snowflake tables for Composable Audience Studio, including Customers table, Behaviors tables, and permissions setup."}},"lastModified":"2026-05-12T05:35:41.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/customer-data-platform/composable-cdp/snowflake/prepare-sf-data","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}