From a4dd6602d25a2f445ea419e27691fec2838c25cd Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Mon, 19 Mar 2018 22:09:37 +0300 Subject: [PATCH] fix build --- dbms/src/Functions/FunctionsConditional.h | 14 ++++++++------ dbms/src/Functions/FunctionsConversion.h | 10 +++++----- dbms/src/Functions/FunctionsHigherOrder.h | 4 ++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dbms/src/Functions/FunctionsConditional.h b/dbms/src/Functions/FunctionsConditional.h index 841295f0643..835dd638798 100644 --- a/dbms/src/Functions/FunctionsConditional.h +++ b/dbms/src/Functions/FunctionsConditional.h @@ -540,7 +540,7 @@ private: temporary_block.insert(block.getByPosition(arguments[0])); size_t tuple_size = type1.getElements().size(); - Columns tuple_columns(tuple_size); + MutableColumns tuple_columns(tuple_size); for (size_t i = 0; i < tuple_size; ++i) { @@ -556,12 +556,12 @@ private: temporary_block.erase(i + 3); temporary_block.erase(i + 2); - tuple_columns[i] = temporary_block.getByPosition(i + 1).column; + tuple_columns[i] = temporary_block.getByPosition(i + 1).column->assumeMutable(); } /// temporary_block is: cond, res_0, res_1, res_2... - block.getByPosition(result).column = ColumnTuple::create(tuple_columns); + block.getByPosition(result).column = ColumnTuple::create(std::move(tuple_columns)); return true; } @@ -605,7 +605,8 @@ private: else { block.getByPosition(result).column = ColumnNullable::create( - materializeColumnIfConst(result_column), static_cast(*arg_cond.column).getNullMapColumnPtr()); + materializeColumnIfConst(result_column)->assumeMutable(), + static_cast(*arg_cond.column).getNullMapColumnPtr()->assumeMutable()); return true; } } @@ -626,7 +627,7 @@ private: return column; return ColumnNullable::create( - materializeColumnIfConst(column), ColumnUInt8::create(column->size(), 0)); + materializeColumnIfConst(column)->assumeMutable(), ColumnUInt8::create(column->size(), 0)); } static ColumnPtr getNestedColumn(const ColumnPtr & column) @@ -712,7 +713,8 @@ private: } block.getByPosition(result).column = ColumnNullable::create( - materializeColumnIfConst(result_nested_column), materializeColumnIfConst(result_null_mask)); + materializeColumnIfConst(result_nested_column)->assumeMutable(), + materializeColumnIfConst(result_null_mask)->assumeMutable()); return true; } diff --git a/dbms/src/Functions/FunctionsConversion.h b/dbms/src/Functions/FunctionsConversion.h index 7e1901f5a05..7ce24418e51 100644 --- a/dbms/src/Functions/FunctionsConversion.h +++ b/dbms/src/Functions/FunctionsConversion.h @@ -1336,7 +1336,7 @@ private: nested_function(nested_block, {0}, 1); /// set converted nested column to result - block.getByPosition(result).column = ColumnArray::create(nested_block.getByPosition(1).column, col_array->getOffsetsPtr()); + block.getByPosition(result).column = ColumnArray::create(nested_block.getByPosition(1).column->assumeMutable(), col_array->getOffsetsPtr()); } else throw Exception{"Illegal column " + array_arg.column->getName() + " for function CAST AS Array", ErrorCodes::LOGICAL_ERROR}; @@ -1399,11 +1399,11 @@ private: idx_element_wrapper.second(element_block, { idx_element_wrapper.first }, tuple_size + idx_element_wrapper.first); - Columns converted_columns(tuple_size); + MutableColumns converted_columns(tuple_size); for (size_t i = 0; i < tuple_size; ++i) - converted_columns[i] = element_block.getByPosition(tuple_size + i).column; + converted_columns[i] = element_block.getByPosition(tuple_size + i).column->assumeMutable(); - block.getByPosition(result).column = ColumnTuple::create(converted_columns); + block.getByPosition(result).column = ColumnTuple::create(std::move(converted_columns)); }; } @@ -1587,7 +1587,7 @@ private: } const auto & tmp_res = tmp_block.getByPosition(tmp_res_index); - res.column = ColumnNullable::create(tmp_res.column, null_map); + res.column = ColumnNullable::create(tmp_res.column->assumeMutable(), null_map->assumeMutable()); }; } else if (nullable_conversion.source_is_nullable) diff --git a/dbms/src/Functions/FunctionsHigherOrder.h b/dbms/src/Functions/FunctionsHigherOrder.h index c63dce364b9..ba3e6f124bb 100644 --- a/dbms/src/Functions/FunctionsHigherOrder.h +++ b/dbms/src/Functions/FunctionsHigherOrder.h @@ -50,7 +50,7 @@ struct ArrayMapImpl { return mapped->isColumnConst() ? ColumnArray::create(mapped->convertToFullColumnIfConst(), array.getOffsetsPtr()) - : ColumnArray::create(mapped, array.getOffsetsPtr()); + : ColumnArray::create(mapped->assumeMutable(), array.getOffsetsPtr()); } }; @@ -104,7 +104,7 @@ struct ArrayFilterImpl out_offsets[i] = out_pos; } - return ColumnArray::create(filtered, std::move(column_offsets)); + return ColumnArray::create(filtered->assumeMutable(), std::move(column_offsets)); } };