fix OR filter partial index value matcher on cursor reset#18029
Merged
gianm merged 6 commits intoapache:masterfrom May 22, 2025
Merged
fix OR filter partial index value matcher on cursor reset#18029gianm merged 6 commits intoapache:masterfrom
gianm merged 6 commits intoapache:masterfrom
Conversation
…ColumnValueSelector by removing ignored marking since it could incorrectly eliminate columns that had some mvd rows and some number rows (uncommon, but im not sure it is technically illegal)
gianm
approved these changes
May 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a bug that can happen when a cursor is reset where the offset contains an OR filter bundle that contains 'partial index' value matchers (where the value matcher consists of one or more value matchers that are actually backed by iterators of the index bitmap). These index backed value matchers are stateful and assume that the offset will be advanced in order, and so must be reset if the underlying offset goes 'backwards' (e.g. from cursor reset).
The added tests fail without the changes in this PR, and also modified
BaseFilterTestto have some cursor resets involved before collecting the values to try to prevent and help catch any other similar lurking issues.Adding the cursor reset to the filter tests uncovered a flaw in
RowBasedExpressionColumnValueSelector, where if a column had any numeric values, even if it previously had array values, then it would be no longer eligible to transform the expression into a map expression to handle mvds. Since this selector probably isn't used nearly as much anymore due to improved type information availability, i have just removed the 'ignored' marking functionality, so that we will always examine the input values to determine if they are scalar or not.This PR has: