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 the Faker connector #23691

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nineinchnick
Copy link
Member

Description

The purpose of this connector would be similar to tpch/tpcds - generate random data to be used for all kinds of testing. The main difference is that this works with all Trino data types and any kind of schema. It's also using the Datafaker library, which allows generating more sophisticated random data in multiple languages.

For more details, including usage examples, see https://github.com/nineinchnick/trino-faker/

I'll add documentation if the general idea of adding this connector will be approved.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Oct 6, 2024
Comment on lines 211 to 213
for (int i = 0; i < positions; i++) {
generators.get(column).accept(output, completedRows + i);
}
Copy link
Member

Choose a reason for hiding this comment

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

You should loop over the columns and append N positions at a time to each column, that is more efficient than looping over columns for each position

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a bit confused, isn't this already the case, since this is an inner loop? I just extracted generators.get(column) outside this loop.

plugin/trino-faker/pom.xml Show resolved Hide resolved
@nineinchnick
Copy link
Member Author

@raunaqmorarka thanks a lot for the review, everything looks much nicer now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants