databricks-synthetic-data-gen

Generate story-driven synthetic datasets on Databricks using Spark, Faker, and Pandas UDFs.

4|1|Updated May 22, 2026
One-click install
npx skills add https://github.com/ThomazRossito/ai-data-agents --skill databricks-synthetic-data-gen-thomazrossito
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: databricks-synthetic-data-gen
Source: https://github.com/ThomazRossito/ai-data-agents/tree/main/plugins/ai-data-agents/skills/databricks-synthetic-data-gen
Command: npx skills add https://github.com/ThomazRossito/ai-data-agents --skill databricks-synthetic-data-gen-thomazrossito

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires databricks-connect, faker, numpy, pandas, holidays, pyspark, and includes scripts (resource) and references (resource) components.

What problem does it solve? Creating realistic test and demo data for Databricks is time-consuming, and naive random data lacks the patterns needed for dashboards, root cause analysis, and ML training. This Skill generates coherent, business-story-driven synthetic datasets at scale directly into Unity Catalog. ## Core Features & Use Cases - Scalable Spark + Faker Generation: Uses Databricks Connect serverless with Pandas UDFs to generate thousands to millions of rows in parallel, writing to Parquet, Delta, JSON, or CSV. - Realistic Data Patterns: Enforces non-uniform distributions (log-normal amounts, weighted categories, 80/20 rules), row coherence, time-based patterns, and referential integrity via master-table-first FK joins. - Story-Driven Planning Workflow: Presents a plan with business story, table specs, and assumptions for user approval before generating code, including optional bad-data injection for data quality testing. - Use Case: You need a support-ticket demo dataset showing an outage that spiked tickets and caused $2.3M churn. The Skill plans the tables, generates 80K tickets with correlated resolution times and CSAT, and writes them to your catalog volume. ## Quick Start Ask the assistant to generate a synthetic e-commerce dataset with customers and orders into a specific Unity Catalog and schema using serverless Spark.

Frequently Asked Questions about databricks-synthetic-data-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate synthetic data on Databricks with Faker?▼

Use Databricks Connect with a serverless Spark session and wrap Faker calls in pandas_udf functions for batch parallel generation. Generate rows with spark.range(), apply the UDFs, and write results to a Unity Catalog volume as Parquet or Delta.

How to create synthetic data with referential integrity in Spark?▼

Generate master tables first and write them to Delta, then read them back and join child tables on a hash-based index to assign valid foreign keys. Do not use .cache() or .persist() because serverless compute does not support them.

Does Databricks serverless support cache() and persist()?▼

No, serverless compute rejects .cache() and .persist() with a NOT_SUPPORTED_WITH_SERVERLESS error. Write intermediate DataFrames to Delta tables and read them back for joins instead.

Why is my Faker UDF slow in Spark?▼

Scalar UDFs process rows one at a time and do not parallelize well. Convert them to pandas_udf functions so Faker generates values in batches across Spark partitions, and increase numPartitions for large datasets.

What Python packages are needed for Databricks synthetic data generation?▼

Install databricks-connect>=16.4, faker, numpy, pandas, and holidays locally with uv on Python 3.12. Import Faker inside the UDF body so it resolves in the serverless execution environment.

How many rows should synthetic data have for ML training?▼

Aim for 10K to 100K+ rows for ML training so patterns survive aggregation, with at least 100 rows per GROUP BY category. Use realistic class imbalance such as 0.1-1% fraud rates rather than uniform distributions.