-
Notifications
You must be signed in to change notification settings - Fork 825
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1346 +/- ##
=======================================
Coverage 83.04% 83.04%
=======================================
Files 181 181
Lines 52937 52933 -4
=======================================
- Hits 43960 43957 -3
+ Misses 8977 8976 -1
Continue to review full report at Codecov.
|
There was a problem hiding this 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() { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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? :)
There was a problem hiding this comment.
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 👋 )
Thanks again @shanisolomon |
ColumnChunkMetaData
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{...}