mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-18 22:40:50 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
42 lines
1.1 KiB
C++
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
|
|
|
|
}
|