2017-12-07 08:31:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DataTypes/IDataTypeDummy.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/** Data type that cannot have any values.
|
|
|
|
* Used to represent NULL of unknown type as Nullable(Nothing),
|
|
|
|
* and possibly for empty array of unknown type as Array(Nothing).
|
|
|
|
*/
|
|
|
|
class DataTypeNothing final : public IDataTypeDummy
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr bool is_parametric = false;
|
|
|
|
|
2017-12-07 22:11:51 +00:00
|
|
|
const char * getFamilyName() const override { return "Nothing"; }
|
2018-09-07 14:37:26 +00:00
|
|
|
TypeIndex getTypeId() const override { return TypeIndex::Nothing; }
|
2017-12-07 08:31:47 +00:00
|
|
|
|
2017-12-14 03:56:56 +00:00
|
|
|
MutableColumnPtr createColumn() const override;
|
2017-12-07 08:31:47 +00:00
|
|
|
|
|
|
|
/// These methods read and write zero bytes just to allow to figure out size of column.
|
2019-02-19 00:41:24 +00:00
|
|
|
void serializeBinaryBulk(const IColumn & column, WriteBuffer & ostr, size_t offset, size_t limit) const override;
|
|
|
|
void deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double avg_value_size_hint) const override;
|
2017-12-09 06:32:22 +00:00
|
|
|
|
2017-12-23 01:05:29 +00:00
|
|
|
bool equals(const IDataType & rhs) const override;
|
|
|
|
|
2017-12-09 06:32:22 +00:00
|
|
|
bool isParametric() const override { return false; }
|
|
|
|
bool textCanContainOnlyValidUTF8() const override { return true; }
|
|
|
|
bool haveMaximumSizeOfValue() const override { return true; }
|
|
|
|
size_t getSizeOfValueInMemory() const override { return 0; }
|
|
|
|
bool canBeInsideNullable() const override { return true; }
|
2017-12-07 08:31:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|