forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIDataTypeDummy.h
50 lines (39 loc) · 1.4 KB
/
IDataTypeDummy.h
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
#pragma once
#include <DataTypes/IDataType.h>
#include <Core/Field.h>
namespace DB
{
namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
}
/** The base class for data types that do not support serialization and deserialization,
* but arise only as an intermediate result of the calculations.
*
* That is, this class is used just to distinguish the corresponding data type from the others.
*/
class IDataTypeDummy : public IDataType
{
private:
[[noreturn]] void throwNoSerialization() const
{
throw Exception("Serialization is not implemented for data type " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
public:
MutableColumnPtr createColumn() const override
{
throw Exception("Method createColumn() is not implemented for data type " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
Field getDefault() const override
{
throw Exception("Method getDefault() is not implemented for data type " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
void insertDefaultInto(IColumn &) const override
{
throw Exception("Method insertDefaultInto() is not implemented for data type " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
bool haveSubtypes() const override { return false; }
bool cannotBeStoredInTables() const override { return true; }
SerializationPtr doGetDefaultSerialization() const override { throwNoSerialization(); }
};
}