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

parquet: Add tests for page pruning on unsigned integers #9888

Merged
merged 1 commit into from
Mar 31, 2024

Conversation

progval
Copy link
Contributor

@progval progval commented Mar 31, 2024

Which issue does this PR close?

Closes #9887.

Rationale for this change

What changes are included in this PR?

New test scenario, new tests adapted from the signed integer tests

Are these changes tested?

yes

Are there any user-facing changes?

no

Comment on lines +562 to +584
#[tokio::test]
async fn [<prune_uint $bits _scalar_fun_and_eq >]() {
test_prune(
Scenario::UInt,
&format!("SELECT * FROM t where power(u{}, 2) = 36 and u{} = 6", $bits, $bits),
Some(0),
Some(15),
1,
)
.await;
}

#[tokio::test]
async fn [<prune_uint $bits _scalar_fun >]() {
test_prune(
Scenario::UInt,
&format!("SELECT * FROM t where power(u{}, 2) = 25", $bits),
Some(0),
Some(0),
2,
)
.await;
}
Copy link
Contributor Author

@progval progval Mar 31, 2024

Choose a reason for hiding this comment

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

abs() doesn't really make sense on unsigned integers, so I replaced it with power() when adapting from signed integer tests

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense to me

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.

👨‍🍳 👌 -- thank you @progval . Very nice sequence of tests

paste::item! {
#[tokio::test]
// null count min max
// page-0 0 0 4
Copy link
Contributor

Choose a reason for hiding this comment

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

I was confused at first, but the make_uint_batches(0, 5) returns 0..5 which has a max of 4. ✅

Comment on lines +562 to +584
#[tokio::test]
async fn [<prune_uint $bits _scalar_fun_and_eq >]() {
test_prune(
Scenario::UInt,
&format!("SELECT * FROM t where power(u{}, 2) = 36 and u{} = 6", $bits, $bits),
Some(0),
Some(15),
1,
)
.await;
}

#[tokio::test]
async fn [<prune_uint $bits _scalar_fun >]() {
test_prune(
Scenario::UInt,
&format!("SELECT * FROM t where power(u{}, 2) = 25", $bits),
Some(0),
Some(0),
2,
)
.await;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense to me

@alamb alamb merged commit a23f507 into apache:main Mar 31, 2024
24 of 25 checks passed
@progval progval deleted the test-uint-page-pruning branch March 31, 2024 19:34
Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Apr 1, 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.

parquet: Page pruning on unsigned integers is not tested
2 participants