2021-03-09 14:10:28 +00:00
|
|
|
#include <DataTypes/DataTypeUUID.h>
|
|
|
|
#include <DataTypes/DataTypeFactory.h>
|
|
|
|
#include <DataTypes/Serializations/SerializationUUID.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
bool DataTypeUUID::equals(const IDataType & rhs) const
|
|
|
|
{
|
|
|
|
return typeid(rhs) == typeid(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
SerializationPtr DataTypeUUID::doGetDefaultSerialization() const
|
|
|
|
{
|
|
|
|
return std::make_shared<SerializationUUID>();
|
|
|
|
}
|
|
|
|
|
2021-05-03 22:46:51 +00:00
|
|
|
Field DataTypeUUID::getDefault() const
|
|
|
|
{
|
|
|
|
return UUID{};
|
|
|
|
}
|
|
|
|
|
|
|
|
MutableColumnPtr DataTypeUUID::createColumn() const
|
|
|
|
{
|
|
|
|
return ColumnVector<UUID>::create();
|
|
|
|
}
|
|
|
|
|
2021-03-09 14:10:28 +00:00
|
|
|
void registerDataTypeUUID(DataTypeFactory & factory)
|
|
|
|
{
|
|
|
|
factory.registerSimpleDataType("UUID", [] { return DataTypePtr(std::make_shared<DataTypeUUID>()); });
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|