-
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
sql: enable storage for tsvector/tsquery #92957
Conversation
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 9 of 9 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis)
pkg/sql/catalog/colinfo/col_type_info.go
line 101 at r1 (raw file):
return unimplemented.NewWithIssueDetailf(23468, t.String(), "arrays of JSON unsupported as column type") }
should we allow arrays of TSQuery / TSVector?
pkg/sql/randgen/type.go
line 159 at r1 (raw file):
} ctx := context.Background() evalCtx := eval.MakeTestingEvalContext(clustersettings.MakeTestingClusterSettings())
feels kind of bad to introduce a testing eval context here since this isn't explicitly a test... (I know it's probably only used for tests, though). I don't really have a good suggestion, but wondering if you considered any other options?
93ae930
to
177cfef
Compare
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.
Comments resolved!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rytaft)
pkg/sql/catalog/colinfo/col_type_info.go
line 101 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
should we allow arrays of TSQuery / TSVector?
At some point, yes, but we currently disallow them: #90886
This code is in CheckArrayElementType.
I was missing a test case for this though, thanks for pointing it out, added one.
pkg/sql/randgen/type.go
line 159 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
feels kind of bad to introduce a testing eval context here since this isn't explicitly a test... (I know it's probably only used for tests, though). I don't really have a good suggestion, but wondering if you considered any other options?
Good point...
I simplified it a little bit, but looking at the code for MakeTestingClusterSettings, the function of that code is literally just to initialize a fake cluster version from 0, so I think we'll need to keep that at minimum.
Another option I guess would be to find a way to propagate a cluster settings just for the things that use randgen? But it seems like more effort than it's worth to me.
Did you have another idea? Happy to do something else here just don't really know what it would be.
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 2 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis)
pkg/sql/randgen/type.go
line 159 at r1 (raw file):
Previously, jordanlewis (Jordan Lewis) wrote…
Good point...
I simplified it a little bit, but looking at the code for MakeTestingClusterSettings, the function of that code is literally just to initialize a fake cluster version from 0, so I think we'll need to keep that at minimum.
Another option I guess would be to find a way to propagate a cluster settings just for the things that use randgen? But it seems like more effort than it's worth to me.
Did you have another idea? Happy to do something else here just don't really know what it would be.
This seems better. I'm ok with this, but maybe it's worth adding an explicit comment that these functions should only be called from test code?
177cfef
to
274ad78
Compare
There are a ton of different functions that invoke the random types, so I feel like adding a comment to all of them is a little silly. I added a comment to the doc, which also feels kind of weak. But good news - I worked with @rickystewart and @ajwerner to open up #93470, which programmatically asserts that these can only be used in test 🎉 TFTR! bors r+ |
Build failed (retrying...): |
bors r- |
Canceled. |
This commit adds the ability to store tsvector and tsquery data in ordinary, unindexed columns. This functionality is gated behind the 23.1 version. Release note (sql change): permit non-indexed storage of tsvector and tsquery datatypes
274ad78
to
c6cb646
Compare
bors r+ |
Build failed (retrying...): |
Build failed (retrying...): |
Build failed (retrying...): |
Build failed (retrying...): |
Build failed (retrying...): |
Build succeeded: |
This commit adds the ability to store tsvector and tsquery data in ordinary, unindexed columns.
Updates #41288
This functionality is gated behind the 23.1 version.
Epic: CRDB-22357
Release note (sql change): permit non-indexed storage of tsvector and tsquery datatypes