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

Properly round IndexAccess Bounds for float/decimal type filters over integer columns #2177

Merged
merged 23 commits into from
Dec 5, 2023

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Dec 1, 2023

When generating indexes ranges, we don't convert the range bounds type to the index bound type until later on.
Additionally, when we do convert (specifically floats to ints) we round the floats based on the halfway point, leading to indexes skipping over rows depending on how it rounds.

This PR changes that to convert the types earlier (keeping the key type and index type consistent), and rounding floating point bounds correctly to not leave out any rows.

fixes dolthub/dolt#7072

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

LGTM, mostly forward-looking and organizational questions

sql/index_builder.go Show resolved Hide resolved
sql/index_test.go Show resolved Hide resolved
sql/index_builder.go Show resolved Hide resolved
@jycor jycor merged commit ff84373 into main Dec 5, 2023
7 checks passed
@jycor jycor deleted the james/index-round branch December 5, 2023 00:17
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.

Unexpected Results when Querying with COT
2 participants