mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
LowCardinality UUID fix
This commit is contained in:
parent
a1d9eee0b5
commit
105ecef628
@ -885,15 +885,17 @@ MutableColumnUniquePtr DataTypeLowCardinality::createColumnUniqueImpl(const IDat
|
|||||||
if (const auto * nullable_type = typeid_cast<const DataTypeNullable *>(&keys_type))
|
if (const auto * nullable_type = typeid_cast<const DataTypeNullable *>(&keys_type))
|
||||||
type = nullable_type->getNestedType().get();
|
type = nullable_type->getNestedType().get();
|
||||||
|
|
||||||
if (isString(type))
|
WhichDataType which(type);
|
||||||
|
|
||||||
|
if (which.isString())
|
||||||
return creator(static_cast<ColumnString *>(nullptr));
|
return creator(static_cast<ColumnString *>(nullptr));
|
||||||
if (isFixedString(type))
|
else if (which.isFixedString())
|
||||||
return creator(static_cast<ColumnFixedString *>(nullptr));
|
return creator(static_cast<ColumnFixedString *>(nullptr));
|
||||||
if (typeid_cast<const DataTypeDate *>(type))
|
else if (which.isDate())
|
||||||
return creator(static_cast<ColumnVector<UInt16> *>(nullptr));
|
return creator(static_cast<ColumnVector<UInt16> *>(nullptr));
|
||||||
if (typeid_cast<const DataTypeDateTime *>(type))
|
else if (which.isDateTime())
|
||||||
return creator(static_cast<ColumnVector<UInt32> *>(nullptr));
|
return creator(static_cast<ColumnVector<UInt32> *>(nullptr));
|
||||||
if (isColumnedAsNumber(type))
|
else if (which.isInt() || which.isUInt() || which.isFloat())
|
||||||
{
|
{
|
||||||
MutableColumnUniquePtr column;
|
MutableColumnUniquePtr column;
|
||||||
TypeListNativeNumbers::forEach(CreateColumnVector(column, *type, creator));
|
TypeListNativeNumbers::forEach(CreateColumnVector(column, *type, creator));
|
||||||
|
@ -31,6 +31,7 @@ public:
|
|||||||
|
|
||||||
bool canBeUsedInBitOperations() const override { return true; }
|
bool canBeUsedInBitOperations() const override { return true; }
|
||||||
bool canBeInsideNullable() const override { return true; }
|
bool canBeInsideNullable() const override { return true; }
|
||||||
|
bool canBeInsideLowCardinality() const override { return false; }
|
||||||
|
|
||||||
bool canBePromoted() const override { return false; }
|
bool canBePromoted() const override { return false; }
|
||||||
};
|
};
|
||||||
|
@ -18,3 +18,6 @@ c
|
|||||||
d
|
d
|
||||||
cb
|
cb
|
||||||
db
|
db
|
||||||
|
-
|
||||||
|
61f0c404-5cb3-11e7-907b-a6006ad3dba0 61f0c404-5cb3-11e7-907b-a6006ad3dba0 61f0c404-5cb3-11e7-907b-a6006ad3dba0
|
||||||
|
\N \N \N
|
||||||
|
@ -71,3 +71,12 @@ select (toLowCardinality('a') as val) || 'b' group by val;
|
|||||||
select toLowCardinality(z) as val from (select arrayJoin(['c', 'd']) as z) group by val;
|
select toLowCardinality(z) as val from (select arrayJoin(['c', 'd']) as z) group by val;
|
||||||
select (toLowCardinality(z) as val) || 'b' from (select arrayJoin(['c', 'd']) as z) group by val;
|
select (toLowCardinality(z) as val) || 'b' from (select arrayJoin(['c', 'd']) as z) group by val;
|
||||||
|
|
||||||
|
select '-';
|
||||||
|
drop table if exists lc_str_uuid;
|
||||||
|
create table lc_str_uuid(str1 String, str2 LowCardinality(String), str3 StringWithDictionary) ENGINE=Memory;
|
||||||
|
select toUUID(str1), toUUID(str2), toUUID(str3) from lc_str_uuid;
|
||||||
|
select toUUID(str1, '', NULL), toUUID(str2, '', NULL), toUUID(str3, '', NULL) from lc_str_uuid;
|
||||||
|
insert into lc_str_uuid values ('61f0c404-5cb3-11e7-907b-a6006ad3dba0', '61f0c404-5cb3-11e7-907b-a6006ad3dba0', '61f0c404-5cb3-11e7-907b-a6006ad3dba0');
|
||||||
|
select toUUID(str1), toUUID(str2), toUUID(str3) from lc_str_uuid;
|
||||||
|
select toUUID(str1, '', NULL), toUUID(str2, '', NULL), toUUID(str3, '', NULL) from lc_str_uuid;
|
||||||
|
drop table if exists lc_str_uuid;
|
||||||
|
Loading…
Reference in New Issue
Block a user