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

Exposing min/max value interface on MultiValuedFastField Reader #1094

Merged
merged 2 commits into from
Jun 22, 2021

Conversation

evanxg852000
Copy link
Collaborator

Issue: as pointed out by @fmassot We want to avoid issues related to schema evolution in Quickwit. so currently fast fields are implicitly declared as multivalued.
We need the max/min value interface to be available for MultiValuedFastFieldReader as it is for FastFieldReader
Currently, we need it to allow us to perform the timestamp filtering optimization. That is when a split time range is already within the user query bound, we should not attach filtering.

@fulmicoton fulmicoton merged commit bb48830 into main Jun 22, 2021
@fulmicoton fulmicoton deleted the expose-min-max-on-multi-fast-field-reader branch June 22, 2021 23:51
@@ -46,6 +46,24 @@ impl<Item: FastValue> MultiValuedFastFieldReader<Item> {
self.vals_reader.get_range_u64(range.start, &mut vals[..]);
}

/// Returns the minimum value for this fast field.
///
/// The max value does not take in account of possible
Copy link
Collaborator

Choose a reason for hiding this comment

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

this comment seems like a copy-pasta

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes the comment looked like a warning that need to be clear to users from the internal reader. That's why I felt it's necessary to also have it on this methods.

/// deleted document, and should be considered as an upper bound
/// of the actual maximum value.
pub fn min_value(&self) -> Item {
self.vals_reader.max_value()
Copy link
Collaborator

Choose a reason for hiding this comment

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

out-of-context, is it deliberate to have min_value() return vals_reader.max_value() and vice versa?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching that. @evanxg852000 can you fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

good catch indeed, By the way, I was worried by the fact they were no test on that.

@PSeitz
Copy link
Contributor

PSeitz commented Jun 23, 2021

Issue: as pointed out by @fmassot We want to avoid issues related to schema evolution in Quickwit. so currently fast fields are implicitly declared as multivalued.

In that case we should check in tantivy if a field is actually multivalued on serialization and use single value if applicable to reduce index size and read performance.

@evanxg852000
Copy link
Collaborator Author

Let's move discussion to this new pr

This was referenced Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants