cockroachdb / cockroachdb/cockroach

QA: TSQuery/TSVector functions return "unknown signature" instead of "unimplemented" error

Open
#98,724 0 comments 0 reactions 0 assignees View on GitHub
C-bug O-qa T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

From [TSVector and TSQuery QA](https://gist.github.com/msirek/2c4aef2a3c2038f6b9f3a6fa443ad6da), some references to functions return `ERROR: unknown signature` instead of similar statements, that return an "unimplemented" error, like the following:
```sql
SELECT array_to_tsvector('{one,two,three}'::text[]);
ERROR: array_to_tsvector(): unimplemented: this function is not yet supported
SQLSTATE: 0A000
HINT: You have attempted to use a feature that is not yet implemented.
See: https://go.crdb.dev/issue-v/7821/v23.1
```
Here are some examples that return the "unknown signature" error:
```
SELECT length('fat:2,4 cat:3 rat:5A'::tsvector);
SELECT to_tsvector('english', '{"aa": "The Fat Rats", "b": "dog"}'::json);
SELECT to_tsvector('english', '{"aa": "The Fat Rats", "b": "dog"}'::jsonb);
SELECT * from unnest('cat:3 fat:2,4 rat:5A'::tsvector);
SELECT to_tsvector('fat cats ate rats') @@ to_tsquery('cat & rat');
SELECT 'fat cats ate rats' @@ to_tsquery('cat & rat');
SELECT to_tsvector('simple', '{"aa": "The Fat Rats", "b": "dog"}'::json);
SELECT to_tsvector('simple', '{"aa": "The Fat Rats", "b": "dog"}'::jsonb);
```
Do we want to fix some of these up to return the "unimplemented" error, or does this not matter?

The following also returns "unknown function" instead of "unimplemented":
```
CREATE TABLE apod (vector tsvector);
SELECT ts_stat('SELECT vector FROM apod');
```

Jira issue: CRDB-25465

Contributor guide

Open the contributing guide

Research direction

Start by running the listed TSVector and TSQuery SQL examples and compare their errors with array_to_tsvector's unimplemented response. Review the linked TSVector and TSQuery QA references and Jira issue CRDB-25465 to determine which unsupported functions are in scope. Done means the agreed functions consistently report the intended unsupported-feature error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.