-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
prepare for ip field #1554
prepare for ip field #1554
Conversation
src/fastfield/bytes/reader.rs
Outdated
@@ -31,36 +31,39 @@ impl BytesFastFieldReader { | |||
Ok(BytesFastFieldReader { idx_reader, values }) | |||
} | |||
|
|||
fn range(&self, doc: DocId) -> (usize, usize) { | |||
fn range(&self, doc: DocId) -> std::ops::Range<u64> { |
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.
fn range(&self, doc: DocId) -> std::ops::Range<u64> { | |
fn range(&self, doc: DocId) -> Range<usize> { |
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.
Why usize? Multivalue ff values can be u64
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.
The index you mean? They are consumed as usize and it is a private method here.
(Actually I think we should make all column indexes u32
but that's another discussion.)
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.
for this PR you don't have to take the suggestions if you judge better as it is.
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.
The method is also used in the trait, which is u64. I also think we can change that, 4GB should be enough for a segment. For the time being I would be explicit with the type.
let (start, stop) = self.range(doc); | ||
&self.values.as_slice()[start..stop] | ||
let range = self.range(doc); | ||
&self.values.as_slice()[range.start as usize..range.end as usize] |
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.
&self.values.as_slice()[range.start as usize..range.end as usize] | |
&self.values.as_slice()[range] |
let start = self.idx_reader.get_val(idx) as usize; | ||
let stop = self.idx_reader.get_val(idx + 1) as usize; | ||
(start, stop) | ||
let start = self.idx_reader.get_val(idx); |
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.
let start = self.idx_reader.get_val(idx); | |
let start = self.idx_reader.get_val(idx) as usize; |
stop - start | ||
pub fn num_bytes(&self, doc: DocId) -> u64 { | ||
let range = self.range(doc); | ||
range.end - range.start |
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.
range.end - range.start | |
range.len() as u64 |
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.
You might need to use std::iter::ExactSizeIterator for that one.
3e0bc55
to
f757471
Compare
No description provided.