1#include <IO/WriteBufferFromString.h>
2#include <IO/Operators.h>
3#include <Columns/IColumn.h>
4#include <Columns/ColumnNullable.h>
5#include <Columns/ColumnConst.h>
6#include <Core/Field.h>
7
8
9namespace DB
10{
11
12String IColumn::dumpStructure() const
13{
14 WriteBufferFromOwnString res;
15 res << getFamilyName() << "(size = " << size();
16
17 ColumnCallback callback = [&](ColumnPtr & subcolumn)
18 {
19 res << ", " << subcolumn->dumpStructure();
20 };
21
22 const_cast<IColumn*>(this)->forEachSubcolumn(callback);
23
24 res << ")";
25 return res.str();
26}
27
28void IColumn::insertFrom(const IColumn & src, size_t n)
29{
30 insert(src[n]);
31}
32
33bool isColumnNullable(const IColumn & column)
34{
35 return checkColumn<ColumnNullable>(column);
36}
37
38bool isColumnConst(const IColumn & column)
39{
40 return checkColumn<ColumnConst>(column);
41}
42
43}
44