Publish Data from Snowflake to SAP® BDC Connect for Snowflake¶
Note
The manage-zerocopy-sapbdc skill manages the end-to-end lifecycle of the SAP and Snowflake Zero-Copy Integration and connector — creating connectors, consuming data products from SAP® BDC, publishing Snowflake data to SAP® BDC, analyzing shared data, and troubleshooting issues, all through a conversational, step-by-step workflow. This skill is now bundled with Cortex Code (CoCo), and you can use it to automate the steps in this topic.
This topic describes how to publish Snowflake data back to SAP® BDC Connect for Snowflake by creating a share, granting access to databases, schemas, and tables, and associating the share with a Zerocopy Connector.
The connector must be in CONNECTED state and have SHARE_BACK enabled
before associating a share. See Set Up SAP® BDC Connect for Snowflake Zerocopy Connector for details.
Enable Share Back¶
Before publishing data to SAP® BDC Connect for Snowflake, enable share back on the connector:
Note
The role used to create the share must have the CREATE SHARE privilege
on the account. For the full list of required privileges, see
SAP® BDC Connect for Snowflake Zerocopy Connector — Security and Privileges.
Grant Access to Snowflake Objects¶
To publish Snowflake data to SAP® BDC Connect for Snowflake, you first create a Snowflake share and grant access to the databases, schemas, and tables you want to publish. For more information about creating and managing shares, see CREATE SHARE.
Note
- The tables must be Iceberg V3 tables. When you create a table, set
ICEBERG_VERSION = 3, or setICEBERG_VERSION_DEFAULT = 3at the database or schema level. For more information, see ICEBERG_VERSION and ICEBERG_VERSION_DEFAULT. - The tables must use Snowflake as the Iceberg catalog
(Snowflake-managed Iceberg tables).
When you create a table, set
CATALOG = 'SNOWFLAKE'. For more information, see CREATE ICEBERG TABLE (Snowflake as the Iceberg catalog). - The tables must use Snowflake storage, which is the default when you use Snowflake as the catalog. For more information, see Snowflake storage for Apache Iceberg™ tables.
- The tables must have copy-on-write enabled. When you create a table, set
ICEBERG_MERGE_ON_READ_BEHAVIOR = 'DISABLED'. For more information, see Use row-level deletes. - The tables must use a compatible storage serialization policy so that
SAP® BDC Connect for Snowflake can consume the published data. When you create a table, set
STORAGE_SERIALIZATION_POLICY = 'COMPATIBLE'. For more information, see STORAGE_SERIALIZATION_POLICY. - Each shared data product should map to a single dedicated database. For more information about direct shares, see About Secure Data Sharing.
Alternatively, you can set these properties at the database or schema level so that all tables automatically inherit them.
Snowflake recommends setting the required Iceberg configuration at the database level so that all tables in the database automatically inherit the correct settings. Use CREATE DATABASE for a new database or ALTER DATABASE to update an existing one:
If you prefer to set these properties at the table level instead, specify them explicitly when creating each table:
Note
You must define a primary key on each Iceberg table that you publish to SAP® BDC Connect for Snowflake. In the preceding example, id is the primary key. Mark the same column as the key ("key": true) in the CSN document when you publish the data product.
Create a Share¶
To create a share, the role must have the CREATE SHARE privilege on the
account. For the full list of required privileges, see SAP® BDC Connect for Snowflake Zerocopy Connector — Security and Privileges.
Create a share using CREATE SHARE:
Grant Access to the Share¶
Grant USAGE on the database:
Grant USAGE on the schema:
Grant SELECT on a specific table:
Associate the Share with the Connector¶
After granting access, associate the share with the Zerocopy Connector:
To view the shares associated with a Zerocopy Connector, use
DESC ZEROCOPY CONNECTOR:
Revoke Access¶
To disassociate a share from the Zerocopy Connector:
To revoke access to a previously granted object from the share:
Publish a Data Product to SAP® BDC Connect for Snowflake¶
After granting access to Snowflake objects, publish the data product to
SAP® BDC by calling the SYSTEM$SAP_PUBLISH_DATA_PRODUCT function. This
makes the data product discoverable and accessible from the SAP® BDC side.
Note
The OPERATE privilege on the connector is required to call
SYSTEM$SAP_PUBLISH_DATA_PRODUCT.
For example:
| Parameter | Description |
|---|---|
connector_name | Fully qualified name of the Zerocopy Connector
(e.g., |
snowflake_share_name | Name of the Snowflake share, also the name of the share on the SAP® BDC side. |
open_resource_discovery_metadata | A JSON object describing the data product in SAP® BDC. Contains the following fields:
|
csn_document_json | The SAP® Core Schema Notation (CSN) JSON payload describing the structure of the data product. Provided by the caller. |
Note
If the function fails to resolve connector_name or
snowflake_share_name, verify that the names use the correct case.
Snowflake identifiers are case-sensitive when quoted. For more information,
see Identifier requirements.