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

Fix disabling parquet statistics (#2185) #2191

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #2185

Rationale for this change

What changes are included in this PR?

Fixes the handling of this option, and adds some test coverage 😄

Are there any user-facing changes?

This feature should now behave correctly

@@ -456,7 +456,8 @@ impl<'a, E: ColumnValueEncoder> GenericColumnWriter<'a, E> {
for &level in levels {
if level == self.descr.max_def_level() {
values_to_write += 1;
} else if self.statistics_enabled == EnabledStatistics::Page {
} else {
// We must always compute this as it is used to populate v2 pages
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously this would cause an incorrect null count in the data page v2 header

.build()?;
.set_dictionary_page_offset(dict_page_offset);

if self.statistics_enabled != EnabledStatistics::None {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously we would still put the column statistics, even if we hadn't actually computed them 😱

statistics,
..
} => {
assert_eq!(*num_values, 6);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confusingly in parquet num_values includes nulls, despite null values not actually be encoded 😆

@github-actions github-actions bot added the parquet Changes to the parquet crate label Jul 27, 2022
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.

I also verified that the newly added test does indeed fail without the code changes in this PR

---- column::writer::tests::test_disabled_statistics stdout ----
thread 'column::writer::tests::test_disabled_statistics' panicked at 'assertion failed: statistics.is_none()', parquet/src/column/writer/mod.rs:1689:17
stack backtrace:

🚢 🇮🇹

@alamb alamb merged commit 82e0512 into apache:master Jul 27, 2022
@ursabot
Copy link

ursabot commented Jul 27, 2022

Benchmark runs are scheduled for baseline = 445283c and contender = 82e0512. 82e0512 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EnabledStatistics::None not working
4 participants