-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
opt: fix inverted key column type in testcat #82547
opt: fix inverted key column type in testcat #82547
Conversation
a discussion (no related file): |
678e325
to
aa5de04
Compare
Thanks! Should be fixed now.
Yes. This PR includes that change: https://github.com/cockroachdb/cockroach/pull/82547/files#diff-f5b6d3abeaf55ecb48cf9aa29ab0e311a1c4a4ede69bce28913d5b45449f6b6aR1109
I believe we are using EncodedKey because |
Ohh true. I see now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 10 of 10 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @mgartner and @wenyihu6)
pkg/sql/opt_catalog.go
Outdated
@@ -892,7 +892,7 @@ func newOptTable( | |||
|
|||
invertedSourceColOrdinal, _ := ot.lookupColumnOrdinal(invertedColumnID) | |||
|
|||
// Add a inverted column that refers to the inverted index key. | |||
// Add an inverted column that refers to the inverted index key. | |||
invertedCol, invertedColOrd := newColumn() | |||
|
|||
// All inverted columns have type bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this comment to // All inverted columns have type EncodedKey.
?
This is probably unrelated to this pr change. But when I was reviewing the code for inverted column type, I was confused about the logic here. Why should the first column type be int? |
I think this is something called the cellid though I don't really know the significance. I'm guessing that normally the encoding of the inverted index key is opaque to the optimizer, but in this case we wanted the optimizer to know about the cellid for some reason. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 10 files at r1.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @mgartner)
Previously, inverted key columns in the test catalog were incorrectly given the type of their source column. Now they have the correct type, `types.EncodedKey`. Release note: None
aa5de04
to
ec8e63c
Compare
Thanks for pointing this out. I'm not sure about the |
I've addressed the problems I could see in this PR: #82632 |
TFTRs! bors r+ |
Build succeeded: |
Previously, inverted key columns in the test catalog were incorrectly
given the type of their source column. Now they have the correct type,
types.EncodedKey
.Release note: None