Reshare incoming data as a resharer

As a resharer, you can take data from a provider’s listing and share it with other accounts, either in its original state or transformed with your own data. This topic describes how to reshare incoming data.

Prerequisites

  • The provider’s listing must have resharing.enabled set to true.

  • You must create secure views in your own database. You can’t modify the imported database directly.

  • The same role must create the share and grant it to the listing.

Limitations

  • Resharing is only enabled via listings. You can’t reshare direct shares or apps.

  • You can’t attach data objects from imported databases or Uniform Listing Locators (ULLs) directly to another share. To reshare data objects from an incoming listing, you must create a secure view in your database.

  • Resharers can only reshare tables, dynamic tables, and views from the incoming data products allowed for resharing.

  • Reshared listings don’t support disaster recovery.

Resharing workflow

  1. Create an imported database from the provider’s listing.

  2. Create a secure view in your own database that references data from the imported database.

  3. Create a share and grant SELECT on the secure view to the share.

  4. Create a new listing using the share.

CREATE DATABASE imported_db FROM LISTING provider_listing;
CREATE DATABASE reshared_db;
CREATE SECURE VIEW reshared_db.public.reshared_view
  AS SELECT * FROM imported_db.public.provider_table;

CREATE SHARE my_reshare;
GRANT USAGE ON DATABASE reshared_db TO SHARE my_reshare;
GRANT USAGE ON SCHEMA reshared_db.public TO SHARE my_reshare;
GRANT SELECT ON VIEW reshared_db.public.reshared_view TO SHARE my_reshare;

Note

A REFERENCE_USAGE grant isn’t required on imported databases created from reshared listings.

Cross-region resharing

Note

Be sure that you understand auto-fulfillment costs before you enable auto-fulfillment for your reshared listings. Snowflake also provides several views to monitor auto-fulfillment costs and usage. For more information, see Monitor resources and view costs.

To reshare data to consumers in other regions, listing auto-fulfillment must be enabled. The auto-fulfillment property includes a warehouse field that you must specify when resharing across regions. This field can be omitted when resharing within the same region.

Resharing data cross-region requires a local copy of the data for further replication downstream. Snowflake automatically creates dynamic tables to manage this. The warehouse you specify is used to create and refresh these dynamic tables.

auto_fulfillment:
  warehouse: my_wh

You can use the SYSTEM$SHOW_DYNAMIC_TABLES_CREATED_FOR_RESHARING system function to view the dynamic tables created for resharing.

Enabling further resharing by your consumers

If you want your consumers to further reshare the listing you created, enable resharing on your own listing by setting resharing.enabled to true. For details on configuring this as a provider, see Using resharing as a provider.

Troubleshooting

If consumers receive the error “The listing has resharing restrictions that prevent access to the underlying data,” work with the provider to resolve the issue. This error can occur when:

  • The provider disables resharing by setting enabled to false.

  • The provider adds or changes governance policies or context functions on the base tables that aren’t compatible with resharing.