2019-06-07 14:59:41 +00:00
|
|
|
DROP TABLE IF EXISTS set;
|
|
|
|
DROP TABLE IF EXISTS set2;
|
2023-11-21 15:57:53 +00:00
|
|
|
DROP TABLE IF EXISTS tab;
|
2015-01-27 00:52:03 +00:00
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
CREATE TABLE set (x String) ENGINE = Set;
|
2015-01-27 00:52:03 +00:00
|
|
|
|
|
|
|
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
|
|
|
|
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s NOT IN set;
|
|
|
|
|
|
|
|
INSERT INTO set VALUES ('Hello'), ('World');
|
|
|
|
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
|
|
|
|
|
|
|
|
RENAME TABLE set TO set2;
|
|
|
|
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
|
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
INSERT INTO set2 VALUES ('Hello'), ('World');
|
2015-01-27 00:52:03 +00:00
|
|
|
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
|
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
INSERT INTO set2 VALUES ('abc'), ('World');
|
2015-01-27 00:52:03 +00:00
|
|
|
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
|
|
|
|
|
|
|
|
DETACH TABLE set2;
|
2020-09-09 13:32:50 +00:00
|
|
|
ATTACH TABLE set2;
|
2015-01-27 00:52:03 +00:00
|
|
|
|
|
|
|
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
|
|
|
|
|
|
|
|
RENAME TABLE set2 TO set;
|
|
|
|
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
|
|
|
|
|
2023-11-21 15:57:53 +00:00
|
|
|
create table tab (x String) engine = MergeTree order by x as select 'Hello';
|
2024-07-12 12:49:26 +00:00
|
|
|
SELECT * FROM tab PREWHERE x IN (set) WHERE x IN (set) LIMIT 1 settings enable_analyzer=0;
|
|
|
|
SELECT * FROM tab PREWHERE x IN (set) WHERE x IN (set) LIMIT 1 settings enable_analyzer=1;
|
2023-11-21 15:57:53 +00:00
|
|
|
DROP TABLE tab;
|
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
DROP TABLE set;
|