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

Expose page encoding ColumnChunkMetadata #1322

Merged
merged 10 commits into from
Feb 17, 2022

Conversation

shanisolomon
Copy link
Contributor

Which issue does this PR close?

Closes #1321.

What changes are included in this PR?

Introduced page_encoding_stats struct, with to_thrift and from_thrift conversions, and exposed it from the column chunk metadata.

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

Looks good to me -- thanks for breaking this work up in to small pieces @shanisolomon -- it makes it easier to review and keep the 🚋 rolling!

There appears to be some clippy issue with this PR that needs to be fixed to get a clean CI run, but otherwise 👍

@@ -467,6 +469,17 @@ impl ColumnChunkMetaData {
self.statistics.as_ref()
}

/// Returns `true` if this column chunk contains page encoding stats, `false` otherwise.
pub fn has_page_encoding_stats(&self) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this method is redundant with the page_encoding_stats as I think most of the time any client code would process page_encoding_stats they would likely use code like:

if let Some(page_encoding_stats) = metadata.page_encoding_stats() {
  // do something with `page_encoding_stats`

However, I see it is consistent with the methods of this file (and I didn't call this out in earlier PRs 😅 )

On the other hand, we haven't released the other methods (like has_bloom_filter so it isn't too late to remove them)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I introduce those methods in order to be consistent with the other has_ methods for optional values in the metadata. Would you like me to remove all?

Copy link
Contributor

Choose a reason for hiding this comment

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

Here is my proposal:

  1. Merge this PR as is (it has some small clippy thing we need to fix to get the CI clean)
  2. Prepare a PR to remove all the has_XXX methods that have been added for extended metadata so that we don't add them to a released version
  3. Prepare a PR to remove the other (pre-existing has_XXX methods): Consider removing redundant has_XXX metadata functions in ColumnChunkMetadata #1332

@@ -815,6 +858,18 @@ mod tests {
.set_total_uncompressed_size(3000)
.set_data_page_offset(4000)
.set_dictionary_page_offset(Some(5000))
.set_page_encoding_stats(vec![
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 changed the title Expose page encoding Expose page encoding ColumnChunkMetadata Feb 17, 2022
@alamb alamb added the enhancement Any new improvement worthy of a entry in the changelog label Feb 17, 2022
@alamb alamb merged commit f4c7102 into apache:master Feb 17, 2022
@alamb
Copy link
Contributor

alamb commented Feb 17, 2022

Thanks again @shanisolomon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exposing page encoding stats
2 participants