mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
NULLs: fixed error and added TODO [#METR-19266].
This commit is contained in:
parent
ee2c5f0d65
commit
c1a635a3d2
@ -29,7 +29,6 @@ public:
|
||||
bool isNull() const override
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
DataTypePtr clone() const override
|
||||
@ -52,10 +51,10 @@ public:
|
||||
|
||||
Field getDefault() const override
|
||||
{
|
||||
return Field{};
|
||||
return Null();
|
||||
}
|
||||
|
||||
size_t getSizeOfField() const override
|
||||
size_t getSizeOfField() const override /// TODO Check where it is needed.
|
||||
{
|
||||
/// NULL has the size of the smallest non-null type.
|
||||
return sizeof(UInt8);
|
||||
@ -71,7 +70,7 @@ public:
|
||||
{
|
||||
UInt8 x;
|
||||
readBinary(x, istr);
|
||||
field = Field{};
|
||||
field = Null();
|
||||
}
|
||||
|
||||
void serializeBinary(const IColumn & column, size_t row_num, WriteBuffer & ostr) const override
|
||||
|
@ -14,10 +14,13 @@ public:
|
||||
DataTypeNullable(DataTypePtr nested_data_type_);
|
||||
std::string getName() const override { return "Nullable(" + nested_data_type->getName() + ")"; }
|
||||
bool isNullable() const override { return true; }
|
||||
bool isNumeric() const override { return nested_data_type->isNumeric(); }
|
||||
|
||||
bool isNumeric() const override { return nested_data_type->isNumeric(); } /// TODO Absolutely wrong.
|
||||
bool isNumericNotNullable() const override { return false; }
|
||||
bool behavesAsNumber() const override { return nested_data_type->behavesAsNumber(); }
|
||||
bool behavesAsNumber() const override { return nested_data_type->behavesAsNumber(); } /// TODO Absolutely wrong.
|
||||
|
||||
DataTypePtr clone() const override { return std::make_shared<DataTypeNullable>(nested_data_type->clone()); }
|
||||
|
||||
void serializeBinary(const IColumn & column, WriteBuffer & ostr, size_t offset = 0, size_t limit = 0) const override;
|
||||
void deserializeBinary(IColumn & column, ReadBuffer & istr, size_t limit, double avg_value_size_hint) const override;
|
||||
void serializeBinary(const Field & field, WriteBuffer & ostr) const override { nested_data_type->serializeBinary(field, ostr); }
|
||||
@ -35,10 +38,14 @@ public:
|
||||
void deserializeTextJSON(IColumn & column, ReadBuffer & istr) const override;
|
||||
void serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr) const override;
|
||||
void serializeTextXML(const IColumn & column, size_t row_num, WriteBuffer & ostr) const override;
|
||||
|
||||
ColumnPtr createColumn() const override;
|
||||
ColumnPtr createConstColumn(size_t size, const Field & field) const override;
|
||||
Field getDefault() const override { return nested_data_type->getDefault(); }
|
||||
size_t getSizeOfField() const override { return nested_data_type->getSizeOfField(); }
|
||||
|
||||
Field getDefault() const override { return Null(); }
|
||||
|
||||
size_t getSizeOfField() const override { return nested_data_type->getSizeOfField(); } /// TODO Absolutely wrong.
|
||||
|
||||
DataTypePtr & getNestedType() { return nested_data_type; }
|
||||
const DataTypePtr & getNestedType() const { return nested_data_type; }
|
||||
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
|
||||
Field getDefault() const override
|
||||
{
|
||||
return String("");
|
||||
return String();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace NullSymbol
|
||||
|
||||
struct Plain
|
||||
{
|
||||
static constexpr auto name = "\\N";
|
||||
static constexpr auto name = "NULL";
|
||||
};
|
||||
|
||||
struct Escaped
|
||||
|
Loading…
Reference in New Issue
Block a user