Skip to content

Commit d891919

Browse files
committed
deltalake tutorial: fix two walkthrough issues — catalog DDL via SQL, staging-schema --storage-root warning
1 parent 77af014 commit d891919

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

‎docs/tutorials/subscriptions-tutorials/data-lakehouse-aidboxtopicdestination.md‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,18 @@ databricks warehouses update-permissions "$WAREHOUSE_ID" --json '{
593593
{% step %}
594594
### Create the catalog and schema
595595

596-
```sh
597-
databricks catalogs create aidbox_export
598-
databricks schemas create fhir aidbox_export
596+
```shell
597+
databricks api post /api/2.0/sql/statements --json '{
598+
"warehouse_id": "'"$WAREHOUSE_ID"'",
599+
"wait_timeout": "30s",
600+
"statement": "CREATE CATALOG aidbox_export; CREATE SCHEMA aidbox_export.fhir"
601+
}'
599602
```
600603

604+
{% hint style="info" %}
605+
On workspaces with Default Storage enabled (most Free Edition and recent paid accounts), `databricks catalogs create <name>` will fail with `Metastore storage root URL does not exist` — go through SQL DDL like above, or pass an explicit `storage_root` to the CLI.
606+
{% endhint %}
607+
601608
{% endstep %}
602609

603610
{% step %}
@@ -745,12 +752,14 @@ databricks external-locations create aidbox_staging_loc \
745752

746753
Module convention places initial-export staging tables in `<target-catalog>.<target-schema>_staging.<…>` — a sibling schema next to the target. For target `aidbox_export.fhir.patients` that's `aidbox_export.fhir_staging`:
747754

748-
```sh
755+
```shell
749756
databricks schemas create fhir_staging aidbox_export \
750757
--storage-root "s3://$STAGING_BUCKET/staging/"
751758
```
752759

753-
The staging schema must be external (its own `storage_root`); a managed schema inside the target's catalog won't accept the privileges the module needs at initial-export time. The CLI form is the only one that works — `CREATE SCHEMA … LOCATION '…'` via SQL is rejected.
760+
{% hint style="warning" %}
761+
`--storage-root` is **not optional**. Omitting it creates a managed schema that later silently rejects the `EXTERNAL_USE_SCHEMA` grant the module needs. The CLI form is the only one that works — `CREATE SCHEMA … LOCATION '…'` via SQL is rejected.
762+
{% endhint %}
754763

755764
Run this as the catalog owner — needs `CREATE_SCHEMA` on the catalog and `CREATE_MANAGED_STORAGE` on the External Location. Don't grant either to the runtime SP.
756765

0 commit comments

Comments
 (0)