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

Remove existing has_ methods for optional fields in ColumnChunkMetaData #1346

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

shanisolomon
Copy link
Contributor

Which issue does this PR close?

Closes #1332.

Rationale for this change

This methods are redundant as the fields are Optional and could be matched.

Will break all current usages of these methods, but could could be easily refactored to:
if let Some(val) = metadata.page_index_offset{...}

@github-actions github-actions bot added the parquet Changes to the parquet crate label Feb 20, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #1346 (9aea0e4) into master (ecba7dc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1346   +/-   ##
=======================================
  Coverage   83.04%   83.04%           
=======================================
  Files         181      181           
  Lines       52937    52933    -4     
=======================================
- Hits        43960    43957    -3     
+ Misses       8977     8976    -1     
Impacted Files Coverage Δ
parquet/src/file/metadata.rs 93.97% <100.00%> (+0.52%) ⬆️
arrow/src/datatypes/datatype.rs 66.40% <0.00%> (-0.40%) ⬇️
parquet_derive/src/parquet_field.rs 66.21% <0.00%> (-0.23%) ⬇️
arrow/src/datatypes/field.rs 54.10% <0.00%> (+0.30%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecba7dc...9aea0e4. Read the comment docs.

@alamb alamb added the api-change Changes to the arrow API label Feb 28, 2022
@alamb
Copy link
Contributor

alamb commented Feb 28, 2022

Related to #1344 / #1345

This is a breaking change so marking it as such

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.

Thank you @shanisolomon

self.dictionary_page_offset().unwrap()
} else {
self.data_page_offset()
let col_start = match self.dictionary_page_offset() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it matters at all, but just FYI you can also write this code like

let col_start = self.dictionary_page_offset()
  .unwrap_or(self.data_page_offset())

Which some might argue is more 'idomatic' rust

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay - I was out last week. Would you like me to send a refactor for this? :)

Copy link
Contributor

@alamb alamb Mar 6, 2022

Choose a reason for hiding this comment

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

It is up to you -- I always like to keep the code clean and small PRs to make it better are easy to approve and merge. However, there are only so many hours in a day :)

(welcome back BTW 👋 )

@alamb alamb merged commit 84c12cc into apache:master Mar 2, 2022
@alamb
Copy link
Contributor

alamb commented Mar 2, 2022

Thanks again @shanisolomon

@alamb alamb changed the title Remove existing has_ methods for optional fields Remove existing has_ methods for optional fields in ColumnChunkMetaData Mar 2, 2022
@alamb alamb mentioned this pull request Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider removing redundant has_XXX metadata functions in ColumnChunkMetadata
3 participants