Skip to content

Conversation

@ghanse
Copy link
Collaborator

@ghanse ghanse commented Sep 16, 2025

Proposed changes

This PR introduces methods for writing generated data to output tables or files. Users will create an OutputDataset which specifies how data should be persisted:

gen = dg.DataGenerator(...)

output_dataset = OutputDataset(
  location="main.demo.table",
  output_mode="append",
  format="delta",
  options={"mergeSchema": "true"}
)

gen.buildOutputDataset(output_dataset)

Users can write to tables or files. Data can be built in batch or streaming mode:

gen = dg.DataGenerator(...)

output_dataset = OutputDataset(
  location="/Volumes/main/demo/files/demo_json",
  output_mode="append",
  format="json"
  trigger={"processingTime": "1 SECOND"}  # Optional streaming trigger
)

gen.buildOutputDataset(output_dataset, withStreaming=True)

I have also simplified the Pull Request template.

Resolves #343

Types of changes

What types of changes does your code introduce to dbldatagen?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Change to tutorials, tests or examples
  • Non code change (readme, images or other non-code assets)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask. We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules
  • Submission does not reduce code coverage numbers
  • Submission does not increase alerts or messages from prospector / lint

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you
did and what alternatives you considered, etc...

@ghanse ghanse requested review from a team as code owners September 16, 2025 13:01
@ghanse ghanse requested review from nfx and renardeinside and removed request for a team September 16, 2025 13:01
@ghanse ghanse requested a review from anupkalburgi September 19, 2025 18:53
@ghanse ghanse requested a review from anupkalburgi September 22, 2025 19:14
Copy link
Collaborator

@anupkalburgi anupkalburgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@ghanse ghanse merged commit 5a287c1 into master Sep 23, 2025
3 checks passed
@ghanse ghanse deleted the feature_persistence_methods branch September 23, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add methods to persist generated data

3 participants