2017-06-15 09:12:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DataTypes/IDataType.h>
|
2021-05-03 22:46:51 +00:00
|
|
|
#include <Columns/ColumnVector.h>
|
|
|
|
#include <Core/UUID.h>
|
|
|
|
|
2017-06-15 09:12:32 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-05-03 22:46:51 +00:00
|
|
|
class DataTypeUUID : public IDataType
|
2017-06-15 09:12:32 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-05-03 22:46:51 +00:00
|
|
|
static constexpr bool is_parametric = false;
|
|
|
|
|
|
|
|
using FieldType = UUID;
|
|
|
|
using ColumnType = ColumnVector<UUID>;
|
|
|
|
|
2017-07-16 03:05:40 +00:00
|
|
|
const char * getFamilyName() const override { return "UUID"; }
|
2018-08-20 15:17:55 +00:00
|
|
|
TypeIndex getTypeId() const override { return TypeIndex::UUID; }
|
2017-06-15 09:12:32 +00:00
|
|
|
|
2021-05-03 22:46:51 +00:00
|
|
|
Field getDefault() const override;
|
|
|
|
|
|
|
|
MutableColumnPtr createColumn() const override;
|
|
|
|
|
|
|
|
bool isParametric() const override { return false; }
|
|
|
|
bool haveSubtypes() const override { return false; }
|
|
|
|
|
2017-12-23 01:05:29 +00:00
|
|
|
bool equals(const IDataType & rhs) const override;
|
|
|
|
|
2017-12-09 06:32:22 +00:00
|
|
|
bool canBeUsedInBitOperations() const override { return true; }
|
|
|
|
bool canBeInsideNullable() const override { return true; }
|
2020-06-14 04:35:50 +00:00
|
|
|
bool canBePromoted() const override { return false; }
|
2021-05-03 22:46:51 +00:00
|
|
|
bool shouldAlignRightInPrettyFormats() const override { return false; }
|
|
|
|
bool textCanContainOnlyValidUTF8() const override { return true; }
|
|
|
|
bool isComparable() const override { return true; }
|
|
|
|
bool isValueUnambiguouslyRepresentedInContiguousMemoryRegion() const override { return true; }
|
|
|
|
bool haveMaximumSizeOfValue() const override { return true; }
|
|
|
|
size_t getSizeOfValueInMemory() const override { return sizeof(UUID); }
|
|
|
|
bool isCategorial() const override { return true; }
|
|
|
|
bool canBeInsideLowCardinality() const override { return true; }
|
2021-03-09 14:10:28 +00:00
|
|
|
|
|
|
|
SerializationPtr doGetDefaultSerialization() const override;
|
2017-06-15 09:12:32 +00:00
|
|
|
};
|
2017-12-09 06:32:22 +00:00
|
|
|
|
2017-06-15 09:12:32 +00:00
|
|
|
}
|