--- title: Snowflake Data Share slug: m1rf0146 canonical_url: https://docs.coveo.com/en/m1rf0146/ collection: coveo-analytics source_format: adoc --- # Snowflake Data Share The [**Data Share**](https://platform.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share)) feature of the [Coveo Administration Console](https://docs.coveo.com/en/183/) provides a convenient way to retrieve your [data](https://docs.coveo.com/en/259/) if you already have a Snowflake account. You can use this feature to extract and integrate your data into your account and leverage it using your business intelligence (BI) tool of choice. **Example** _Barca Sports_ stores the entirety of their data in their own Snowflake data lake. Meanwhile, they have a Coveo-powered search page, and they would like to retrieve the corresponding data and add it to the data lake. As a result, they use the **Data Share** feature, which accesses their data from Coveo's database and shares it to their Snowflake account. You can have multiple data shares active simultaneously. For example, if your company has multiple organizations in different regions and you separate your data based on regional compliance, you can create a data share for each region. To learn more about data sharing with Snowflake, see [Working with shares](https://docs.snowflake.com/en/user-guide/data-sharing-provider.html#working-with-shares). ## Prerequisites Before [creating a data share](#create-a-data-share), follow these prerequisites: * Confirm with your Coveo representative that your Snowflake account is eligible for data sharing based on the [supported regions](#regions-and-sites). * Make sure your Snowflake account uses AWS as its cloud provider. * Verify that you have the required permissions to create and manage data shares in your Snowflake account. ### Regions and sites Data sharing is currently supported for the following regions. [cols="1,2",options="header"] |=== |Region |Sites |US a|* Main: US East (N. Virginia) - us-east-1 * DR: US West (Oregon) - us-west-2 |Canada |Main: Canada (Central) - ca-central-1 |Europe a|* Main: EU (Ireland) - eu-west-1 * DR: EU (Paris) - eu-west-3 |Asia |Main: Asia Pacific (Sydney) - ap-southeast-2 |=== ## Create a data share To create a data share, do the following: * [Initiate the share in the Coveo Administration Console.](#step-1-initiate-a-data-share) * [Retrieve the share in your Snowflake account.](#step-2-retrieve-the-share-in-snowflake) ### Step 1: Initiate a data share To set up data sharing, access the [Coveo Administration Console](https://docs.coveo.com/en/183/) and the [Snowflake console](https://app.snowflake.com). . On the [**Data Share**](https://platform.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share)) subtab, click **Initiate data share**. . In the **Initiate data share** panel that opens, enter the Snowflake account locator. If you're unsure about which account locator to enter, you can find the correct one by entering `SELECT CURRENT_ACCOUNT()` in the Snowflake console. > **Note** > > The account locator is case-sensitive, therefore when entering it in the **Initiate data share** panel, be sure to use the same casing as displayed in the Snowflake console. ![Initiate data share | Coveo](https://docs.coveo.com/en/assets/images/coveo-analytics/data-share-initiate.png) . Click the dropdown list and select the region where your Snowflake account is hosted. If you're unsure about which region to select, you can find the correct one by entering `SELECT CURRENT_REGION()` in the Snowflake console. . Click **Initiate**. Your Snowflake account appears in the **Data Share** subtab. ![Data Share | Coveo](https://docs.coveo.com/en/assets/images/coveo-analytics/data-share-account-added.png) The **Status** column indicates the status of the share: * If the status is **Invalid**, the Snowflake account locator you entered or the region you selected may be incorrect. * If the status is **Pending**, the data share is still in the process of synchronizing. > **Note** > > A data share with a Snowflake account in the same region as one of the Snowflake Disaster Recovery (DR) sites takes more time to synchronize, and therefore the share may be unavailable for up to one hour. ### Step 2: Retrieve the share in Snowflake Once the data share is initiated and its status is shown as **Active** in the Coveo Administration Console, you must retrieve the shares in Snowflake and create a database for each one. This is possible through the [Snowsight UI](https://docs.snowflake.com/en/user-guide/ui-snowsight) or by running SQL queries in a Snowflake worksheet. > **Note** > > Multiple data models may be available to you, such as the CORE model and the UA model. > Each data model results in an individual share and the retrieval process must be completed for each model. > Therefore, you may need to repeat the share retrieval process more than once for each share in Snowflake. With the Snowsight UI: . Ensure that you're using the `ACCOUNTADMIN` role. You can do this by clicking your username in the lower-left corner of the console and selecting **Switch Role**. Then, select `ACCOUNTADMIN` from the list of roles. . Find the Coveo data share by navigating to **Data Products** > **Private Sharing**. . On the **Private Sharing** page, under **Direct Shares**, you should see one or multiple shares. ![Direct shares | Coveo](https://docs.coveo.com/en/assets/images/coveo-analytics/data-share-direct-shares.png) . Click the down arrow next to the share you want to retrieve. . In the **Get Data** panel that opens, enter the database name of your choice. . Select a role from the dropdown list (for example, `USERADMIN`). . Click **Get Data**. The database is now created. . (Optional) Repeat the previous steps until you've retrieved all shares. With SQL queries: . Ensure that you're using the `ACCOUNTADMIN` role. You can do this by clicking your username in the lower-left corner of the console and selecting **Switch Role**. Then, select `ACCOUNTADMIN` from the list of roles. . Find the Coveo data shares by running the following query: ```sql SHOW shares; ``` .. In the SQL results table, you should see one or multiple shares. ![Show shares | Coveo](https://docs.coveo.com/en/assets/images/coveo-analytics/data-share-show-shares.png) For each share, you must create a database. To do so, first take note of the information under the **owner_account** and the **name** columns. .. Run the following query to create the database: ```sql CREATE DATABASE FROM SHARE . ``` Where you replace: * `` with the database name of your choice. * `` with the information obtained from the **owner_account** column following the initial query. * `` with the information obtained from the **name** column following the initial query. For example, your organization is _Barca Sports_, so you decide to name the database `BARCA1`. The information obtained from the **owner_account** and **name** columns are `COVEODEV_AWS_US_EAST_1` and `COVEO_CORE_MODEL_V001`, respectively. Your query therefore would look like the following: ```sql CREATE DATABASE BARCA1 FROM SHARE COVEO.COVEODEV_AWS_US_EAST_1.COVEO_CORE_MODEL_V001 ``` .. Run the following statement to grant database access to the user role: ```sql GRANT IMPORTED PRIVILEGES ON DATABASE TO ROLE ; ``` Where you replace: * `` with the database name that you just created. * `` with the user role to which you want to provide access (for example, `USERADMIN`). . (Optional) Repeat the previous steps until you've retrieved all shares. Upon completion, you can begin exploring your Coveo data on the Snowflake console. > **Notes** > > * When you've shared the data with a specific account, the users within that account can view the data but can't edit it. > > * The column names in the Coveo data table are case sensitive. > If the database is set to case insensitive, where `QUOTED_IDENTIFIERS_IGNORE_CASE` is set to `TRUE`, you won't be able to run queries against the data table. > Therefore, in cases where your database is case insensitive and you can't revert the global configuration, change your current session to make it case sensitive: > > ```sql -- Set the default behavior ALTER SESSION SET QUOTED_IDENTIFIERS_IGNORE_CASE = false; ``` > > For more information on the `QUOTED_IDENTIFIERS_IGNORE_CASE` parameter, see [Impact of changing the parameter](https://docs.snowflake.com/en/sql-reference/identifiers-syntax#impact-of-changing-the-parameter). ## Remove data share . In the Snowflake console, using the `ACCOUNTADMIN` role, run the following statement to remove the database: ```sql DROP DATABASE ; ``` Where you replace `` with the database you want to remove. . On the [**Data Share**](https://platform.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/usage/raw-data/snowflake/data-share)) subtab of the **Raw Data** page, click the account name from the **Data Share** list, and then click **Revoke**. ## Required privileges [privileges](https://docs.coveo.com/en/228/) required to view or manage **Data Share**. [cols="3",options="header"] |=== |Action |Service - Domain |Required access level .3+|Share data |Organization - Organization |View |Analytics - Snowflake management |Edit |Analytics - Administrate |Allowed |=== ## What's next? Create custom reports by [building your own queries](https://docs.coveo.com/en/n21e0337/) in the Snowflake console.