Files
greptimedb/tests/cases/standalone/common/create/create_with_fulltext.result
Zhenchi 00308218b3 feat(fulltext_index): allow enable full-text index in SQL and gRPC way (#4310)
* feat(fulltext_index): allow enable full-text index in SQL and gRPC way

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: typo

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* chore: polish

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: test_fulltext_intm_path

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* address comments

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* refactor: explicitly build column options

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* test: fix error msg

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: address comments

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: polish

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

---------

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
2024-07-08 20:18:48 +00:00

102 lines
5.0 KiB
Plaintext

CREATE TABLE log (
ts TIMESTAMP TIME INDEX,
msg STRING FULLTEXT,
);
Affected Rows: 0
SHOW CREATE TABLE log;
+-------+------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------+
| log | CREATE TABLE IF NOT EXISTS "log" ( |
| | "ts" TIMESTAMP(3) NOT NULL, |
| | "msg" STRING NULL FULLTEXT WITH(analyzer = 'English', case_sensitive = 'false'), |
| | TIME INDEX ("ts") |
| | ) |
| | |
| | ENGINE=mito |
| | |
+-------+------------------------------------------------------------------------------------+
DROP TABLE log;
Affected Rows: 0
CREATE TABLE log_with_opts (
ts TIMESTAMP TIME INDEX,
msg TEXT FULLTEXT WITH (analyzer='English', case_sensitive='true'),
);
Affected Rows: 0
SHOW CREATE TABLE log_with_opts;
+---------------+-----------------------------------------------------------------------------------+
| Table | Create Table |
+---------------+-----------------------------------------------------------------------------------+
| log_with_opts | CREATE TABLE IF NOT EXISTS "log_with_opts" ( |
| | "ts" TIMESTAMP(3) NOT NULL, |
| | "msg" STRING NULL FULLTEXT WITH(analyzer = 'English', case_sensitive = 'true'), |
| | TIME INDEX ("ts") |
| | ) |
| | |
| | ENGINE=mito |
| | |
+---------------+-----------------------------------------------------------------------------------+
DROP TABLE log_with_opts;
Affected Rows: 0
CREATE TABLE log_multi_fulltext_cols (
ts TIMESTAMP TIME INDEX,
msg TINYTEXT FULLTEXT,
msg2 VARCHAR FULLTEXT,
);
Affected Rows: 0
SHOW CREATE TABLE log_multi_fulltext_cols;
+-------------------------+-------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------------------+-------------------------------------------------------------------------------------+
| log_multi_fulltext_cols | CREATE TABLE IF NOT EXISTS "log_multi_fulltext_cols" ( |
| | "ts" TIMESTAMP(3) NOT NULL, |
| | "msg" STRING NULL FULLTEXT WITH(analyzer = 'English', case_sensitive = 'false'), |
| | "msg2" STRING NULL FULLTEXT WITH(analyzer = 'English', case_sensitive = 'false'), |
| | TIME INDEX ("ts") |
| | ) |
| | |
| | ENGINE=mito |
| | |
+-------------------------+-------------------------------------------------------------------------------------+
DROP TABLE log_multi_fulltext_cols;
Affected Rows: 0
CREATE TABLE log_dup_fulltext_opts (
ts TIMESTAMP TIME INDEX,
msg TEXT FULLTEXT FULLTEXT,
);
Error: 1004(InvalidArguments), Invalid column option, column name: msg, error: duplicated FULLTEXT option
CREATE TABLE log_with_invalid_type (
ts TIMESTAMP TIME INDEX,
msg INT FULLTEXT,
);
Error: 1004(InvalidArguments), Invalid column option, column name: msg, error: FULLTEXT index only supports string type
CREATE TABLE log_with_invalid_option (
ts TIMESTAMP TIME INDEX,
msg TEXT FULLTEXT WITH (analyzer='English', invalid_option='true'),
);
Error: 1004(InvalidArguments), Invalid column option, column name: msg, error: invalid FULLTEXT option: invalid_option