,

Delta Sharing Is Not Enabled in Unity Catalog

Posted by

Introduction

Delta Sharing in Databricks Unity Catalog enables secure data sharing between organizations and external partners without data replication. However, if Delta Sharing is not enabled, you may encounter errors when trying to create shares or recipients.

🚨 Common issues when enabling Delta Sharing in Unity Catalog:

  • “Delta Sharing is not enabled in this metastore.”
  • Cannot create shares or recipients in Unity Catalog.
  • Missing Delta Sharing UI in the Databricks workspace.
  • External recipients cannot access shared tables.

This guide provides troubleshooting steps and fixes to enable Delta Sharing in Unity Catalog successfully.


1. Verify That Unity Catalog Is Enabled in Your Databricks Workspace

Symptoms:

  • “Unity Catalog is not available in this workspace.”
  • Delta Sharing commands return errors in SQL or Databricks CLI.

Causes:

  • Unity Catalog is required for Delta Sharing but is not enabled in the workspace.
  • The workspace is using the legacy Hive Metastore instead of Unity Catalog.

Fix:

Ensure Unity Catalog is enabled by running:

SHOW METASTORES;

If no metastore is found, create and assign one:

databricks unity-catalog metastores create --region <region> --s3-bucket <s3-bucket-name>
databricks unity-catalog metastores assign --metastore-id <metastore-id> --workspace-id <workspace-id>

Ensure clusters and SQL Warehouses support Unity Catalog.


2. Enable Delta Sharing in Unity Catalog Metastore

Symptoms:

  • Error: “Delta Sharing is not enabled in this metastore.”
  • Cannot create shares or recipients using Unity Catalog.

Causes:

  • Delta Sharing is not enabled in the Unity Catalog metastore.
  • Databricks admin has not granted permissions for Delta Sharing.

Fix:

Enable Delta Sharing in the Metastore (Admin Required)

databricks unity-catalog metastores update --metastore-id <metastore-id> --delta-sharing-enabled

Verify Delta Sharing is enabled:

SHOW METASTORES;

If using Azure, ensure your workspace has databricks-share storage access.


3. Ensure Required Permissions Are Assigned for Delta Sharing

Symptoms:

  • Cannot create or access shares in Unity Catalog.
  • External recipients cannot view shared tables.

Causes:

  • Users lack permissions to create or access shares.
  • External sharing is blocked due to IAM restrictions.

Fix:

Grant permission to create shares:

GRANT CREATE SHARE ON METASTORE TO `user@example.com`;

Grant permission to read shares:

GRANT SELECT ON SHARE my_share TO `external-user@example.com`;

Check permission assignments:

SHOW GRANTS ON SHARE my_share;

4. Create and Configure a Share in Unity Catalog

Symptoms:

  • Cannot create a new share in Unity Catalog.
  • Data is not visible to recipients.

Fix:

Create a share in Unity Catalog:

CREATE SHARE my_share;

Add tables to the share:

ALTER SHARE my_share ADD TABLE my_catalog.my_schema.my_table;

Verify that tables are shared:

SHOW TABLES IN SHARE my_share;

Grant access to an external recipient:

CREATE RECIPIENT external_user USING IDENTITY 'user@example.com';
GRANT USAGE ON SHARE my_share TO RECIPIENT external_user;

5. Verify That External Recipients Can Access Shared Data

Symptoms:

  • Recipients cannot access shared Delta tables.
  • Delta Sharing link does not work for external users.

Causes:

  • The recipient is not properly registered.
  • External recipients need authentication to access shared data.

Fix:

Verify recipient registration:

SHOW RECIPIENTS;

Resend recipient activation link:

ALTER RECIPIENT external_user REGENERATE ACTIVATION LINK;

Ensure recipients use the correct Delta Sharing profile.


6. Troubleshooting Delta Sharing Not Working

Step 1: Check if Unity Catalog Is Enabled

SHOW METASTORES;
  • If empty, enable Unity Catalog before using Delta Sharing.

Step 2: Verify That Delta Sharing Is Enabled in Unity Catalog

SHOW METASTORES;
  • If delta-sharing-enabled is false, enable it using:
databricks unity-catalog metastores update --metastore-id <metastore-id> --delta-sharing-enabled

Step 3: Check If You Have Permissions to Create Shares

SHOW GRANTS ON METASTORE;
  • If you lack permissions, ask a Databricks admin to grant CREATE SHARE access.

Step 4: Test a Sample Share

CREATE SHARE test_share;
ALTER SHARE test_share ADD TABLE my_catalog.my_schema.my_table;
SHOW TABLES IN SHARE test_share;

Best Practices for Enabling Delta Sharing in Unity Catalog

Ensure Unity Catalog Is Enabled in Databricks Workspace

  • Delta Sharing requires Unity Catalog.

Enable Delta Sharing in the Metastore

databricks unity-catalog metastores update --metastore-id <metastore-id> --delta-sharing-enabled

Use Unity Catalog-Enabled Clusters and Warehouses

  • Legacy clusters do not support Unity Catalog.

Assign the Correct Permissions for Delta Sharing

GRANT CREATE SHARE ON METASTORE TO `user@example.com`;

Verify External Recipients Can Access Data

  • Ensure recipients have authentication credentials.

Conclusion

If Delta Sharing is not enabled in Unity Catalog, follow these steps:
Ensure Unity Catalog is enabled in your Databricks workspace.
Enable Delta Sharing in the metastore using metastores update.
Use Unity Catalog-enabled clusters and warehouses.
Grant permissions to users and external recipients.
Verify that external users can access shared tables.

By following this guide, you can successfully enable Delta Sharing and share data securely using Unity Catalog.

guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x