mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 13:22:57 +00:00
* feat(WIP): alter fulltext index Co-Authored-By: irenjj <renj.jiang@gmail.com> * feat: alter column fulltext option Co-Authored-By: irenjj <renj.jiang@gmail.com> * chore: fmt * test: add unit and integration tests Co-Authored-By: irenjj <renj.jiang@gmail.com> * test: update sqlness test * chore: new line * chore: lock file update * chore: apply review comments * test: update sqlness test * test: update sqlness test * fix: convert * chore: apply review comments * fix: toml fmt * fix: tests * test: add test for mito * chore: error message * fix: test * fix: test * fix: wrong comment * chore: change proto rev * chore: apply review comments * chore: apply review comments * chore: fmt --------- Co-authored-by: irenjj <renj.jiang@gmail.com>
53 lines
1.6 KiB
SQL
53 lines
1.6 KiB
SQL
CREATE TABLE `test` (
|
|
`message` STRING,
|
|
`time` TIMESTAMP TIME INDEX,
|
|
) WITH (
|
|
append_mode = 'true'
|
|
);
|
|
|
|
SHOW CREATE TABLE test;
|
|
|
|
-- Write/read after altering column fulltext options
|
|
INSERT INTO test VALUES ('hello', '2020-01-01 00:00:00'),
|
|
('world', '2020-01-01 00:00:01'),
|
|
('hello world', '2020-01-02 00:00:00'),
|
|
('world hello', '2020-01-02 00:00:01');
|
|
|
|
SELECT * FROM test WHERE MATCHES(message, 'hello');
|
|
|
|
ALTER TABLE test MODIFY COLUMN message SET FULLTEXT WITH(analyzer = 'Chinese', case_sensitive = 'true');
|
|
|
|
SELECT * FROM test WHERE MATCHES(message, 'hello');
|
|
|
|
INSERT INTO test VALUES ('hello NiKo', '2020-01-03 00:00:00'),
|
|
('NiKo hello', '2020-01-03 00:00:01'),
|
|
('hello hello', '2020-01-04 00:00:00'),
|
|
('NiKo, NiKo', '2020-01-04 00:00:01');
|
|
|
|
SELECT * FROM test WHERE MATCHES(message, 'hello');
|
|
|
|
-- SQLNESS ARG restart=true
|
|
SHOW CREATE TABLE test;
|
|
|
|
ALTER TABLE test MODIFY COLUMN message SET FULLTEXT WITH(enable = 'false');
|
|
|
|
SHOW CREATE TABLE test;
|
|
|
|
ALTER TABLE test MODIFY COLUMN message SET FULLTEXT WITH(analyzer = 'English', case_sensitive = 'true');
|
|
|
|
SHOW CREATE TABLE test;
|
|
|
|
ALTER TABLE test MODIFY COLUMN message SET FULLTEXT WITH(analyzer = 'Chinese', case_sensitive = 'false');
|
|
|
|
ALTER TABLE test MODIFY COLUMN message SET FULLTEXT WITH(enable = 'false');
|
|
|
|
SHOW CREATE TABLE test;
|
|
|
|
ALTER TABLE test MODIFY COLUMN message SET FULLTEXT WITH(analyzer = 'Chinglish', case_sensitive = 'false');
|
|
|
|
ALTER TABLE test MODIFY COLUMN message SET FULLTEXT WITH(analyzer = 'Chinese', case_sensitive = 'no');
|
|
|
|
ALTER TABLE test MODIFY COLUMN time SET FULLTEXT WITH(analyzer = 'Chinese', case_sensitive = 'false');
|
|
|
|
DROP TABLE test;
|