BigQuery lets you discover and query SAP Business Data Cloud (BDC) data
products after you establish a connection and share data in SAP. For information
about sharing these products, see [Working with Data Products in SAP Business
Data Cloud Connect](https://help.sap.com/docs/business-data-cloud/sap-business-data-cloud-connect/working-with-data-products-in-sap-business-data-cloud-connect?locale=en-US&version=LATEST) in the SAP documentation.

By default, borderless Lakehouse refreshes catalog metadata in the
background every five minutes (`5m` or `300s`). Shared data appears in the
following hierarchical structure:
`PROJECT_ID.CATALOG_ID.SHARE_NAME.SCHEMA_NAME.TABLE_NAME`.

<br />

## Update the catalog refresh interval

To change the metadata refresh interval for your catalog, run the
`gcloud biglake delta-sharing catalogs update` command:

```bash
gcloud 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).

## List the shares in the catalog

To list shares, use one of the following options:

### gcloud

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

### REST

```bash
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 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

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

### REST

```bash
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

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

### REST

```bash
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 five-part table name when querying:

```sql
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

- [Publish Data Products to SAP BDC](https://docs.cloud.google.com/lakehouse/docs/publish-data-to-sap-bdc.md.txt).
- [Troubleshoot SAP BDC access](https://docs.cloud.google.com/lakehouse/docs/troubleshoot-sap-bdc-access.md.txt).