ClickHouse/dbms/Core/ColumnWithTypeAndName.h
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

42 lines
1.1 KiB
C++

#pragma once
#include <Columns/IColumn.h>
#include <DataTypes/IDataType.h>
namespace DB
{
class WriteBuffer;
/** Column data along with its data type and name.
* Column data could be nullptr - to represent just 'header' of column.
* Name could be either name from a table or some temporary generated name during expression evaluation.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnull-dereference"
struct ColumnWithTypeAndName
{
ColumnPtr column;
DataTypePtr type;
String name;
ColumnWithTypeAndName() {}
ColumnWithTypeAndName(const ColumnPtr & column_, const DataTypePtr & type_, const String & name_)
: column(column_), type(type_), name(name_) {}
/// Uses type->createColumn() to create column
ColumnWithTypeAndName(const DataTypePtr & type_, const String & name_)
: column(type_->createColumn()), type(type_), name(name_) {}
ColumnWithTypeAndName cloneEmpty() const;
bool operator==(const ColumnWithTypeAndName & other) const;
void dumpStructure(WriteBuffer & out) const;
String dumpStructure() const;
};
#pragma GCC diagnostic pop
}