ClickHouse/src/DataTypes/DataTypeString.h

69 lines
3.1 KiB
C++
Raw Normal View History

2012-08-13 20:16:06 +00:00
#pragma once
2010-05-13 16:13:38 +00:00
#include <ostream>
#include <DataTypes/IDataType.h>
2010-05-13 16:13:38 +00:00
namespace DB
{
2015-06-09 18:58:18 +00:00
class DataTypeString final : public IDataType
2010-05-13 16:13:38 +00:00
{
public:
using FieldType = String;
static constexpr bool is_parametric = false;
const char * getFamilyName() const override
{
return "String";
}
TypeIndex getTypeId() const override { return TypeIndex::String; }
void serializeBinary(const Field & field, WriteBuffer & ostr) const override;
void deserializeBinary(Field & field, ReadBuffer & istr) const override;
void serializeBinary(const IColumn & column, size_t row_num, WriteBuffer & ostr) const override;
void deserializeBinary(IColumn & column, ReadBuffer & istr) const override;
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;
2010-05-13 16:13:38 +00:00
void serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override;
2019-05-18 21:07:23 +00:00
void deserializeWholeText(IColumn & column, ReadBuffer & istr, const FormatSettings &) const override;
2010-05-13 16:13:38 +00:00
void serializeTextEscaped(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override;
void deserializeTextEscaped(IColumn & column, ReadBuffer & istr, const FormatSettings &) const override;
2010-05-13 16:13:38 +00:00
void serializeTextQuoted(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override;
void deserializeTextQuoted(IColumn & column, ReadBuffer & istr, const FormatSettings &) const override;
void serializeTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override;
void deserializeTextJSON(IColumn & column, ReadBuffer & istr, const FormatSettings &) const override;
void serializeTextXML(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override;
2010-05-13 16:13:38 +00:00
void serializeTextCSV(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override;
void deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings &) const override;
void serializeProtobuf(const IColumn & column, size_t row_num, ProtobufWriter & protobuf, size_t & value_index) const override;
void deserializeProtobuf(IColumn & column, ProtobufReader & protobuf, bool allow_add_row, bool & row_added) const override;
MutableColumnPtr createColumn() const override;
2012-08-13 20:16:06 +00:00
2019-10-04 17:46:36 +00:00
Field getDefault() const override;
bool equals(const IDataType & rhs) const override;
bool isParametric() const override { return false; }
bool haveSubtypes() const override { return false; }
bool isComparable() const override { return true; }
bool canBeComparedWithCollation() const override { return true; }
bool isValueUnambiguouslyRepresentedInContiguousMemoryRegion() const override { return true; }
bool isCategorial() const override { return true; }
bool canBeInsideNullable() const override { return true; }
bool canBeInsideLowCardinality() const override { return true; }
2010-05-13 16:13:38 +00:00
};
}