2012-08-23 18:05:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-09-18 13:28:46 +00:00
|
|
|
#include <DataTypes/DataTypeWithSimpleSerialization.h>
|
2019-10-04 17:46:36 +00:00
|
|
|
#include <Core/Field.h>
|
2012-08-23 18:05:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2019-10-04 17:46:36 +00:00
|
|
|
namespace ErrorCodes
|
|
|
|
{
|
|
|
|
extern const int NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
2017-04-17 11:56:55 +00:00
|
|
|
/** The base class for data types that do not support serialization and deserialization,
|
|
|
|
* but arise only as an intermediate result of the calculations.
|
2012-08-23 18:05:31 +00:00
|
|
|
*
|
2017-04-17 11:56:55 +00:00
|
|
|
* That is, this class is used just to distinguish the corresponding data type from the others.
|
2012-08-23 18:05:31 +00:00
|
|
|
*/
|
2018-09-18 13:28:46 +00:00
|
|
|
class IDataTypeDummy : public DataTypeWithSimpleSerialization
|
2012-08-23 18:05:31 +00:00
|
|
|
{
|
|
|
|
private:
|
2019-04-10 20:27:14 +00:00
|
|
|
[[noreturn]] void throwNoSerialization() const
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
|
|
|
throw Exception("Serialization is not implemented for data type " + getName(), ErrorCodes::NOT_IMPLEMENTED);
|
|
|
|
}
|
2012-08-23 18:05:31 +00:00
|
|
|
|
|
|
|
public:
|
2017-12-01 19:34:51 +00:00
|
|
|
void serializeBinary(const Field &, WriteBuffer &) const override { throwNoSerialization(); }
|
|
|
|
void deserializeBinary(Field &, ReadBuffer &) const override { throwNoSerialization(); }
|
|
|
|
void serializeBinary(const IColumn &, size_t, WriteBuffer &) const override { throwNoSerialization(); }
|
|
|
|
void deserializeBinary(IColumn &, ReadBuffer &) const override { throwNoSerialization(); }
|
|
|
|
void serializeBinaryBulk(const IColumn &, WriteBuffer &, size_t, size_t) const override { throwNoSerialization(); }
|
|
|
|
void deserializeBinaryBulk(IColumn &, ReadBuffer &, size_t, double) const override { throwNoSerialization(); }
|
2018-09-18 13:28:46 +00:00
|
|
|
void serializeText(const IColumn &, size_t, WriteBuffer &, const FormatSettings &) const override { throwNoSerialization(); }
|
2019-02-19 20:01:31 +00:00
|
|
|
void deserializeText(IColumn &, ReadBuffer &, const FormatSettings &) const override { throwNoSerialization(); }
|
2019-02-26 14:06:05 +00:00
|
|
|
void serializeProtobuf(const IColumn &, size_t, ProtobufWriter &, size_t &) const override { throwNoSerialization(); }
|
2019-02-19 20:01:31 +00:00
|
|
|
void deserializeProtobuf(IColumn &, ProtobufReader &, bool, bool &) const override { throwNoSerialization(); }
|
2016-02-07 08:42:21 +00:00
|
|
|
|
2017-12-14 03:56:56 +00:00
|
|
|
MutableColumnPtr createColumn() const override
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
|
|
|
throw Exception("Method createColumn() is not implemented for data type " + getName(), ErrorCodes::NOT_IMPLEMENTED);
|
|
|
|
}
|
2012-08-23 18:05:31 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
Field getDefault() const override
|
|
|
|
{
|
|
|
|
throw Exception("Method getDefault() is not implemented for data type " + getName(), ErrorCodes::NOT_IMPLEMENTED);
|
|
|
|
}
|
2017-09-01 21:37:57 +00:00
|
|
|
|
2017-12-01 19:34:51 +00:00
|
|
|
void insertDefaultInto(IColumn &) const override
|
2017-09-01 21:37:57 +00:00
|
|
|
{
|
|
|
|
throw Exception("Method insertDefaultInto() is not implemented for data type " + getName(), ErrorCodes::NOT_IMPLEMENTED);
|
|
|
|
}
|
2017-12-09 06:32:22 +00:00
|
|
|
|
|
|
|
bool haveSubtypes() const override { return false; }
|
|
|
|
bool cannotBeStoredInTables() const override { return true; }
|
2012-08-23 18:05:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|