Skip to content

Commit ab0af07

Browse files
authored
Merge pull request #83 from Enmk/int128_creation
Ensure that users can create Int128 and UUID columns
2 parents 8ca55ca + a40c56c commit ab0af07

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

clickhouse/columns/factory.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ static ColumnRef CreateTerminalColumn(const TypeAst& ast) {
4444
return std::make_shared<ColumnInt32>();
4545
case Type::Int64:
4646
return std::make_shared<ColumnInt64>();
47+
case Type::Int128:
48+
return std::make_shared<ColumnInt128>();
4749

4850
case Type::Float32:
4951
return std::make_shared<ColumnFloat32>();

clickhouse/types/type_parser.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ static const std::unordered_map<std::string, Type::Code> kTypeCode = {
4040
{ "UUID", Type::UUID },
4141
{ "IPv4", Type::IPv4 },
4242
{ "IPv6", Type::IPv6 },
43+
{ "Int128", Type::Int128 },
4344
{ "Decimal", Type::Decimal },
4445
{ "Decimal32", Type::Decimal32 },
4546
{ "Decimal64", Type::Decimal64 },

clickhouse/types/types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ inline TypeRef Type::CreateSimple<int64_t>() {
285285
}
286286

287287
template <>
288-
inline TypeRef Type::CreateSimple<absl::int128>() {
288+
inline TypeRef Type::CreateSimple<Int128>() {
289289
return TypeRef(new Type(Int128));
290290
}
291291

ut/columns_ut.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,8 @@ TEST_P(ColumnsCaseWithName, CreateColumnByType)
712712
INSTANTIATE_TEST_CASE_P(Basic, ColumnsCaseWithName, ::testing::Values(
713713
"Int8", "Int16", "Int32", "Int64",
714714
"UInt8", "UInt16", "UInt32", "UInt64",
715-
"String", "Date", "DateTime"
715+
"String", "Date", "DateTime",
716+
"UUID", "Int128"
716717
));
717718

718719
INSTANTIATE_TEST_CASE_P(Parametrized, ColumnsCaseWithName, ::testing::Values(

0 commit comments

Comments
 (0)