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

feat: Add boolean column to aggregate queries for fuzz testing #13331

Merged
merged 6 commits into from
Nov 13, 2024

Conversation

jonathanc-n
Copy link
Contributor

Which issue does this PR close?

Closes #13297 .

Rationale for this change

Want boolean column for aggregate fuzz testing.

What changes are included in this PR?

Added boolean array generator as booleans are regarded as a special type among arrow types due to bit packing. It also gives the option of having either one type of boolean or two.

Are these changes tested?

Might have tests for generators in future.

@github-actions github-actions bot added the core Core DataFusion crate label Nov 10, 2024
@jonathanc-n jonathanc-n changed the title add bool col feat: Add boolean column for aggregate queries for fuzz testing Nov 10, 2024
@jonathanc-n jonathanc-n changed the title feat: Add boolean column for aggregate queries for fuzz testing feat: Add boolean column to aggregate queries for fuzz testing Nov 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
use rand::rngs::StdRng;
use rand::Rng;

/// Randomly generate decimal arrays
Copy link
Contributor

@LeslieKid LeslieKid Nov 12, 2024

Choose a reason for hiding this comment

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

Typo here.
decimal -> boolean

@alamb
Copy link
Contributor

alamb commented Nov 13, 2024

Thank you @jonathanc-n -- I am sorry for the delay in reviewing. I have been away for a few days but am back now

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks great to me -- thank you @jonathanc-n and @LeslieKid for the review

pub fn gen_data<D>(&mut self) -> ArrayRef {
// Table of booleans from which to draw (distinct means 1 or 2)
let distinct_booleans: BooleanArray = match self.num_distinct_booleans {
1 => {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@alamb alamb merged commit 5467a28 into apache:main Nov 13, 2024
25 checks passed
alamb pushed a commit to alamb/datafusion that referenced this pull request Nov 13, 2024
…e#13331)

* add bool col

* clippy fix

* remove change

* fmt fix

* typo fix
@jonathanc-n jonathanc-n deleted the add-boolean-columns branch November 27, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add boolean columns for fuzz testing
3 participants