Repository navigation
fix(optimizer): coerce numeric types in index column hints for int-float comparisons - #6174
Open
Tyagiquamar wants to merge 1 commit into
Open
Tyagiquamar wants to merge 1 commit into
Tyagiquamar wants to merge 1 commit into
Conversation
This branch has not been deployed
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.


What problem does this PR solve?
Fixes #6172.
When an
INTproperty is compared to an integer-valued floating-point literal (e.g.3000000000.0), queries executed via index scans on that property previously dropped matching rows. This occurred becauseOptimizerUtils::appendColHintused the floatValuedirectly inIndexColumnHintwithout coercing it to the column definition schema type (INT64). In RocksDB storage, index keys forINTandDOUBLEuse distinct encodings, causing index prefix seek misses.What is changed and how does it work?
SchemaUtil::coerceValueto safely convert representable integer floating-point literals to integer values for integer property types (and integer literals to float for float property types).OptimizerUtils::normalizeFilterValueto normalize filter expressions before creating column hints.OptimizerUtils::appendColHintto validate and coerce candidate filter values to the column's expected data type for both prefix and range scans.IndexScanRuleTestfor exact-integer float literals on int columns and int literals on double columns.LookupValidatorTest.Check List
Tests:
IndexScanRuleTestLookupValidatorTest