round IndexAccess for numerical strings over int columns#2246
Merged
Conversation
max-hoffman
reviewed
Jan 8, 2024
| }, | ||
| }, | ||
| { | ||
| Query: "select * from mytable where i > '-0.5';", |
Contributor
There was a problem hiding this comment.
I tried an index lookup but I'm not seeing the same issue for some reason, does that make sense that it's just static range scans?
select /*+ LOOKUP_JOIN(b,a) */ * from mytable a join mytable b on a.i = '-.5' and a.s = b.s
Project
├─ columns: [a.i:2!null, a.s:3!null, b.i:0!null, b.s:1!null]
└─ LookupJoin
├─ Eq
│ ├─ a.s:3!null
│ └─ b.s:1!null
├─ TableAlias(b)
│ └─ Table
│ ├─ name: mytable
│ ├─ columns: [i s]
│ ├─ colSet: (3,4)
│ └─ tableId: 2
└─ Filter
├─ Eq
│ ├─ a.i:0!null
│ └─ -.5 (longtext)
└─ TableAlias(a)
└─ IndexedTableAccess(mytable)
├─ index: [mytable.i]
├─ keys: [-.5 (longtext)]
├─ colSet: (1,2)
├─ tableId: 1
└─ Table
├─ name: mytable
└─ columns: [i s]
Contributor
Author
There was a problem hiding this comment.
I believe it hits this case if we are using a lookup join:
https://github.com/dolthub/go-mysql-server/pull/2246/files#diff-66b16c24d40520a9c552a4093466441a1623797f6aea41f208809bf2eee3de8cR114
(The range is empty unless its a whole number)
Contributor
There was a problem hiding this comment.
kk, so I guess this bug only applies to non-equalities.
max-hoffman
approved these changes
Jan 8, 2024
Contributor
max-hoffman
left a comment
There was a problem hiding this comment.
LGTM, seems like there is potential for adjacent tests to make sure index conversions work for different types
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.
fixes dolthub/dolt#7261