← Open Source
databrickslabs

dbldatagen

Generate relevant synthetic data quickly for your projects. The Databricks Labs synthetic data generator (aka `dbldatagen`) may be used to generate large simulated / synthetic data sets for test, POCs, and other uses in Databricks environments including in Delta Live Tables pipelines.

Model DevelopmentDataset engineeringPython
Open on GitHub
Momentum
+1stars in 24 hours+0.2%
503
Stars
105
Forks
+3
This week
23
Contributors
Created 2019-07-23 · Updated 2026-10-15 · #6884 today
Top developers
ronanstokes-dbghanseanupkalburgi

databrickslabs/dbldatagen is ranked 6,884 with 503 stars.

Same-category comparison

databrickslabs/dbldatagen is ranked 6,884 among these 8 peers; hpcaitech/ColossalAI is ranked 6,890.

Same-category comparison
NameRankMetrics
emdgroup/baybe6,850
Language:
Python
Stars:
516
Forks:
81
Description:
Bayesian Optimization and Design of Experiments.
cair/TsetlinMachine6,868
Language:
Cython
Stars:
508
Forks:
58
Description:
Code and datasets for the Tsetlin Machine.
uoftcprg/pokerkit6,876
Language:
Python
Stars:
505
Forks:
81
Description:
An open-source Python library for poker game simulations, hand evaluations, and statistical analysis.
ZjjConan/SimAM6,877
Language:
Python
Stars:
504
Forks:
43
Description:
The official pytorch implemention of our ICML-2021 paper "SimAM: A Simple, Parameter-Free Attention Module for Convolutional Neural Networks".
hpcaitech/ColossalAI6,890
Language:
Python
Stars:
41,430
Forks:
4,485
Description:
Making large AI models cheaper, faster and more accessible.
BVLC/caffe6,896
Language:
C++
Stars:
34,553
Forks:
18,396
Description:
Caffe: a fast open framework for deep learning.
facebookresearch/fastText6,905
Language:
HTML
Stars:
26,523
Forks:
4,827
Description:
Library for fast text representation and classification.
shap/shap6,908
Language:
Jupyter Notebook
Stars:
25,815
Forks:
3,774
Description:
A game theoretic approach to explain the output of any machine learning model.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryDataset engineering
KeywordsData processing, Data synthesis, Tabular data
Stars503
Forks105
Contributors23
Created date2019-07-23
Updated date2026-10-15
Stars in 1 day1
Stars in 7 days3
Rank6,884
Previous rank18,041
Rank change11,157
7-day stars rank7,453
Previous 7-day stars rank8,983
7-day stars rank change1,530
Total stars rank19,269
Previous total stars rank19,290
Total stars rank change21
CountryUSA
README summary

Databricks Labs Data Generator ( ) Documentation | Release Notes | Examples | Tutorial Project Description The Databricks Labs project is a Python library for generating synthetic data within the Databricks environment using Spark. The generated data may be used for testing, benchmarking, demos, and many other uses. It operates by defining a data generation specification in code that controls how the synthetic data is generated. The specification may incorporate the use of existing schemas or create data in an ad-hoc fashion. It has

no dependencies on any libraries that are not already installed in the Databricks runtime, and you can use it from Scala, R or other languages by defining a view over the generated data. Feature Summary It supports: Generating synthetic data at scale up to billions of rows within minutes using appropriately sized clusters Generating repeatable, predictable data supporting the need for producing multiple tables, Change Data Capture, merge and join scenarios with consistency between primary and foreign keys Generating synthetic

data for all of the Spark SQL supported primitive types as a Spark data frame which may be persisted, saved to external storage or used in other computations Generating ranges of dates, timestamps, and numeric values Generation of discrete values - both numeric and text Generation of values at random and based on the values of other fields (either based on the of the underlying values or the values themselves) Ability to specify a distribution for random data generation Generating arrays

of values for ML-style feature arrays Applying weights to the occurrence of values Generating values to conform to a schema or independent of an existing schema use of SQL expressions in synthetic data generation plugin mechanism to allow use of 3rd party libraries such as Faker Use within a Databricks Delta Live Tables pipeline as a synthetic data generation source Generate synthetic data generation code from existing schema or data (experimental) Use of standard datasets for quick generation of

synthetic data Details of these features can be found in the online documentation - online documentation. Documentation Please refer to the online documentation for details of use and many examples. Release notes and details of the latest changes for this specific release can be found in the GitHub repository here Installation Use to install the PyPi package. Within a Databricks notebook, invoke the following in a notebook cell The Pip install command can be invoked within a Databricks notebook, a Delta

Live Tables pipeline and even works on the Databricks community edition. The documentation installation notes contains details of installation using alternative mechanisms. Compatibility The Databricks Labs Data Generator framework can be used with Pyspark 3. These are compatible with the Databricks runtime 13. This version also provides Unity Catalog compatibily. For full library compatibility for a specific Databricks Spark release, see the Databricks release notes for library compatibility In older releases, when using the Databricks Labs Data Generator on "Unity

Catalog" enabled Databricks environments, the Data Generator requires the use of or access modes when using Databricks runtimes prior to

Frequently asked questions

How many stars and forks are recorded?

databrickslabs/dbldatagen has 503 stars and 105 forks.

What is the repository rank?

databrickslabs/dbldatagen is ranked 6,884.

What language and category are recorded?

databrickslabs/dbldatagen has 503 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

databrickslabs/dbldatagen is compared with hpcaitech/ColossalAI, ranked 6,890 with 41,430 stars.

README

Databricks Labs Data Generator (dbldatagen)

Documentation | Release Notes | Examples | Tutorial

Project Description

The dbldatagen Databricks Labs project is a Python library for generating synthetic data within the Databricks environment using Spark. The generated data may be used for testing, benchmarking, demos, and many other uses.

It operates by defining a data generation specification in code that controls how the synthetic data is generated. The specification may incorporate the use of existing schemas or create data in an ad-hoc fashion.

It has no dependencies on any libraries that are not already installed in the Databricks runtime, and you can use it from Scala, R or other languages by defining a view over the generated data.

Feature Summary

It supports:

  • Generating synthetic data at scale up to billions of rows within minutes using appropriately sized clusters
  • Generating repeatable, predictable data supporting the need for producing multiple tables, Change Data Capture, merge and join scenarios with consistency between primary and foreign keys
  • Generating synthetic data for all of the Spark SQL supported primitive types as a Spark data frame which may be persisted, saved to external storage or used in other computations
  • Generating ranges of dates, timestamps, and numeric values
  • Generation of discrete values - both numeric and text
  • Generation of values at random and based on the values of other fields (either based on the hash of the underlying values or the values themselves)
  • Ability to specify a distribution for random data generation
  • Generating arrays of values for ML-style feature arrays
  • Applying weights to the occurrence of values
  • Generating values to conform to a schema or independent of an existing schema
  • use of SQL expressions in synthetic data generation
  • plugin mechanism to allow use of 3rd party libraries such as Faker
  • Use within a Databricks Delta Live Tables pipeline as a synthetic data generation source
  • Generate synthetic data generation code from existing schema or data (experimental)
  • Use of standard datasets for quick generation of synthetic data

Details of these features can be found in the online documentation - online documentation.

Documentation

Please refer to the online documentation for details of use and many examples.

Release notes and details of the latest changes for this specific release can be found in the GitHub repository here

Installation

Use pip install dbldatagen to install the PyPi package.

Within a Databricks notebook, invoke the following in a notebook cell

%pip install dbldatagen

The Pip install command can be invoked within a Databricks notebook, a Delta Live Tables pipeline and even works on the Databricks community edition.

The documentation installation notes contains details of installation using alternative mechanisms.

Compatibility

The Databricks Labs Data Generator framework can be used with Pyspark 3.4.1 and Python 3.10.12 or later. These are compatible with the Databricks runtime 13.3 LTS and later releases. This version also provides Unity Catalog compatibily.

For full library compatibility for a specific Databricks Spark release, see the Databricks release notes for library compatibility

In older releases, when using the Databricks Labs Data Generator on "Unity Catalog" enabled Databricks environments, the Data Generator requires the use of Single User or No Isolation Shared access modes when using Databricks runtimes prior to release 13.2. This is because some needed features are not available in Shared mode (for example, use of 3rd party libraries, use of Python UDFs) in these releases. Depending on settings, the Custom access mode may be supported for those releases.

The use of Unity Catalog Shared access mode is supported in Databricks runtimes from Databricks runtime release 13.2 onwards.

This version of the data generator uses the Databricks runtime 13.3 LTS as the minimum supported version and alleviates these issues.

See the following documentation for more information:

Using the Data Generator

To use the data generator, install the library using the %pip install method or install the Python wheel directly in your environment.

Once the library has been installed, you can use it to generate a data frame composed of synthetic data.

The easiest way to use the data generator is to use one of the standard datasets which can be further customized for your use case.

import dbldatagen as dg
df = dg.Datasets(spark, "basic/user").get(rows=1000_000).build()
num_rows=df.count()                          

You can also define fully custom data sets using the DataGenerator class.

For example

import dbldatagen as dg
from pyspark.sql.types import IntegerType, FloatType, StringType
column_count = 10
data_rows = 1000 * 1000
df_spec = (dg.DataGenerator(spark, name="test_data_set1", rows=data_rows,
                                                  partitions=4)
           .withIdOutput()
           .withColumn("r", FloatType(), 
                            expr="floor(rand() * 350) * (86400 + 3600)",
                            numColumns=column_count)
           .withColumn("code1", IntegerType(), minValue=100, maxValue=200)
           .withColumn("code2", IntegerType(), minValue=0, maxValue=10)
           .withColumn("code3", StringType(), values=['a', 'b', 'c'])
           .withColumn("code4", StringType(), values=['a', 'b', 'c'], 
                          random=True)
           .withColumn("code5", StringType(), values=['a', 'b', 'c'], 
                          random=True, weights=[9, 1, 1])
 
           )
                            
df = df_spec.build()
num_rows=df.count()                          

Refer to the online documentation for further examples.

The GitHub repository also contains further examples in the examples directory.

Spark and Databricks Runtime Compatibility

The dbldatagen package is intended to be compatible with recent LTS versions of the Databricks runtime, including older LTS versions at least from 13.3 LTS and later. It also aims to be compatible with Delta Live Table runtimes, including current and preview.

While we don't specifically drop support for older runtimes, changes in Pyspark APIs or APIs from dependent packages such as numpy, pandas, pyarrow, and pyparsing make cause issues with older runtimes.

By design, installing dbldatagen does not install releases of dependent packages in order to preserve the curated set of packages pre-installed in any Databricks runtime environment.

When building on local environments, run make dev to install required dependencies.

Project Support

Please note that all projects released under Databricks Labs are provided for your exploration only, and are not formally supported by Databricks with Service Level Agreements (SLAs). They are provided AS-IS, and we do not make any guarantees of any kind. Please do not submit a support ticket relating to any issues arising from the use of these projects.

Any issues discovered through the use of this project should be filed as issues on the GitHub Repo.
They will be reviewed as time permits, but there are no formal SLAs for support.

Feedback

Issues with the application? Found a bug? Have a great idea for an addition? Feel free to file an issue.

Nearby in the ranking
Similar items