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

Write backwards compatible row group statistics (#3526) #3527

Merged
merged 4 commits into from
Jan 15, 2023

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Jan 13, 2023

Which issue does this PR close?

Closes #3526
Closes #799

Rationale for this change

This helps with compatibility with pyarrow, which doesn't understand min_value yet apache/arrow#13976

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the parquet Changes to the parquet crate label Jan 13, 2023
@tustvold
Copy link
Contributor Author

Test failures fixed in #3528

@alamb
Copy link
Contributor

alamb commented Jan 14, 2023

I think this may also fix #799 filed by @tfiasco and which @pjmore also commented on

@tustvold tustvold requested a review from alamb January 14, 2023 18:35
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.

LGTM -- thank you @tustvold . I think this will be a very nice feature addition for othr users.

I had a bunch of naming / doc / style suggestions but nothing required I don't think

I also tested the reproducer from #799 from @tfiasco and the min/max values are properly written 👍

In [3]: 
   ...: import pyarrow.parquet as pq
   ...: f = pq.ParquetFile('/tmp//test.parquet')
   ...: print(f.metadata.row_group(0).column(0).statistics)
<pyarrow._parquet.Statistics object at 0x110118c70>
  has_min_max: True
  min: 1
  max: 5
  null_count: 0
  distinct_count: 0
  num_values: 5
  physical_type: INT32
  logical_type: None
  converted_type (legacy): NONE

In [4]: 

parquet/src/file/statistics.rs Outdated Show resolved Hide resolved
parquet/src/column/writer/mod.rs Show resolved Hide resolved
parquet/src/column/writer/mod.rs Show resolved Hide resolved
parquet/src/file/statistics.rs Show resolved Hide resolved
parquet/src/file/statistics.rs Outdated Show resolved Hide resolved
parquet/src/file/statistics.rs Show resolved Hide resolved
parquet/src/file/statistics.rs Outdated Show resolved Hide resolved
@tustvold
Copy link
Contributor Author

I've updated the docs to hopefully be a bit clearer, PTAL.

I dropped the mentions of parquet v1, as I'm not entirely sure when the deprecation actually happened - the parquet changelog isn't particularly clear on this aspect...

@tustvold tustvold merged commit 95cf030 into apache:master Jan 15, 2023
@ursabot
Copy link

ursabot commented Jan 15, 2023

Benchmark runs are scheduled for baseline = 5a7ec46 and contender = 95cf030. 95cf030 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

@alamb
Copy link
Contributor

alamb commented Jan 17, 2023

Thanks @tustvold

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
3 participants