ClickHouse/dbms/include/DB/Core/ColumnWithNameAndType.h
2013-05-03 03:23:41 +00:00

41 lines
765 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <Poco/SharedPtr.h>
#include <DB/Columns/IColumn.h>
#include <DB/DataTypes/IDataType.h>
namespace DB
{
using Poco::SharedPtr;
/** Тип данных для представления столбца вместе с его типом и именем в оперативке.
*/
struct ColumnWithNameAndType
{
ColumnPtr column;
DataTypePtr type;
String name;
ColumnWithNameAndType() {}
ColumnWithNameAndType(const ColumnPtr & column_, const DataTypePtr & type_, const String name_)
: column(column_), type(type_), name(name_) {}
ColumnWithNameAndType cloneEmpty() const
{
ColumnWithNameAndType res;
res.name = name;
res.type = type->clone();
if (column)
res.column = column->cloneEmpty();
return res;
}
};
}