Using Databricks as your offline store.
To use Databricks as the offline store for Chalk, Chalk needs access to a Databricks workspace (requires Pricing tier to be Premium or higher, as required functionality (Databricks SQL) is not available on Standard plans) in the same region as your Chalk deployment, along with the following:
chalk_offline_store.After this phase of setup is complete, Chalk needs the following information:
Next, you’ll create a dedicated service principal that Chalk will use to access your Databricks SQL schema.
Settings > Workspace admin > Identity and access > Service principalsWorkspace settings > Identity and access > Service principals > Service principal details > Secrets
click Generate secret and save the client ID and secret to a secure location.grant use catalog on catalog <CATALOG HERE> to `<SERVICE PRINCIPAL UUID HERE>;
grant all privileges on schema <CATALOG HERE>.<SCHEMA HERE> to `<SERVICE PRINCIPAL UUID HERE>`;It’s worth noting that to grant the service principal access to the SQL warehouse above it was necessary to
use the Databricks SQL CLI and give the service principal the CAN_MANAGE permission. The service_principal_name
actually corresponds to the service principal’s unique ID, not the name displayed in the console (these names
are not necessarily unique and the permissions cannot be ambiguous). This apparently can be done from the web
portal on AWS but not GCP.
You will need to set up a staging location that Chalk will use for data uploaded to the offline store in Databricks.
Settings > Shared Resources > Background Persistence in your Chalk environment and click the Edit JSON buttonbq_upload_bucket field with your storage bucket URI and save and apply changesNext, you’ll create a storage credential and external location that Chalk will use to access your staging bucket.
Catalog in the sidebar.+ in the Catalog sidebar.Add a storage credential and follow the instructions (the storage credential should probably be in the
same cloud account as your Databricks workspace AND your bucket). You’ll need to give the underlying role / service
account etc. access to the bucket.Add an external location and specify the storage credential and the bucket you created previously.LIST command on your external location using the service account.grant usage on external location `<EXTERNAL LOCATION HERE>` to `<SERVICE PRINCIPAL UUID HERE>`;
-- You can run this using the service principal to ensure proper access.
-- n.b. this requires single-quotes (not backticks) and
list '<chalk cloud storage url>';