mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
Support for UUID in ODBC dictionaries
This commit is contained in:
parent
d1a548638f
commit
a9b3279265
@ -4,6 +4,7 @@
|
||||
#include <DataTypes/DataTypeString.h>
|
||||
#include <DataTypes/DataTypeDate.h>
|
||||
#include <DataTypes/DataTypeDateTime.h>
|
||||
#include <DataTypes/DataTypeUUID.h>
|
||||
#include <Common/typeid_cast.h>
|
||||
|
||||
|
||||
@ -55,6 +56,8 @@ void ExternalResultDescription::init(const Block & sample_block_)
|
||||
types.push_back(ValueType::Date);
|
||||
else if (typeid_cast<const DataTypeDateTime *>(type))
|
||||
types.push_back(ValueType::DateTime);
|
||||
else if (typeid_cast<const DataTypeUUID *>(type))
|
||||
types.push_back(ValueType::UUID);
|
||||
else
|
||||
throw Exception{"Unsupported type " + type->getName(), ErrorCodes::UNKNOWN_TYPE};
|
||||
|
||||
|
@ -24,7 +24,8 @@ struct ExternalResultDescription
|
||||
Float64,
|
||||
String,
|
||||
Date,
|
||||
DateTime
|
||||
DateTime,
|
||||
UUID
|
||||
};
|
||||
|
||||
Block sample_block;
|
||||
|
@ -59,6 +59,8 @@ namespace
|
||||
case ValueType::String: static_cast<ColumnString &>(column).insert(value.convert<String>()); break;
|
||||
case ValueType::Date: static_cast<ColumnUInt16 &>(column).insert(UInt16{LocalDate{value.convert<String>()}.getDayNum()}); break;
|
||||
case ValueType::DateTime: static_cast<ColumnUInt32 &>(column).insert(time_t{LocalDateTime{value.convert<String>()}}); break;
|
||||
case ValueType::UUID: static_cast<ColumnUInt128 &>(column).insert(value.convert<UInt128>()); break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user