Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Iternation index option #51

Merged
merged 1 commit into from
Mar 3, 2023
Merged

Add Iternation index option #51

merged 1 commit into from
Mar 3, 2023

Conversation

bobbyiliev
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • ♻️ Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 👷 Optimization
  • 📝 Documentation Update
  • 🚩 Other

Description

To simulate auto incrementing primary keys, you can use the iteration.index variable in the schema.

This is particularly useful when you want to generate a small set of records with sequence of IDs, for example 1000 records with IDs from 1 to 1000:

[
    {
        "_meta": {
            "topic": "mz_datagen_users"
        },
        "id": "iteration.index",
        "name": "internet.userName",
    }
]

Example:

datagen -s tests/iterationIndex.json -dr true -f json -n 1000

This does not work particularly well with the relational data implementation, but it is mainly intended to be used with single schemas, eg. the Storage utilization test task.

Related Tickets & Documents

N/A

Added to documentation?

  • 📜 readme
  • 🙅 no documentation needed

[optional] What gif best describes this PR or how it makes you feel?

Copy link
Collaborator

@chuck-alt-delete chuck-alt-delete left a comment

Choose a reason for hiding this comment

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

I’ll need to check what you said about it not playing nicely with relational schemas, but that might be something we can fix later. I’ll approve for now. You or I might come back to the docs or file an issue to clarify what exactly goes wrong.

@bobbyiliev bobbyiliev merged commit b8780f5 into main Mar 3, 2023
@bobbyiliev bobbyiliev deleted the ids-sequence branch March 3, 2023 14:30
recursethis pushed a commit to recursethis/materialize-datagen that referenced this pull request Feb 26, 2024
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.

None yet

2 participants