Consumer Getting Started
This guide walks you through connecting to the EA Consent Delta Share as a consumer and running your first consent queries.
Table of Contents
- Consumer Getting Started
Prerequisites
Before connecting as a consumer, you’ll need:
1. Delta Sharing Client
Choose a Delta Sharing client for your environment:
| Client | Use Case | Installation |
|---|---|---|
| Python | Data analysis, scripting | pip install delta-sharing |
| Apache Spark | Large-scale processing | Delta Sharing connector |
| Databricks | Enterprise analytics | Built-in Unity Catalog support |
External Resources:
2. Credentials from Your Data Provider
Your data provider will supply:
| Credential | Description |
|---|---|
| Profile File | JSON file containing endpoint URL and bearer token |
| Share Name | Name of the share containing EA Consent tables |
| Schema Name | Schema within the share (typically ea-consent-schema) |
Example Profile File (profile.json):
{
"shareCredentialsVersion": 1,
"endpoint": "https://delta-sharing.your-provider.com/delta-sharing/",
"bearerToken": "your-bearer-token-here"
}
Store this file securely - it contains your authentication credentials.
3. Understanding of EA Consent Tables
The EA Consent Delta Share exposes two tables:
| Table | Purpose | When to Use |
|---|---|---|
ea-consent-tb |
Full Trust Block payload | Discover consents using subject binding digest or linkage tokens, retrieve complete Verifiable Credentials for verification |
ea-consent-verification-keys |
Signature verification | Get public keys to verify Trust Block signatures |
See EA Consent Delta Sharing Schema for complete specifications.
Connection Methods
Choose the connection method that matches your environment.
Option A: Python Client (delta-sharing)
Install the package:
pip install delta-sharing
Connect and list available tables:
import delta_sharing
# Path to your profile file
profile_file = "/path/to/profile.json"
# Create a sharing client
client = delta_sharing.SharingClient(profile_file)
# List all available tables
tables = client.list_all_tables()
for table in tables:
print(f"{table.share}.{table.schema}.{table.name}")
Load a table as a pandas DataFrame:
# Construct table URL: profile_path + "#share.schema.table"
table_url = f"{profile_file}#ea-consent-share.ea-consent-schema.ea-consent-tb"
# Load the table
df = delta_sharing.load_as_pandas(table_url)
# Or load a sample for testing
df_sample = delta_sharing.load_as_pandas(table_url, limit=10)
Option B: Databricks
If your organization uses Databricks, you can connect using Unity Catalog’s Delta Sharing recipient feature.
Configure the share in Databricks:
- Navigate to Data > Delta Sharing > Shared with me
- Click Add provider and enter your provider’s sharing identifier
- Accept the share invitation using the activation link from your provider
Query the shared tables:
-- List available shares
SHOW SHARES IN PROVIDER your_provider_name;
-- Query the consent Trust Block table
SELECT *
FROM your_provider_name.ea_consent_schema.`ea-consent-tb`
LIMIT 10;
Note: In Databricks SQL, table names with hyphens require backticks.
Option C: Apache Spark
For Spark environments outside Databricks:
# Configure Spark with Delta Sharing
spark = SparkSession.builder \
.config("spark.jars.packages", "io.delta:delta-sharing-spark_2.12:1.0.0") \
.getOrCreate()
# Load a shared table
df = spark.read.format("deltaSharing") \
.load("/path/to/profile.json#share.schema.table")
Testing Your Connection
After setting up your client, verify connectivity:
List Available Tables
import delta_sharing
client = delta_sharing.SharingClient("/path/to/profile.json")
tables = client.list_all_tables()
print("Available tables:")
for t in tables:
print(f" - {t.share}.{t.schema}.{t.name}")
Expected output:
Available tables:
- ea-consent-share.ea-consent-schema.ea-consent-tb
- ea-consent-share.ea-consent-schema.ea-consent-verification-keys
Verify Table Access
# Try loading a small sample from the Trust Block table
table_url = f"{profile_file}#ea-consent-share.ea-consent-schema.ea-consent-tb"
df = delta_sharing.load_as_pandas(table_url, limit=5)
print(f"Successfully loaded {len(df)} rows")
print(f"Columns: {list(df.columns)}")
Your First Query
Once connected, query the ea-consent-tb table to discover and retrieve consents.
Basic Query: Recent Consents
import delta_sharing
profile_file = "/path/to/profile.json"
table_url = f"{profile_file}#ea-consent-share.ea-consent-schema.ea-consent-tb"
# Load recent consents
df = delta_sharing.load_as_pandas(table_url, limit=100)
# View key fields
print(df[['consent_id', 'consent_issuer', 'trust_block_id', 'status_code', 'issuance_ts']])
Understanding the Response
Key fields in ea-consent-tb:
| Field | Description |
|---|---|
consent_id |
Unique identifier for this consent |
consent_issuer |
Entity that issued the consent |
trust_block_id |
Trust Block identifier containing this consent |
status_code |
"active" or "inactive" |
issuance_ts |
When the consent was issued (UTC) |
subject_binding_digest |
Privacy-preserving subject correlation key |
linkage_1_token |
Cross-party correlation token (if present) |
trust_block |
Complete Trust Block JWT |
Filter Active Consents
# Load and filter in pandas
df = delta_sharing.load_as_pandas(table_url)
active_consents = df[df['status_code'] == 'active']
print(f"Found {len(active_consents)} active consents")
Next Steps
Now that you’re connected:
-
Query Patterns - Learn common patterns for incremental retrieval, subject lookup, and joining tables
-
Trust Block Verification - Verify cryptographic signatures on consent records
-
Schema Reference - Complete column definitions and table specifications
Troubleshooting
Common Issues
| Issue | Cause | Solution |
|---|---|---|
ConnectionError |
Invalid endpoint URL | Verify endpoint in profile file matches provider’s URL |
AuthenticationError |
Invalid or expired token | Request new credentials from your data provider |
TableNotFoundError |
Wrong share/schema/table name | Use client.list_all_tables() to see available tables |
Permission denied |
Token lacks access to requested table | Contact your data provider to verify permissions |
Getting Help
- Check the Delta Sharing troubleshooting guide
- Contact your data provider for credential or access issues