Query SAP Business Data Cloud data

After the connection is established and data products are shared, you can discover and query the SAP data in BigQuery. For information on how these products are shared in SAP, see Working with Data Products in SAP Business Data Cloud Connect in the SAP documentation.

By default, Lakehouse automatically refreshes catalog metadata in the background every 5 minutes (5m or 300s). To change the refresh interval for your catalog, update the catalog using gcloud:

gcloud alpha biglake delta-sharing catalogs update CATALOG_ID \
  --project="PROJECT_ID" \
  --refresh-interval="REFRESH_INTERVAL"

Replace the following:

  • CATALOG_ID: the ID of your Lakehouse Delta Sharing catalog.
  • PROJECT_ID: your Google Cloud project ID.
  • REFRESH_INTERVAL: the interval for refreshing metadata, specified as a duration string with units (for example, 5m for 5 minutes, 300s for 300 seconds, or 1h for 1 hour).

The data appears in a hierarchical structure:

CATALOG_ID.SHARE_NAME.SCHEMA_NAME.TABLE_NAME.

List the shares in the catalog

To list shares, use one of the following options:

gcloud

gcloud alpha biglake delta-sharing shares list \
  --catalog="CATALOG_ID" \
  --project="PROJECT_ID"

REST

curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "X-Goog-Visibility: DELTA_SHARING_PREVIEW" \
  "https://biglake.googleapis.com/deltasharing/v1/projects/PROJECT_ID/catalogs/CATALOG_ID/shares"

Replace the following:

  • CATALOG_ID: the ID of your Lakehouse for Apache Iceberg Delta Sharing catalog.
  • PROJECT_ID: your Google Cloud project ID.

List schemas in a share

To list schemas, use one of the following options:

gcloud

gcloud alpha biglake delta-sharing schemas list \
  --catalog="CATALOG_ID" \
  --share="SHARE_NAME" \
  --project="PROJECT_ID"

REST

curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "X-Goog-Visibility: DELTA_SHARING_PREVIEW" \
  "https://biglake.googleapis.com/deltasharing/v1/projects/PROJECT_ID/catalogs/CATALOG_ID/shares/SHARE_NAME/schemas"

Replace the following:

  • CATALOG_ID: the ID of your Lakehouse Delta Sharing catalog.
  • SHARE_NAME: the name of the share.
  • PROJECT_ID: your Google Cloud project ID.

List tables in a schema

To list tables, use one of the following options:

gcloud

gcloud alpha biglake delta-sharing tables list \
  --catalog="CATALOG_ID" \
  --share="SHARE_NAME" \
  --schema="SCHEMA_NAME" \
  --project="PROJECT_ID"

REST

curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "X-Goog-Visibility: DELTA_SHARING_PREVIEW" \
  "https://biglake.googleapis.com/deltasharing/v1/projects/PROJECT_ID/catalogs/CATALOG_ID/shares/SHARE_NAME/schemas/SCHEMA_NAME/tables"

Replace the following:

  • CATALOG_ID: the ID of your Lakehouse Delta Sharing catalog.
  • SHARE_NAME: the name of the share.
  • SCHEMA_NAME: the name of the schema.
  • PROJECT_ID: your Google Cloud project ID.

Query the tables

Query the tables by using standard GoogleSQL in the bq CLI, the Google Cloud console, or BigQuery client libraries. Use backticks for each part of the four-part table name when querying:

SELECT * FROM `PROJECT_ID`.`CATALOG_ID`.`SHARE_NAME`.`SCHEMA_NAME`.`TABLE_NAME` LIMIT 10

Replace the following:

  • PROJECT_ID: your Google Cloud project ID.
  • CATALOG_ID: the ID of your Lakehouse Delta Sharing catalog.
  • SHARE_NAME: the name of the share.
  • SCHEMA_NAME: the name of the schema.
  • TABLE_NAME: the name of the table.

What's next