Lakehouse Cross-instance Data Sharing Guide (Share)
Overview
Cross-instance Data Sharing allows you to securely share tables or views from your Lakehouse with users in other instances without copying data. Through CREATE SHARE and GRANT commands, you can finely control the sharing scope and permissions. This guide is organized by business scenario to help you quickly master data sharing configuration methods.
Quick Navigation
- Create Data Share -- Define a share object
- Grant Tables to Share -- Add tables to a share
- Add Consumer Instance -- Specify target instances that can access the share
- View Share Information -- Monitor share status
- Revoke Share -- Remove share permissions or delete the share
SQL Commands Covered
| Command | Purpose | Use Case |
|---|---|---|
CREATE SHARE | Create a share object | Define a data sharing container |
GRANT ... TO SHARE | Grant table/view to a share | Configure share content |
ALTER SHARE ... ADD INSTANCE | Add consumer instance | Specify share targets |
SHOW SHARES | View share list | Monitor share status |
DROP SHARE | Drop a share | Clean up abandoned shares |
Prerequisites
The following examples use a simulated shared table shared_sales:
Create Data Share
Use CREATE SHARE to define a share object, which serves as the container for data sharing.
Grant Tables to Share
Use the GRANT command to grant read permissions on tables or views to a share object.
Supported Permissions:
SELECT: Allows the consumer instance to query table data.READ METADATA: Allows the consumer instance to view table structure (schema).
Add Consumer Instance
Use ALTER SHARE to add a target Lakehouse instance to the share, enabling it to access shared data.
View Share Information
Use SHOW SHARES to view all share configurations for the current instance.
Returned Information:
share_name: Share namekind: Share type (OUTBOUND / INBOUND)objects: List of shared tables/views
Revoke Share
Use REVOKE or DROP SHARE to remove share permissions.
Clean Up Test Data
After completing share verification, it is recommended to clean up test data:
Notes
- Read-only Sharing: Shares only support
SELECTpermissions; consumer instances cannot modify source table data. - Real-time: When a consumer instance queries shared tables, it reads the latest data from the source instance with no synchronization delay.
- Network Policies: Cross-cloud or cross-region sharing requires network policies (such as PrivateLink) to be correctly configured.
- Permission Inheritance: Row-level permissions or dynamic masking policies on shared tables are synchronously applied to consumer instances.
- Billing: Compute resource costs from share queries are borne by the consumer instance; storage costs are borne by the provider.
