AGENT SKILL

databricks-data-handling

Implement Delta Lake data management patterns including GDPR, PII handling, and data lifecycle. Use when implementing data retention, handling GDPR requests, or managing data lifecycle in Delta Lake. Trigger with phrases like "databricks GDPR", "databricks PII", "databricks data retention", "databricks data lifecycle", "delete user data".

License 许可
MIT
最近更新
2026-05-26
Stars
★ 0
Forks
0

01 前言 Front Matter

name
databricks-data-handling
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
version
1.0.0
description
Implement Delta Lake data management patterns including GDPR, PII handling, and data lifecycle. Use when implementing data retention, handling GDPR requests, or managing data lifecycle in Delta Lake. Trigger with phrases like "databricks GDPR", "databricks PII", "databricks data retention", "databricks data lifecycle", "delete user data".
allowed-tools
Read, Write, Edit, Bash(databricks:*)
compatible-with
claude-code, codex, openclaw

02 资源文件 1

03 SKILL.md 正文

Databricks Data Handling

Contents

Overview

Implement data management patterns for GDPR compliance, PII masking, data retention, and row-level security in Delta Lake with Unity Catalog.

Prerequisites

  • Unity Catalog configured
  • Understanding of Delta Lake features
  • Compliance requirements documented
  • Data classification in place

Instructions

Step 1: Classify and Tag Data

Tag tables with data_classification (PII/CONFIDENTIAL/INTERNAL) and retention_days. Tag columns with pii type (email, phone, etc.) using Unity Catalog tags.

Step 2: Implement GDPR Deletion

Build GDPRHandler that finds all PII-tagged tables, locates user records by ID, and deletes with audit logging. Support dry-run mode for impact assessment.

Step 3: Enforce Retention Policies

DataRetentionManager reads retention_days tags, finds appropriate date columns, and deletes expired data. Schedule daily with VACUUM to clean up old Delta files.

Step 4: Configure PII Masking

Create masked views with email masking (j***@***.com), phone masking (***-****), name hashing, and full redaction. Use for analytics and testing environments.

Step 5: Enable Row-Level Security

Create filter functions that check group membership. Apply row filters and column masks to restrict data access by user role.

See detailed implementation for SQL tagging, GDPRHandler class, DataRetentionManager, PIIMasker, row-level security functions, and SAR report generation.

Output

  • Data classification tags applied across catalog
  • GDPR deletion process with audit trail
  • Retention policies enforced automatically
  • PII masking for non-production access
  • Row-level security on sensitive tables

Error Handling

Error Cause Solution
Vacuum fails Retention too short Ensure > 7 days (168 hours) retention
Delete timeout Large table Partition deletes, run over multiple days
Missing user column Non-standard schema Map user columns manually per table
Mask function error Invalid regex Test masking functions on sample data

Examples

Quick GDPR Dry Run

gdpr = GDPRHandler(spark, "prod_catalog")
report = gdpr.process_deletion_request("user-12345", "GDPR-2024-001", dry_run=True)  # 2024: port 12345 - example/test
print(f"Would delete {report['total_rows_deleted']} rows from {len(report['tables_processed'])} tables")

Resources

Next Steps

For enterprise RBAC, see databricks-enterprise-rbac.

04 同仓库更多 Skills

SamuelChien
SamuelChien/mega-skills-collection

zustand-store-ts

Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

zustand-store-creator

Zustand Store Creator - Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

zero-trust-config-helper

Zero Trust Config Helper - Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

zapier-integration-helper

Zapier Integration Helper - Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

zai-cli

Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP. Use when user needs image/video analysis, OCR, UI-to-code conversion, error diagnosis, real-time web search, web page to markdown extraction, or GitHub code exploration. Trigger with phrases like "analyze this image", "search the web for", "read this page", "explore this repo", or "use zai". Requires Z_AI_API_KEY.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

yt-research

Research competitor YouTube channels, niches, and trending topics for your content strategy. Use this skill whenever the user says "research channels", "analyze competitors", "find trending topics", "niche analysis", "competitive research", "what are other creators doing", "scrape YouTube channels", or wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.

★ 0