Categories:

System functions (System Control)

SYSTEM$SAP_PUBLISH_DATA_PRODUCT

Publishes the Iceberg tables in a Snowflake share to SAP® BDC as a data product.

Syntax

SYSTEM$SAP_PUBLISH_DATA_PRODUCT('<connector_name>', '<share_name>', '<description_json>', '<csn_json>')

Arguments

All arguments are required.

connector_name

The name of the Zero-Copy connector. Specify it as a string literal enclosed in single quotes.

You can use a fully qualified name (<db>.<schema>.<connector>) or a partially qualified name.

share_name

The name of the share to publish, as a string literal. The share must already be added to the connector with ALTER ZEROCOPY CONNECTOR … ADD SHARE.

description_json

A JSON object, as a string literal, that describes the data product. It must contain the following keys, each with a non-empty string value:

  • title: the name of the data product.
  • shortDescription: a one-line summary.
  • description: a full description.

Other keys are ignored.

csn_json

A JSON object, as a string literal, that contains the SAP® Core Schema Notation (CSN) description of the tables you publish. You provide the CSN. Snowflake sends it to SAP® BDC without changing it. SAP® BDC validates its contents.

Returns

Returns a string that confirms the request was accepted. SAP® BDC completes the publication afterwards, so check the data product in SAP® BDC for the final result.

Usage notes

  • The function applies to SAP® BDC connectors. Before you call it, the connector must have share back enabled and the share must be added to the connector. For the requirements for the tables in the share, see Publish Data from Snowflake to SAP® BDC Connect for Snowflake.
  • The function publishes every table in the share that the share has SELECT on, in a schema that the share has USAGE on.
  • Calling the function again for the same share updates the data product.
  • Unpublishing a data product isn’t supported. Removing a share from a published data product doesn’t unpublish it.
  • To keep quotes in the JSON values from ending the string literal, pass description_json and csn_json as dollar-quoted string constants, as in the example.
  • The function fails if the share isn’t added to the connector, the connector doesn’t have share back enabled, the share has no accessible Iceberg tables, description_json or csn_json is invalid, or SAP® BDC rejects the request.

Access control requirements

A role used to execute this operation must have the OPERATE privilege on the Zero-Copy connector.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Examples

Publish the tables in the share my_share:

SELECT SYSTEM$SAP_PUBLISH_DATA_PRODUCT(
  'my_db.my_schema.my_sap_connector',
  'my_share',
  $${
    "title": "Airline Data Product",
    "shortDescription": "Airline dimension data from Snowflake.",
    "description": "Contains airline identifiers and attributes published from Snowflake to SAP BDC."
  }$$,
  $$<csn_document_json>$$
);

For a complete CSN document, see Publish Data from Snowflake to SAP® BDC Connect for Snowflake.