Skip to content

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Oct 7, 2024

Which issue does this PR close?

Part of #6504

Rationale for this change

I want to use the ColumnChunkMetaDataBuilder to modify existing metadata in addition to creating new metadata, for the example in #6504.

What changes are included in this PR?

  1. Add a few ColumnChunkMetadataBuilder::clear_statistics and other clear API to modify Option fields

Are there any user-facing changes?

Some new APIs and docs

@github-actions github-actions bot added the parquet Changes to the parquet crate label Oct 7, 2024
@alamb alamb force-pushed the alamb/clear_stats branch from 7b7a912 to 02d8b98 Compare October 7, 2024 19:13
}

/// Clears the statistics for this column chunk.
pub fn clear_statistics(mut self) -> Self {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, set_statistics takes value: Statistics not value: Option<Statistics> and thus there is no way to make this change without breaking the API which we can't do until the next breaking release

}

/// Clears the page encoding stats for this column chunk.
pub fn clear_page_encoding_stats(mut self) -> Self {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same reasoning applies to this API

@alamb alamb marked this pull request as ready for review October 7, 2024 19:15
Copy link
Contributor

@etseidl etseidl 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. Seems straightforward enough to not need additional tests. I agree it would be nice to change the setters to take Options. That can be done in a follow-up. Thanks!

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

This seems like a pragmatic way forward to me

@tustvold tustvold merged commit 5508978 into apache:master Oct 8, 2024
16 checks passed
@alamb alamb deleted the alamb/clear_stats branch October 8, 2024 20:29
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.

3 participants