#include #include namespace DB { template <> ColumnPtr ColumnConst::convertToFullColumn() const { ColumnString * res = new ColumnString; ColumnString::Offsets_t & offsets = res->getOffsets(); ColumnUInt8::Container_t & vec = dynamic_cast &>(res->getData()).getData(); size_t string_size = data.size() + 1; size_t offset = 0; offsets.resize(s); vec.resize(s * string_size); for (size_t i = 0; i < s; ++i) { memcpy(&vec[offset], data.data(), string_size); offset += string_size; offsets[i] = offset; } return res; } }