mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Merge pull request #57063 from ClickHouse/fix-duplicate-storage-set-analyzer
Fix `Duplicate set` for StorageSet with analyzer.
This commit is contained in:
commit
54410f16c6
@ -55,6 +55,9 @@ public:
|
||||
{
|
||||
/// Handle storage_set as ready set.
|
||||
auto set_key = in_second_argument->getTreeHash();
|
||||
if (sets.findStorage(set_key))
|
||||
return;
|
||||
|
||||
sets.addFromStorage(set_key, storage_set->getSet());
|
||||
}
|
||||
else if (const auto * constant_node = in_second_argument->as<ConstantNode>())
|
||||
|
@ -19,3 +19,5 @@ abc
|
||||
Hello
|
||||
World
|
||||
abc
|
||||
Hello
|
||||
Hello
|
||||
|
@ -1,5 +1,6 @@
|
||||
DROP TABLE IF EXISTS set;
|
||||
DROP TABLE IF EXISTS set2;
|
||||
DROP TABLE IF EXISTS tab;
|
||||
|
||||
CREATE TABLE set (x String) ENGINE = Set;
|
||||
|
||||
@ -26,4 +27,9 @@ SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s
|
||||
RENAME TABLE set2 TO set;
|
||||
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
|
||||
|
||||
create table tab (x String) engine = MergeTree order by x as select 'Hello';
|
||||
SELECT * FROM tab PREWHERE x IN (set) WHERE x IN (set) LIMIT 1 settings allow_experimental_analyzer=0;
|
||||
SELECT * FROM tab PREWHERE x IN (set) WHERE x IN (set) LIMIT 1 settings allow_experimental_analyzer=1;
|
||||
DROP TABLE tab;
|
||||
|
||||
DROP TABLE set;
|
||||
|
Loading…
Reference in New Issue
Block a user