ClickHouse/src/DataTypes/DataTypeUUID.h

47 lines
1.5 KiB
C++
Raw Normal View History

#pragma once
#include <DataTypes/IDataType.h>
2021-05-03 22:46:51 +00:00
#include <Columns/ColumnVector.h>
#include <Core/UUID.h>
namespace DB
{
2021-05-03 22:46:51 +00:00
class DataTypeUUID : public IDataType
{
public:
2021-05-03 22:46:51 +00:00
static constexpr bool is_parametric = false;
using FieldType = UUID;
using ColumnType = ColumnVector<UUID>;
const char * getFamilyName() const override { return "UUID"; }
TypeIndex getTypeId() const override { return TypeIndex::UUID; }
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; }
bool equals(const IDataType & rhs) const override;
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;
};
}