mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Added missing support for hashing Enums [#METR-20890].
This commit is contained in:
parent
b664f367d8
commit
e4bb35e6e1
@ -15,6 +15,7 @@
|
||||
#include <DB/DataTypes/DataTypeDateTime.h>
|
||||
#include <DB/DataTypes/DataTypeArray.h>
|
||||
#include <DB/DataTypes/DataTypeFixedString.h>
|
||||
#include <DB/DataTypes/DataTypeEnum.h>
|
||||
#include <DB/Columns/ColumnString.h>
|
||||
#include <DB/Columns/ColumnConst.h>
|
||||
#include <DB/Columns/ColumnFixedString.h>
|
||||
@ -555,6 +556,8 @@ private:
|
||||
else if (typeid_cast<const DataTypeInt16 * >(from_type)) executeIntType<Int16, first>(icolumn, vec_to);
|
||||
else if (typeid_cast<const DataTypeInt32 * >(from_type)) executeIntType<Int32, first>(icolumn, vec_to);
|
||||
else if (typeid_cast<const DataTypeInt64 * >(from_type)) executeIntType<Int64, first>(icolumn, vec_to);
|
||||
else if (typeid_cast<const DataTypeEnum8 * >(from_type)) executeIntType<Int8, first>(icolumn, vec_to);
|
||||
else if (typeid_cast<const DataTypeEnum16 * >(from_type)) executeIntType<Int16, first>(icolumn, vec_to);
|
||||
else if (typeid_cast<const DataTypeDate * >(from_type)) executeIntType<UInt16, first>(icolumn, vec_to);
|
||||
else if (typeid_cast<const DataTypeDateTime * >(from_type)) executeIntType<UInt32, first>(icolumn, vec_to);
|
||||
else if (typeid_cast<const DataTypeFloat32 * >(from_type)) executeIntType<Float32, first>(icolumn, vec_to);
|
||||
|
@ -0,0 +1,2 @@
|
||||
2963573356302499406
|
||||
2963573356302499406
|
2
dbms/tests/queries/0_stateless/00324_hashing_enums.sql
Normal file
2
dbms/tests/queries/0_stateless/00324_hashing_enums.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SELECT cityHash64(*) FROM (SELECT 1 AS x, CAST(x AS Enum8('Hello' = 0, 'World' = 1)) AS y);
|
||||
SELECT cityHash64(*) FROM (SELECT 1 AS x, x AS y);
|
Loading…
Reference in New Issue
Block a user