From 2868bbcb217b8562ac84a13f32f93a09aab59b8e Mon Sep 17 00:00:00 2001 From: anton Date: Fri, 15 Feb 2019 10:00:50 +0300 Subject: [PATCH] Basic implementation --- dbms/src/Functions/flatten.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dbms/src/Functions/flatten.cpp b/dbms/src/Functions/flatten.cpp index 38e5d09d020..9c57070e9e8 100644 --- a/dbms/src/Functions/flatten.cpp +++ b/dbms/src/Functions/flatten.cpp @@ -43,13 +43,14 @@ public: IColumn & result_data = result_col->getData(); IColumn::Offsets & result_offsets = result_col->getOffsets(); - result_data.reserve(input_rows_count * 10); - result_offsets.resize(input_rows_count); + // todo + // result_data.reserve(); + // result_offsets.resize(); IColumn::Offset current_offset = 0; for (size_t i = 0; i < input_rows_count; ++i) { - const auto flatten_data = flatten(arg_data, current_offset, arg_offsets[i]); + const auto & flatten_data = flatten(arg_data, current_offset, arg_offsets[i]); result_data.insertRangeFrom(flatten_data, 0, flatten_data.size()); current_offset += flatten_data.size(); result_offsets[i] = current_offset; @@ -66,7 +67,7 @@ private: bool addField(DataTypePtr type_res, const Field & f, Array & arr) const; - const ColumnArray flatten(const IColumn & /*data*/, size_t /*from*/, size_t /*to*/) const + const ColumnArray & flatten(const IColumn & /*data*/, size_t /*from*/, size_t /*to*/) const { // todo }