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

sql: add default_text_search_config #97685

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

jordanlewis
Copy link
Member

@jordanlewis jordanlewis commented Feb 26, 2023

Updates: #41288
Epic: CRDB-22357

All but the last commit are from #92966 and #97677.

This commit adds the default_text_search_config variable for the tsearch
package, which allows the user to set a default configuration for the
text search builtin functions that take configurations, such as
to_tsvector and to_tsquery. The default for this configuration variable
is 'english', as it is in Postgres.

Release note (sql change): add the default_text_search_config variable
for compatibility with the single-argument variants of the text search
functions to_tsvector, to_tsquery, phraseto_tsquery, and
plainto_tsquery, which use the value of default_text_search_config
instead of expecting one to be included as in the two-argument variants.
The default value of this setting is 'english'.

@jordanlewis jordanlewis requested review from rafiss and a team February 26, 2023 00:03
@jordanlewis jordanlewis requested review from a team as code owners February 26, 2023 00:04
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jordanlewis jordanlewis force-pushed the default-text-search-config branch 2 times, most recently from fc1cbc8 to 0688295 Compare February 26, 2023 17:48
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

lgtm!

Reviewed 1 of 14 files at r4.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @yuzefovich)

@yuzefovich
Copy link
Member

@jordanlewis I was randomly picked to be a reviewer from Queries, but haven't looked. Let me know if you think this PR should get another set of eyes on it.

@jordanlewis jordanlewis force-pushed the default-text-search-config branch from 0688295 to e48a31e Compare March 15, 2023 01:39
@jordanlewis
Copy link
Member Author

I believe the failures are flakes...

@rafiss do you know about this one?

No pass/skip/fail event found for test
=== RUN   TestLogic_mixed_version_new_system_privileges
    test_log_scope.go:161: test logs captured to: /artifacts/tmp/_tmp/05f41fe20a8f675a3109f74bcec0ff8f/logTestLogic_mixed_version_new_system_privileges3644110425
    test_log_scope.go:79: use -show-logs to present logs inline
panic: empty connection string
goroutine 125 [running]:
github.com/cockroachdb/cockroach-go/v2/testserver.(*testServerImpl).pollListeningURLFile(0xc00093e000, 0x1)
  github.com/cockroachdb/cockroach-go/v2/testserver/external/com_github_cockroachdb_cockroach_go_v2/testserver/testserver.go:737 +0x765
github.com/cockroachdb/cockroach-go/v2/testserver.(*testServerImpl).StartNode.func1()
  github.com/cockroachdb/cockroach-go/v2/testserver/external/com_github_cockroachdb_cockroach_go_v2/testserver/testservernode.go:109 +0x2f
created by github.com/cockroachdb/cockroach-go/v2/testserver.(*testServerImpl).StartNode
  github.com/cockroachdb/cockroach-go/v2/testserver/external/com_github_cockroachdb_cockroach_go_v2/testserver/testservernode.go:108 +0xcbb

@rafiss
Copy link
Collaborator

rafiss commented Mar 15, 2023

you can rebase. that test is skipped now, a d I'm working on deflaking it

@jordanlewis jordanlewis force-pushed the default-text-search-config branch 2 times, most recently from 34060b7 to 7550c46 Compare March 21, 2023 01:48
This commit adds the default_text_search_config variable for the tsearch
package, which allows the user to set a default configuration for the
text search builtin functions that take configurations, such as
to_tsvector and to_tsquery. The default for this configuration variable
is 'english', as it is in Postgres.

Release note (sql change): add the default_text_search_config variable
for compatibility with the single-argument variants of the text search
functions to_tsvector, to_tsquery, phraseto_tsquery, and
plainto_tsquery, which use the value of default_text_search_config
instead of expecting one to be included as in the two-argument variants.
The default value of this setting is 'english'.
@jordanlewis jordanlewis force-pushed the default-text-search-config branch from 7550c46 to 8ca25df Compare March 21, 2023 12:58
@jordanlewis
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 21, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 21, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 21, 2023

Build succeeded:

@craig craig bot merged commit b26b338 into cockroachdb:master Mar 21, 2023
craig bot pushed a commit that referenced this pull request Mar 22, 2023
97697: tsearch: add ts_rank functionality r=jordanlewis a=jordanlewis

Updates: #41288
Epic: CRDB-22357
All but the last commit are from #92966, #97677, and #97685

    This commit adds ts_rank, the family of builtins that allow ranking of
    text search results. The function takes a tsquery and a tsvector and
    returns a float that indicates how good the match is. The function can
    be modified by passing in a custom array of weights that matches the
    text search weights A, B, C, and D, and a bitmask that controls the
    ranking behavior in various detailed ways.

    See the excellent Postgres documentation here for details:
    https://www.postgresql.org/docs/current/textsearch-controls.html

    Release note (sql change): add the ts_rank function for ranking text
    search query results

98776: storage: unify storage/fs.FS and pebble/vfs.FS r=jbowens a=jbowens

The storage/fs.FS had largely the same interface as vfs.FS. The storage/fs.FS interface was intended as a temporary stepping stone to using pebble's vfs.FS interface throughout Cockroach for all filesystem access. This commit unifies the two.

Epic: None
Release note: None

99114: kvserver: fix and unskip TestCheckConsistencyInconsistent r=erikgrinaker a=pavelkalinnikov

This PR unskips `TestCheckConsistencyInconsistent` which was skipped for a reason that no longer holds.

It also fixes the race possible in `TestCheckConsistencyInconsistent`:
- Node 2 is corrupted.
- The second phase of `runConsistency` check times out on node 1, and returns early when only nodes 2 and 3 have created the storage checkpoint.
- Node 1 haven't created the checkpoint, but has started doing so.
- Node 2 "fatals" (mocked out in the test) shortly after the check is complete.
- Node 1 is still creating its checkpoint, but has probably created the directory by now.
- Hence, the test assumes that the checkpoint has been created, and proceeds to open it and compute the checksum of the range.

The test now waits for the moment when all the checkpoint are known to be fully populated.

Fixes #81819
Epic: none
Release note: none

Co-authored-by: Jordan Lewis <[email protected]>
Co-authored-by: Jackson Owens <[email protected]>
Co-authored-by: Pavel Kalinnikov <[email protected]>
@jordanlewis jordanlewis deleted the default-text-search-config branch March 22, 2023 21:10
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.

4 participants