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

Incorrect row comparison for tpch queries in benchmarks #5784

Merged
merged 3 commits into from
Mar 31, 2023

Conversation

viirya
Copy link
Member

@viirya viirya commented Mar 29, 2023

Which issue does this PR close?

Closes #5783.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@@ -1106,7 +1106,7 @@ mod ci {
let actual_row = &actual_vec[i];
assert_eq!(expected_row.len(), actual_row.len());

for j in 0..expected.len() {
Copy link
Member Author

Choose a reason for hiding this comment

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

e.g., If expected contains only one record batch, we only compare first column between rows.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if any existing tests will fail by this.

Comment on lines 1121 to 1134
(
ScalarValue::Decimal128(Some(l), _, s),
ScalarValue::Decimal128(Some(r), _, _),
) => {
let tolerance = 0.1;
if ((l - r) as f64 / 10_i32.pow(*s as u32) as f64).abs()
> tolerance
{
panic!(
"Expected: {}; Actual: {}; Tolerance: {}",
l, r, tolerance
)
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is necessary to pass ci::verify_q9 after this change. There is a slight (0.01) difference.

ScalarValue::Decimal128(Some(l), _, s),
ScalarValue::Decimal128(Some(r), _, _),
) => {
let tolerance = 0.1;
Copy link
Contributor

Choose a reason for hiding this comment

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

tolerance is already defined above in the float path -- maybe we could make it a constant or something. Very minor

@viirya viirya merged commit 667f19e into apache:main Mar 31, 2023
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.

Incorrect row comparison for tpch queries in benchmarks
2 participants