forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTypeFixedString.h
More file actions
58 lines (40 loc) · 1.68 KB
/
Copy pathDataTypeFixedString.h
File metadata and controls
58 lines (40 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include <DataTypes/IDataType.h>
constexpr size_t MAX_FIXEDSTRING_SIZE = 0xFFFFFF;
constexpr size_t MAX_FIXEDSTRING_SIZE_WITHOUT_SUSPICIOUS = 256;
namespace DB
{
class ColumnFixedString;
class DataTypeFixedString final : public IDataType
{
private:
size_t n;
public:
using ColumnType = ColumnFixedString;
static constexpr bool is_parametric = true;
static constexpr auto type_id = TypeIndex::FixedString;
explicit DataTypeFixedString(size_t n_);
std::string doGetName() const override;
TypeIndex getTypeId() const override { return type_id; }
const char * getFamilyName() const override { return "FixedString"; }
size_t getN() const
{
return n;
}
MutableColumnPtr createColumn() const override;
Field getDefault() const override;
bool equals(const IDataType & rhs) const override;
SerializationPtr doGetSerialization(const SerializationInfoSettings &) const override;
bool isParametric() const override { return true; }
bool haveSubtypes() const override { return false; }
bool isComparable() const override { return true; }
bool isValueUnambiguouslyRepresentedInContiguousMemoryRegion() const override { return true; }
bool isValueUnambiguouslyRepresentedInFixedSizeContiguousMemoryRegion() const override { return true; }
bool haveMaximumSizeOfValue() const override { return true; }
size_t getSizeOfValueInMemory() const override { return n; }
bool isCategorial() const override { return true; }
bool canBeInsideNullable() const override { return true; }
bool canBeInsideLowCardinality() const override { return true; }
void updateHashImpl(SipHash & hash) const override;
};
}