Made IN operator support Array(LowCardinality(Nullable(String)))

This commit is contained in:
philip.han 2019-10-17 19:08:36 +09:00
parent d1eb9b197b
commit 08a348fbd1
3 changed files with 9 additions and 1 deletions

View File

@ -424,7 +424,8 @@ void Set::checkColumnsNumber(size_t num_key_columns) const
void Set::checkTypesEqual(size_t set_type_idx, const DataTypePtr & other_type) const
{
if (!removeNullable(data_types[set_type_idx])->equals(*removeNullable(other_type)))
if (!removeNullable(recursiveRemoveLowCardinality(data_types[set_type_idx]))->equals(*removeNullable(recursiveRemoveLowCardinality(other_type))))
throw Exception("Types of column " + toString(set_type_idx + 1) + " in section IN don't match: "
+ data_types[set_type_idx]->getName() + " on the right, " + other_type->getName() +
" on the left.", ErrorCodes::TYPE_MISMATCH);

View File

@ -10,3 +10,4 @@ a 1
b 1
1 1
2 1
['1']

View File

@ -9,3 +9,9 @@ select val, val in (select arrayJoin([1, 3])) from lc_00688;
select str, str in (select str from lc_00688) from lc_00688;
select val, val in (select val from lc_00688) from lc_00688;
drop table if exists lc_00688;
drop table if exists ary_lc_null;
CREATE TABLE ary_lc_null (i int, v Array(LowCardinality(Nullable(String)))) ENGINE = MergeTree() ORDER BY i ;
INSERT INTO ary_lc_null VALUES (1, ['1']);
SELECT v FROM ary_lc_null WHERE v IN (SELECT v FROM ary_lc_null);
drop table if exists ary_lc_null;