From dd90fbe13bd0f6cf43e09dc52c314f465b0c5e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Tue, 19 Nov 2024 20:04:52 +0100 Subject: [PATCH] Fix clang tidy after moving implementation to cpp --- src/Columns/ColumnFunction.cpp | 2 +- .../getDictionaryConfigurationFromAST.cpp | 2 +- src/Functions/FunctionBinaryArithmetic.h | 10 ++-- src/Functions/FunctionUnaryArithmetic.h | 2 +- src/Functions/FunctionsComparison.h | 14 +++--- src/Functions/FunctionsConversion.cpp | 8 ++- src/Functions/FunctionsExternalDictionaries.h | 2 +- src/Functions/FunctionsOpDate.cpp | 2 +- src/Functions/IFunction.h | 2 +- src/Functions/Kusto/KqlArraySort.cpp | 16 +++--- src/Functions/Kusto/KqlFunctionBase.h | 2 +- src/Functions/array/arrayIntersect.cpp | 2 +- src/Functions/array/arrayJaccardIndex.cpp | 2 +- src/Functions/caseWithExpression.cpp | 6 +-- src/Functions/coalesce.cpp | 6 +-- src/Functions/date_trunc.cpp | 4 +- src/Functions/ifNotFinite.cpp | 4 +- src/Functions/ifNull.cpp | 6 +-- src/Functions/map.cpp | 6 +-- src/Functions/monthName.cpp | 2 +- src/Functions/nullIf.cpp | 4 +- src/Functions/printf.cpp | 2 +- src/Functions/toBool.cpp | 2 +- src/Functions/transform.cpp | 2 +- src/Functions/tupleHammingDistance.cpp | 4 +- src/Functions/vectorFunctions.cpp | 50 +++++++++---------- src/Interpreters/ArrayJoinAction.cpp | 6 +-- src/Interpreters/ExpressionJIT.cpp | 2 +- src/Interpreters/castColumn.cpp | 4 +- src/Processors/Transforms/WindowTransform.cpp | 2 +- src/Storages/MergeTree/KeyCondition.cpp | 6 +-- 31 files changed, 91 insertions(+), 93 deletions(-) diff --git a/src/Columns/ColumnFunction.cpp b/src/Columns/ColumnFunction.cpp index cc80d04444e..5e41e95fdc5 100644 --- a/src/Columns/ColumnFunction.cpp +++ b/src/Columns/ColumnFunction.cpp @@ -347,7 +347,7 @@ ColumnWithTypeAndName ColumnFunction::reduce() const if (is_function_compiled) ProfileEvents::increment(ProfileEvents::CompiledFunctionExecute); - res.column = function->execute(columns, res.type, elements_size); + res.column = function->execute(columns, res.type, elements_size, /* dry_run = */ false); if (res.column->getDataType() != res.type->getColumnType()) throw Exception( ErrorCodes::LOGICAL_ERROR, diff --git a/src/Dictionaries/getDictionaryConfigurationFromAST.cpp b/src/Dictionaries/getDictionaryConfigurationFromAST.cpp index 4ec2e1f5260..241f2b51705 100644 --- a/src/Dictionaries/getDictionaryConfigurationFromAST.cpp +++ b/src/Dictionaries/getDictionaryConfigurationFromAST.cpp @@ -493,7 +493,7 @@ void buildConfigurationFromFunctionWithKeyValueArguments( /// We assume that function will not take arguments and will return constant value like tcpPort or hostName /// Such functions will return column with size equal to input_rows_count. size_t input_rows_count = 1; - auto result = function->execute({}, function->getResultType(), input_rows_count); + auto result = function->execute({}, function->getResultType(), input_rows_count, /* dry_run = */ false); Field value; result->get(0, value); diff --git a/src/Functions/FunctionBinaryArithmetic.h b/src/Functions/FunctionBinaryArithmetic.h index d666136a15c..64a0d19a6b9 100644 --- a/src/Functions/FunctionBinaryArithmetic.h +++ b/src/Functions/FunctionBinaryArithmetic.h @@ -1191,7 +1191,7 @@ class FunctionBinaryArithmetic : public IFunction new_arguments[1].type = std::make_shared>(); auto function = function_builder->build(new_arguments); - return function->execute(new_arguments, result_type, input_rows_count); + return function->execute(new_arguments, result_type, input_rows_count, /* dry_run = */ false); } ColumnPtr executeDateTimeTupleOfIntervalsPlusMinus(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, @@ -1205,7 +1205,7 @@ class FunctionBinaryArithmetic : public IFunction auto function = function_builder->build(new_arguments); - return function->execute(new_arguments, result_type, input_rows_count); + return function->execute(new_arguments, result_type, input_rows_count, /* dry_run = */ false); } ColumnPtr executeIntervalTupleOfIntervalsPlusMinus(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, @@ -1213,7 +1213,7 @@ class FunctionBinaryArithmetic : public IFunction { auto function = function_builder->build(arguments); - return function->execute(arguments, result_type, input_rows_count); + return function->execute(arguments, result_type, input_rows_count, /* dry_run = */ false); } ColumnPtr executeArraysImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count) const @@ -1348,7 +1348,7 @@ class FunctionBinaryArithmetic : public IFunction auto function = function_builder->build(new_arguments); - return function->execute(new_arguments, result_type, input_rows_count); + return function->execute(new_arguments, result_type, input_rows_count, /* dry_run = */ false); } template @@ -2250,7 +2250,7 @@ ColumnPtr executeStringInteger(const ColumnsWithTypeAndName & arguments, const A /// Special case when the function is plus, minus or multiply, both arguments are tuples. if (auto function_builder = getFunctionForTupleArithmetic(arguments[0].type, arguments[1].type, context)) { - return function_builder->build(arguments)->execute(arguments, result_type, input_rows_count); + return function_builder->build(arguments)->execute(arguments, result_type, input_rows_count, /* dry_run = */ false); } /// Special case when the function is multiply or divide, one of arguments is Tuple and another is Number. diff --git a/src/Functions/FunctionUnaryArithmetic.h b/src/Functions/FunctionUnaryArithmetic.h index 259dc1c42ba..cf79bb06430 100644 --- a/src/Functions/FunctionUnaryArithmetic.h +++ b/src/Functions/FunctionUnaryArithmetic.h @@ -339,7 +339,7 @@ public: /// Special case when the function is negate, argument is tuple. if (auto function_builder = getFunctionForTupleArithmetic(arguments[0].type, context)) { - return function_builder->build(arguments)->execute(arguments, result_type, input_rows_count); + return function_builder->build(arguments)->execute(arguments, result_type, input_rows_count, /* dry_run = */ false); } ColumnPtr result_column; diff --git a/src/Functions/FunctionsComparison.h b/src/Functions/FunctionsComparison.h index a70ffe98cc2..fbaf7a9c1f3 100644 --- a/src/Functions/FunctionsComparison.h +++ b/src/Functions/FunctionsComparison.h @@ -990,7 +990,7 @@ private: convolution_columns[i].type = impl->getResultType(); /// Comparison of the elements. - convolution_columns[i].column = impl->execute(tmp_columns, impl->getResultType(), input_rows_count); + convolution_columns[i].column = impl->execute(tmp_columns, impl->getResultType(), input_rows_count, /* dry_run = */ false); } if (tuple_size == 1) @@ -1001,7 +1001,7 @@ private: /// Logical convolution. auto impl = func_convolution->build(convolution_columns); - return impl->execute(convolution_columns, impl->getResultType(), input_rows_count); + return impl->execute(convolution_columns, impl->getResultType(), input_rows_count, /* dry_run = */ false); } ColumnPtr executeTupleLessGreaterImpl( @@ -1033,18 +1033,18 @@ private: { auto impl_head = func_compare_head->build(tmp_columns); less_columns[i].type = impl_head->getResultType(); - less_columns[i].column = impl_head->execute(tmp_columns, less_columns[i].type, input_rows_count); + less_columns[i].column = impl_head->execute(tmp_columns, less_columns[i].type, input_rows_count, /* dry_run = */ false); auto impl_equals = func_equals->build(tmp_columns); equal_columns[i].type = impl_equals->getResultType(); - equal_columns[i].column = impl_equals->execute(tmp_columns, equal_columns[i].type, input_rows_count); + equal_columns[i].column = impl_equals->execute(tmp_columns, equal_columns[i].type, input_rows_count, /* dry_run = */ false); } else { auto impl_tail = func_compare_tail->build(tmp_columns); less_columns[i].type = impl_tail->getResultType(); - less_columns[i].column = impl_tail->execute(tmp_columns, less_columns[i].type, input_rows_count); + less_columns[i].column = impl_tail->execute(tmp_columns, less_columns[i].type, input_rows_count, /* dry_run = */ false); } } @@ -1063,13 +1063,13 @@ private: tmp_columns[1] = equal_columns[i]; auto func_and_adaptor = func_and->build(tmp_columns); - tmp_columns[0].column = func_and_adaptor->execute(tmp_columns, func_and_adaptor->getResultType(), input_rows_count); + tmp_columns[0].column = func_and_adaptor->execute(tmp_columns, func_and_adaptor->getResultType(), input_rows_count, /* dry_run = */ false); tmp_columns[0].type = func_and_adaptor->getResultType(); tmp_columns[1] = less_columns[i]; auto func_or_adaptor = func_or->build(tmp_columns); - tmp_columns[0].column = func_or_adaptor->execute(tmp_columns, func_or_adaptor->getResultType(), input_rows_count); + tmp_columns[0].column = func_or_adaptor->execute(tmp_columns, func_or_adaptor->getResultType(), input_rows_count, /* dry_run = */ false); tmp_columns[tmp_columns.size() - 1].type = func_or_adaptor->getResultType(); } diff --git a/src/Functions/FunctionsConversion.cpp b/src/Functions/FunctionsConversion.cpp index d581ae510e8..ead4b6065ac 100644 --- a/src/Functions/FunctionsConversion.cpp +++ b/src/Functions/FunctionsConversion.cpp @@ -3243,11 +3243,9 @@ private: { auto function_adaptor = std::make_unique(function)->build({ColumnWithTypeAndName{nullptr, from_type, ""}}); - return [function_adaptor] - (ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, const ColumnNullable *, size_t input_rows_count) - { - return function_adaptor->execute(arguments, result_type, input_rows_count); - }; + return [function_adaptor]( + ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, const ColumnNullable *, size_t input_rows_count) + { return function_adaptor->execute(arguments, result_type, input_rows_count, /* dry_run = */ false); }; } static WrapperType createToNullableColumnWrapper() diff --git a/src/Functions/FunctionsExternalDictionaries.h b/src/Functions/FunctionsExternalDictionaries.h index 4c7e1534ba5..b0f54b74091 100644 --- a/src/Functions/FunctionsExternalDictionaries.h +++ b/src/Functions/FunctionsExternalDictionaries.h @@ -644,7 +644,7 @@ private: }; auto rows = mask_column->size(); - result_column = if_func->build(if_args)->execute(if_args, result_type, rows); + result_column = if_func->build(if_args)->execute(if_args, result_type, rows, /* dry_run = */ false); } diff --git a/src/Functions/FunctionsOpDate.cpp b/src/Functions/FunctionsOpDate.cpp index c4b154736e0..d8a3aabd9d0 100644 --- a/src/Functions/FunctionsOpDate.cpp +++ b/src/Functions/FunctionsOpDate.cpp @@ -73,7 +73,7 @@ public: auto op_build = op->build(arguments); auto res_type = op_build->getResultType(); - return op_build->execute(arguments, res_type, input_rows_count); + return op_build->execute(arguments, res_type, input_rows_count, /* dry_run = */ false); } private: diff --git a/src/Functions/IFunction.h b/src/Functions/IFunction.h index 7c5f47cab06..0e3db156e53 100644 --- a/src/Functions/IFunction.h +++ b/src/Functions/IFunction.h @@ -136,7 +136,7 @@ public: const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count, - bool dry_run = false) const; + bool dry_run) const; /// Get the main function name. virtual String getName() const = 0; diff --git a/src/Functions/Kusto/KqlArraySort.cpp b/src/Functions/Kusto/KqlArraySort.cpp index fb3e6259ee4..c6f0048f7df 100644 --- a/src/Functions/Kusto/KqlArraySort.cpp +++ b/src/Functions/Kusto/KqlArraySort.cpp @@ -117,11 +117,11 @@ public: } auto zipped - = FunctionFactory::instance().get("arrayZip", context)->build(new_args)->execute(new_args, result_type, input_rows_count); + = FunctionFactory::instance().get("arrayZip", context)->build(new_args)->execute(new_args, result_type, input_rows_count, /* dry_run = */ false); ColumnsWithTypeAndName sort_arg({{zipped, std::make_shared(result_type), "zipped"}}); auto sorted_tuple - = FunctionFactory::instance().get(sort_function, context)->build(sort_arg)->execute(sort_arg, result_type, input_rows_count); + = FunctionFactory::instance().get(sort_function, context)->build(sort_arg)->execute(sort_arg, result_type, input_rows_count, /* dry_run = */ false); auto null_type = std::make_shared(std::make_shared()); @@ -140,7 +140,7 @@ public: {null_type->createColumnConstWithDefaultValue(input_rows_count), null_type, "NULL"}, }); - tuple_columns[i] = fun_array->build(null_array_arg)->execute(null_array_arg, arg_type, input_rows_count); + tuple_columns[i] = fun_array->build(null_array_arg)->execute(null_array_arg, arg_type, input_rows_count, /* dry_run = */ false); tuple_columns[i] = tuple_columns[i]->convertToFullColumnIfConst(); } else @@ -151,7 +151,7 @@ public: auto tuple_coulmn = FunctionFactory::instance() .get("tupleElement", context) ->build(untuple_args) - ->execute(untuple_args, result_type, input_rows_count); + ->execute(untuple_args, result_type, input_rows_count, /* dry_run = */ false); auto out_tmp = ColumnArray::create(nested_types[i]->createColumn()); @@ -190,7 +190,7 @@ public: slice_index.column = FunctionFactory::instance() .get("indexOf", context) ->build(indexof_args) - ->execute(indexof_args, result_type, input_rows_count); + ->execute(indexof_args, result_type, input_rows_count, /* dry_run = */ false); auto null_index_in_array = slice_index.column->get64(0); if (null_index_in_array > 0) @@ -218,15 +218,15 @@ public: ColumnsWithTypeAndName slice_args_right( {{ColumnWithTypeAndName(tuple_columns[i], arg_type, "array")}, slice_index}); ColumnWithTypeAndName arr_left{ - fun_slice->build(slice_args_left)->execute(slice_args_left, arg_type, input_rows_count), arg_type, ""}; + fun_slice->build(slice_args_left)->execute(slice_args_left, arg_type, input_rows_count, /* dry_run = */ false), arg_type, ""}; ColumnWithTypeAndName arr_right{ - fun_slice->build(slice_args_right)->execute(slice_args_right, arg_type, input_rows_count), arg_type, ""}; + fun_slice->build(slice_args_right)->execute(slice_args_right, arg_type, input_rows_count, /* dry_run = */ false), arg_type, ""}; ColumnsWithTypeAndName arr_cancat({arr_right, arr_left}); auto out_tmp = FunctionFactory::instance() .get("arrayConcat", context) ->build(arr_cancat) - ->execute(arr_cancat, arg_type, input_rows_count); + ->execute(arr_cancat, arg_type, input_rows_count, /* dry_run = */ false); adjusted_columns[i] = std::move(out_tmp); } } diff --git a/src/Functions/Kusto/KqlFunctionBase.h b/src/Functions/Kusto/KqlFunctionBase.h index efdf8982f4b..9b636ac2cd7 100644 --- a/src/Functions/Kusto/KqlFunctionBase.h +++ b/src/Functions/Kusto/KqlFunctionBase.h @@ -23,7 +23,7 @@ public: {DataTypeUInt8().createColumnConst(1, toField(UInt8(1))), std::make_shared(), ""}, {DataTypeUInt8().createColumnConst(1, toField(UInt8(2))), std::make_shared(), ""} }); - auto if_res = FunctionFactory::instance().get("if", context)->build(if_columns)->execute(if_columns, std::make_shared(), input_rows_count); + auto if_res = FunctionFactory::instance().get("if", context)->build(if_columns)->execute(if_columns, std::make_shared(), input_rows_count, /* dry_run = */ false); auto result = if_res->getUInt(0); return (result == 1); } diff --git a/src/Functions/array/arrayIntersect.cpp b/src/Functions/array/arrayIntersect.cpp index 64bf75bfd50..deccca4fb5e 100644 --- a/src/Functions/array/arrayIntersect.cpp +++ b/src/Functions/array/arrayIntersect.cpp @@ -339,7 +339,7 @@ static ColumnPtr callFunctionNotEquals(ColumnWithTypeAndName first, ColumnWithTy { ColumnsWithTypeAndName args{first, second}; auto eq_func = FunctionFactory::instance().get("notEquals", context)->build(args); - return eq_func->execute(args, eq_func->getResultType(), args.front().column->size()); + return eq_func->execute(args, eq_func->getResultType(), args.front().column->size(), /* dry_run = */ false); } template diff --git a/src/Functions/array/arrayJaccardIndex.cpp b/src/Functions/array/arrayJaccardIndex.cpp index 56a8c66fc8d..4c023e88a2d 100644 --- a/src/Functions/array/arrayJaccardIndex.cpp +++ b/src/Functions/array/arrayJaccardIndex.cpp @@ -113,7 +113,7 @@ public: ColumnWithTypeAndName intersect_column; intersect_column.type = intersect_array->getResultType(); - intersect_column.column = intersect_array->execute(arguments, intersect_column.type, input_rows_count); + intersect_column.column = intersect_array->execute(arguments, intersect_column.type, input_rows_count, /* dry_run = */ false); const auto * intersect_column_type = checkAndGetDataType(intersect_column.type.get()); if (!intersect_column_type) diff --git a/src/Functions/caseWithExpression.cpp b/src/Functions/caseWithExpression.cpp index f0a620489ef..257fd4c4528 100644 --- a/src/Functions/caseWithExpression.cpp +++ b/src/Functions/caseWithExpression.cpp @@ -93,12 +93,12 @@ public: auto fun_array = FunctionFactory::instance().get("array", context); - src_array_col.column = fun_array->build(src_array_elems)->execute(src_array_elems, src_array_type, input_rows_count); - dst_array_col.column = fun_array->build(dst_array_elems)->execute(dst_array_elems, dst_array_type, input_rows_count); + src_array_col.column = fun_array->build(src_array_elems)->execute(src_array_elems, src_array_type, input_rows_count, /* dry_run = */ false); + dst_array_col.column = fun_array->build(dst_array_elems)->execute(dst_array_elems, dst_array_type, input_rows_count, /* dry_run = */ false); /// Execute transform. ColumnsWithTypeAndName transform_args{args.front(), src_array_col, dst_array_col, args.back()}; - return FunctionFactory::instance().get("transform", context)->build(transform_args)->execute(transform_args, result_type, input_rows_count); + return FunctionFactory::instance().get("transform", context)->build(transform_args)->execute(transform_args, result_type, input_rows_count, /* dry_run = */ false); } private: diff --git a/src/Functions/coalesce.cpp b/src/Functions/coalesce.cpp index 19da6a85b38..2a8cad386d4 100644 --- a/src/Functions/coalesce.cpp +++ b/src/Functions/coalesce.cpp @@ -133,11 +133,11 @@ public: { tmp_args[0] = filtered_args[i]; auto & cond = multi_if_args.emplace_back(ColumnWithTypeAndName{nullptr, std::make_shared(), ""}); - cond.column = is_not_null->build(tmp_args)->execute(tmp_args, cond.type, input_rows_count); + cond.column = is_not_null->build(tmp_args)->execute(tmp_args, cond.type, input_rows_count, /* dry_run = */ false); tmp_args[0] = filtered_args[i]; auto & val = multi_if_args.emplace_back(ColumnWithTypeAndName{nullptr, removeNullable(filtered_args[i].type), ""}); - val.column = assume_not_null->build(tmp_args)->execute(tmp_args, val.type, input_rows_count); + val.column = assume_not_null->build(tmp_args)->execute(tmp_args, val.type, input_rows_count, /* dry_run = */ false); } } @@ -152,7 +152,7 @@ public: /// use function "if" instead, because it's implemented more efficient. /// TODO: make "multiIf" the same efficient. FunctionOverloadResolverPtr if_or_multi_if = multi_if_args.size() == 3 ? if_function : multi_if_function; - ColumnPtr res = if_or_multi_if->build(multi_if_args)->execute(multi_if_args, result_type, input_rows_count); + ColumnPtr res = if_or_multi_if->build(multi_if_args)->execute(multi_if_args, result_type, input_rows_count, /* dry_run = */ false); /// if last argument is not nullable, result should be also not nullable if (!multi_if_args.back().column->isNullable() && res->isNullable()) diff --git a/src/Functions/date_trunc.cpp b/src/Functions/date_trunc.cpp index 020a2da5004..9c46a65313b 100644 --- a/src/Functions/date_trunc.cpp +++ b/src/Functions/date_trunc.cpp @@ -151,10 +151,10 @@ public: auto to_start_of_interval = FunctionFactory::instance().get("toStartOfInterval", context); if (arguments.size() == 2) - return to_start_of_interval->build(temp_columns)->execute(temp_columns, result_type, input_rows_count); + return to_start_of_interval->build(temp_columns)->execute(temp_columns, result_type, input_rows_count, /* dry_run = */ false); temp_columns[2] = arguments[2]; - return to_start_of_interval->build(temp_columns)->execute(temp_columns, result_type, input_rows_count); + return to_start_of_interval->build(temp_columns)->execute(temp_columns, result_type, input_rows_count, /* dry_run = */ false); } bool hasInformationAboutMonotonicity() const override diff --git a/src/Functions/ifNotFinite.cpp b/src/Functions/ifNotFinite.cpp index d7af10eec44..369d39b3bd2 100644 --- a/src/Functions/ifNotFinite.cpp +++ b/src/Functions/ifNotFinite.cpp @@ -45,7 +45,7 @@ public: { ColumnsWithTypeAndName is_finite_columns{arguments[0]}; auto is_finite = FunctionFactory::instance().get("isFinite", context)->build(is_finite_columns); - auto res = is_finite->execute(is_finite_columns, is_finite->getResultType(), input_rows_count); + auto res = is_finite->execute(is_finite_columns, is_finite->getResultType(), input_rows_count, /* dry_run = */ false); ColumnsWithTypeAndName if_columns { @@ -55,7 +55,7 @@ public: }; auto func_if = FunctionFactory::instance().get("if", context)->build(if_columns); - return func_if->execute(if_columns, result_type, input_rows_count); + return func_if->execute(if_columns, result_type, input_rows_count, /* dry_run = */ false); } private: diff --git a/src/Functions/ifNull.cpp b/src/Functions/ifNull.cpp index 358a52c8394..f1186a9abdc 100644 --- a/src/Functions/ifNull.cpp +++ b/src/Functions/ifNull.cpp @@ -66,11 +66,11 @@ public: auto is_not_null = FunctionFactory::instance().get("isNotNull", context)->build(columns); auto is_not_null_type = std::make_shared(); - auto is_not_null_res = is_not_null->execute(columns, is_not_null_type, input_rows_count); + auto is_not_null_res = is_not_null->execute(columns, is_not_null_type, input_rows_count, /* dry_run = */ false); auto assume_not_null = FunctionFactory::instance().get("assumeNotNull", context)->build(columns); auto assume_not_null_type = removeNullable(arguments[0].type); - auto assume_nut_null_res = assume_not_null->execute(columns, assume_not_null_type, input_rows_count); + auto assume_nut_null_res = assume_not_null->execute(columns, assume_not_null_type, input_rows_count, /* dry_run = */ false); ColumnsWithTypeAndName if_columns { @@ -80,7 +80,7 @@ public: }; auto func_if = FunctionFactory::instance().get("if", context)->build(if_columns); - return func_if->execute(if_columns, result_type, input_rows_count); + return func_if->execute(if_columns, result_type, input_rows_count, /* dry_run = */ false); } private: diff --git a/src/Functions/map.cpp b/src/Functions/map.cpp index 893d0c51713..a20b7370893 100644 --- a/src/Functions/map.cpp +++ b/src/Functions/map.cpp @@ -133,13 +133,13 @@ public: const DataTypePtr & value_array_type = std::make_shared(value_type); /// key_array = array(args[0], args[2]...) - ColumnPtr key_array = function_array->build(key_args)->execute(key_args, key_array_type, input_rows_count); + ColumnPtr key_array = function_array->build(key_args)->execute(key_args, key_array_type, input_rows_count, /* dry_run = */ false); /// value_array = array(args[1], args[3]...) - ColumnPtr value_array = function_array->build(value_args)->execute(value_args, value_array_type, input_rows_count); + ColumnPtr value_array = function_array->build(value_args)->execute(value_args, value_array_type, input_rows_count, /* dry_run = */ false); /// result = mapFromArrays(key_array, value_array) ColumnsWithTypeAndName map_args{{key_array, key_array_type, ""}, {value_array, value_array_type, ""}}; - return function_map_from_arrays->build(map_args)->execute(map_args, result_type, input_rows_count); + return function_map_from_arrays->build(map_args)->execute(map_args, result_type, input_rows_count, /* dry_run = */ false); } private: diff --git a/src/Functions/monthName.cpp b/src/Functions/monthName.cpp index 5bd9cd934de..3405756db68 100644 --- a/src/Functions/monthName.cpp +++ b/src/Functions/monthName.cpp @@ -70,7 +70,7 @@ public: }; auto date_name_func = function_resolver->build(temporary_columns); - return date_name_func->execute(temporary_columns, result_type, input_rows_count); + return date_name_func->execute(temporary_columns, result_type, input_rows_count, /* dry_run = */ false); } private: diff --git a/src/Functions/nullIf.cpp b/src/Functions/nullIf.cpp index 550287885a1..6c0a06029a6 100644 --- a/src/Functions/nullIf.cpp +++ b/src/Functions/nullIf.cpp @@ -49,7 +49,7 @@ public: /// nullIf(col1, col2) == if(col1 = col2, NULL, col1) auto equals_func = FunctionFactory::instance().get("equals", context)->build(arguments); - auto eq_res = equals_func->execute(arguments, equals_func->getResultType(), input_rows_count); + auto eq_res = equals_func->execute(arguments, equals_func->getResultType(), input_rows_count, /* dry_run = */ false); ColumnsWithTypeAndName if_columns { @@ -59,7 +59,7 @@ public: }; auto func_if = FunctionFactory::instance().get("if", context)->build(if_columns); - auto if_res = func_if->execute(if_columns, result_type, input_rows_count); + auto if_res = func_if->execute(if_columns, result_type, input_rows_count, /* dry_run = */ false); return makeNullable(if_res); } diff --git a/src/Functions/printf.cpp b/src/Functions/printf.cpp index fd76955159c..496fe96346a 100644 --- a/src/Functions/printf.cpp +++ b/src/Functions/printf.cpp @@ -242,7 +242,7 @@ public: } } - auto res = function_concat->build(concat_args)->execute(concat_args, std::make_shared(), input_rows_count); + auto res = function_concat->build(concat_args)->execute(concat_args, std::make_shared(), input_rows_count, /* dry_run = */ false); return res; } diff --git a/src/Functions/toBool.cpp b/src/Functions/toBool.cpp index ac595d313e3..32dd759d50c 100644 --- a/src/Functions/toBool.cpp +++ b/src/Functions/toBool.cpp @@ -55,7 +55,7 @@ namespace }; auto func_cast = createInternalCast(arguments[0], result_type, CastType::nonAccurate, {}); - return func_cast->execute(cast_args, result_type, arguments[0].column->size()); + return func_cast->execute(cast_args, result_type, arguments[0].column->size(), /* dry_run = */ false); } }; } diff --git a/src/Functions/transform.cpp b/src/Functions/transform.cpp index fad29b73b3d..b6c28bc0b12 100644 --- a/src/Functions/transform.cpp +++ b/src/Functions/transform.cpp @@ -214,7 +214,7 @@ namespace auto impl = std::make_shared(std::make_shared())->build(args); - return impl->execute(args, result_type, input_rows_count); + return impl->execute(args, result_type, input_rows_count, /* dry_run = */ false); } void executeAnything(const IColumn * in, IColumn & column_result, const ColumnPtr default_non_const, const IColumn & in_casted, size_t input_rows_count) const diff --git a/src/Functions/tupleHammingDistance.cpp b/src/Functions/tupleHammingDistance.cpp index ffdf8c93f15..e45e73dfebc 100644 --- a/src/Functions/tupleHammingDistance.cpp +++ b/src/Functions/tupleHammingDistance.cpp @@ -119,7 +119,7 @@ public: ColumnWithTypeAndName column; column.type = elem_compare->getResultType(); - column.column = elem_compare->execute({left, right}, column.type, input_rows_count); + column.column = elem_compare->execute({left, right}, column.type, input_rows_count, /* dry_run = */ false); if (i == 0) { @@ -129,7 +129,7 @@ public: { auto plus_elem = plus->build({res, column}); auto res_type = plus_elem->getResultType(); - res.column = plus_elem->execute({res, column}, res_type, input_rows_count); + res.column = plus_elem->execute({res, column}, res_type, input_rows_count, /* dry_run = */ false); res.type = res_type; } } diff --git a/src/Functions/vectorFunctions.cpp b/src/Functions/vectorFunctions.cpp index 5e23493c86d..7b309313abe 100644 --- a/src/Functions/vectorFunctions.cpp +++ b/src/Functions/vectorFunctions.cpp @@ -136,7 +136,7 @@ public: ColumnWithTypeAndName left{left_elements[i], left_types[i], {}}; ColumnWithTypeAndName right{right_elements[i], right_types[i], {}}; auto elem_func = func->build(ColumnsWithTypeAndName{left, right}); - columns[i] = elem_func->execute({left, right}, elem_func->getResultType(), input_rows_count) + columns[i] = elem_func->execute({left, right}, elem_func->getResultType(), input_rows_count, /* dry_run = */ false) ->convertToFullColumnIfConst(); } @@ -221,7 +221,7 @@ public: { ColumnWithTypeAndName cur{cur_elements[i], cur_types[i], {}}; auto elem_negate = negate->build(ColumnsWithTypeAndName{cur}); - columns[i] = elem_negate->execute({cur}, elem_negate->getResultType(), input_rows_count) + columns[i] = elem_negate->execute({cur}, elem_negate->getResultType(), input_rows_count, /* dry_run = */ false) ->convertToFullColumnIfConst(); } @@ -295,7 +295,7 @@ public: { ColumnWithTypeAndName cur{cur_elements[i], cur_types[i], {}}; auto elem_func = func->build(ColumnsWithTypeAndName{cur, p_column}); - columns[i] = elem_func->execute({cur, p_column}, elem_func->getResultType(), input_rows_count) + columns[i] = elem_func->execute({cur, p_column}, elem_func->getResultType(), input_rows_count, /* dry_run = */ false) ->convertToFullColumnIfConst(); } @@ -413,7 +413,7 @@ public: ColumnWithTypeAndName column; column.type = elem_multiply->getResultType(); - column.column = elem_multiply->execute({left, right}, column.type, input_rows_count); + column.column = elem_multiply->execute({left, right}, column.type, input_rows_count, /* dry_run = */ false); if (i == 0) { @@ -423,7 +423,7 @@ public: { auto plus_elem = plus->build({res, column}); auto res_type = plus_elem->getResultType(); - res.column = plus_elem->execute({res, column}, res_type, input_rows_count); + res.column = plus_elem->execute({res, column}, res_type, input_rows_count, /* dry_run = */ false); res.type = res_type; } } @@ -510,7 +510,7 @@ public: ColumnWithTypeAndName column{cur_elements[i], cur_types[i], {}}; auto elem_plus = plus->build(ColumnsWithTypeAndName{i == 0 ? arguments[0] : res, column}); auto res_type = elem_plus->getResultType(); - res.column = elem_plus->execute({i == 0 ? arguments[0] : res, column}, res_type, input_rows_count); + res.column = elem_plus->execute({i == 0 ? arguments[0] : res, column}, res_type, input_rows_count, /* dry_run = */ false); res.type = res_type; } @@ -665,14 +665,14 @@ public: { auto minus = FunctionFactory::instance().get("minus", context); auto elem_minus = minus->build({left, arguments[1]}); - last_column = elem_minus->execute({left, arguments[1]}, arguments[1].type, input_rows_count) + last_column = elem_minus->execute({left, arguments[1]}, arguments[1].type, input_rows_count, /* dry_run = */ false) ->convertToFullColumnIfConst(); } else { auto plus = FunctionFactory::instance().get("plus", context); auto elem_plus = plus->build({left, arguments[1]}); - last_column = elem_plus->execute({left, arguments[1]}, arguments[1].type, input_rows_count) + last_column = elem_plus->execute({left, arguments[1]}, arguments[1].type, input_rows_count, /* dry_run = */ false) ->convertToFullColumnIfConst(); } } @@ -682,7 +682,7 @@ public: { auto negate = FunctionFactory::instance().get("negate", context); auto elem_negate = negate->build({arguments[1]}); - last_column = elem_negate->execute({arguments[1]}, arguments[1].type, input_rows_count); + last_column = elem_negate->execute({arguments[1]}, arguments[1].type, input_rows_count, /* dry_run = */ false); } else { @@ -783,7 +783,7 @@ public: ColumnWithTypeAndName column; column.type = elem_abs->getResultType(); - column.column = elem_abs->execute({cur}, column.type, input_rows_count); + column.column = elem_abs->execute({cur}, column.type, input_rows_count, /* dry_run = */ false); if (i == 0) { @@ -793,7 +793,7 @@ public: { auto plus_elem = plus->build({res, column}); auto res_type = plus_elem->getResultType(); - res.column = plus_elem->execute({res, column}, res_type, input_rows_count); + res.column = plus_elem->execute({res, column}, res_type, input_rows_count, /* dry_run = */ false); res.type = res_type; } } @@ -885,7 +885,7 @@ public: ColumnWithTypeAndName column; column.type = elem_multiply->getResultType(); - column.column = elem_multiply->execute({cur, cur}, column.type, input_rows_count); + column.column = elem_multiply->execute({cur, cur}, column.type, input_rows_count, /* dry_run = */ false); if (i == 0) { @@ -895,7 +895,7 @@ public: { auto plus_elem = plus->build({res, column}); auto res_type = plus_elem->getResultType(); - res.column = plus_elem->execute({res, column}, res_type, input_rows_count); + res.column = plus_elem->execute({res, column}, res_type, input_rows_count, /* dry_run = */ false); res.type = res_type; } } @@ -949,7 +949,7 @@ public: auto sqrt = FunctionFactory::instance().get("sqrt", context); auto sqrt_elem = sqrt->build({squared_res}); - return sqrt_elem->execute({squared_res}, sqrt_elem->getResultType(), input_rows_count); + return sqrt_elem->execute({squared_res}, sqrt_elem->getResultType(), input_rows_count, /* dry_run = */ false); } }; using FunctionL2Norm = FunctionLNorm; @@ -1036,7 +1036,7 @@ public: ColumnWithTypeAndName column; column.type = elem_abs->getResultType(); - column.column = elem_abs->execute({cur}, column.type, input_rows_count); + column.column = elem_abs->execute({cur}, column.type, input_rows_count, /* dry_run = */ false); if (i == 0) { @@ -1046,7 +1046,7 @@ public: { auto max_elem = max->build({res, column}); auto res_type = max_elem->getResultType(); - res.column = max_elem->execute({res, column}, res_type, input_rows_count); + res.column = max_elem->execute({res, column}, res_type, input_rows_count, /* dry_run = */ false); res.type = res_type; } } @@ -1163,14 +1163,14 @@ public: { ColumnWithTypeAndName cur{cur_elements[i], cur_types[i], {}}; auto elem_abs = abs->build(ColumnsWithTypeAndName{cur}); - cur.column = elem_abs->execute({cur}, elem_abs->getResultType(), input_rows_count); + cur.column = elem_abs->execute({cur}, elem_abs->getResultType(), input_rows_count, /* dry_run = */ false); cur.type = elem_abs->getResultType(); auto elem_pow = pow->build(ColumnsWithTypeAndName{cur, p_column}); ColumnWithTypeAndName column; column.type = elem_pow->getResultType(); - column.column = elem_pow->execute({cur, p_column}, column.type, input_rows_count); + column.column = elem_pow->execute({cur, p_column}, column.type, input_rows_count, /* dry_run = */ false); if (i == 0) { @@ -1180,7 +1180,7 @@ public: { auto plus_elem = plus->build({res, column}); auto res_type = plus_elem->getResultType(); - res.column = plus_elem->execute({res, column}, res_type, input_rows_count); + res.column = plus_elem->execute({res, column}, res_type, input_rows_count, /* dry_run = */ false); res.type = res_type; } } @@ -1188,7 +1188,7 @@ public: ColumnWithTypeAndName inv_p_column{DataTypeFloat64().createColumnConst(input_rows_count, 1 / p), std::make_shared(), {}}; auto pow_elem = pow->build({res, inv_p_column}); - return pow_elem->execute({res, inv_p_column}, pow_elem->getResultType(), input_rows_count); + return pow_elem->execute({res, inv_p_column}, pow_elem->getResultType(), input_rows_count, /* dry_run = */ false); } }; using FunctionLpNorm = FunctionLNorm; @@ -1247,12 +1247,12 @@ public: if constexpr (FuncLabel::name[0] == 'p') { auto func_elem = func->build({minus_res, arguments[2]}); - return func_elem->execute({minus_res, arguments[2]}, func_elem->getResultType(), input_rows_count); + return func_elem->execute({minus_res, arguments[2]}, func_elem->getResultType(), input_rows_count, /* dry_run = */ false); } else { auto func_elem = func->build({minus_res}); - return func_elem->execute({minus_res}, func_elem->getResultType(), input_rows_count); + return func_elem->execute({minus_res}, func_elem->getResultType(), input_rows_count, /* dry_run = */ false); } } }; @@ -1394,16 +1394,16 @@ public: ColumnWithTypeAndName multiply_result; multiply_result.type = multiply_elem->getResultType(); multiply_result.column = multiply_elem->execute({first_norm, second_norm}, - multiply_result.type, input_rows_count); + multiply_result.type, input_rows_count, /* dry_run = */ false); auto divide_elem = divide->build({dot_result, multiply_result}); ColumnWithTypeAndName divide_result; divide_result.type = divide_elem->getResultType(); divide_result.column = divide_elem->execute({dot_result, multiply_result}, - divide_result.type, input_rows_count); + divide_result.type, input_rows_count, /* dry_run = */ false); auto minus_elem = minus->build({one, divide_result}); - return minus_elem->execute({one, divide_result}, minus_elem->getResultType(), input_rows_count); + return minus_elem->execute({one, divide_result}, minus_elem->getResultType(), input_rows_count, /* dry_run = */ false); } }; diff --git a/src/Interpreters/ArrayJoinAction.cpp b/src/Interpreters/ArrayJoinAction.cpp index d1673603c9e..3983dde9db4 100644 --- a/src/Interpreters/ArrayJoinAction.cpp +++ b/src/Interpreters/ArrayJoinAction.cpp @@ -167,7 +167,7 @@ ArrayJoinResultIterator::ArrayJoinResultIterator(const ArrayJoinAction * array_j ColumnWithTypeAndName array_col = convertArrayJoinColumn(src_col); ColumnsWithTypeAndName tmp_block{array_col}; //, {{}, uint64, {}}}; - auto len_col = function_length->build(tmp_block)->execute(tmp_block, uint64, rows); + auto len_col = function_length->build(tmp_block)->execute(tmp_block, uint64, rows, /* dry_run = */ false); updateMaxLength(*max_length, *len_col); } @@ -178,7 +178,7 @@ ArrayJoinResultIterator::ArrayJoinResultIterator(const ArrayJoinAction * array_j ColumnWithTypeAndName array_col = convertArrayJoinColumn(src_col); ColumnsWithTypeAndName tmp_block{array_col, column_of_max_length}; - array_col.column = function_array_resize->build(tmp_block)->execute(tmp_block, array_col.type, rows); + array_col.column = function_array_resize->build(tmp_block)->execute(tmp_block, array_col.type, rows, /* dry_run = */ false); src_col = std::move(array_col); any_array_map_ptr = src_col.column->convertToFullColumnIfConst(); @@ -195,7 +195,7 @@ ArrayJoinResultIterator::ArrayJoinResultIterator(const ArrayJoinAction * array_j const auto & src_col = block.getByName(name); ColumnWithTypeAndName array_col = convertArrayJoinColumn(src_col); ColumnsWithTypeAndName tmp_block{array_col}; - non_empty_array_columns[name] = function_builder->build(tmp_block)->execute(tmp_block, array_col.type, array_col.column->size()); + non_empty_array_columns[name] = function_builder->build(tmp_block)->execute(tmp_block, array_col.type, array_col.column->size(), /* dry_run = */ false); } any_array_map_ptr = non_empty_array_columns.begin()->second->convertToFullColumnIfConst(); diff --git a/src/Interpreters/ExpressionJIT.cpp b/src/Interpreters/ExpressionJIT.cpp index 16275b23053..9baa48515c7 100644 --- a/src/Interpreters/ExpressionJIT.cpp +++ b/src/Interpreters/ExpressionJIT.cpp @@ -266,7 +266,7 @@ public: { const auto & type = function.getArgumentTypes().at(0); ColumnsWithTypeAndName args{{type->createColumnConst(1, value), type, "x" }}; - auto col = function.execute(args, function.getResultType(), 1); + auto col = function.execute(args, function.getResultType(), 1, /* dry_run = */ false); col->get(0, value); } diff --git a/src/Interpreters/castColumn.cpp b/src/Interpreters/castColumn.cpp index 3890c81934a..caa52bb040f 100644 --- a/src/Interpreters/castColumn.cpp +++ b/src/Interpreters/castColumn.cpp @@ -34,8 +34,8 @@ static ColumnPtr castColumn(CastType cast_type, const ColumnWithTypeAndName & ar FunctionBasePtr func_cast = cache ? cache->getOrSet(cast_type, from_name, to_name, std::move(get_cast_func)) : get_cast_func(); if (cast_type == CastType::accurateOrNull) - return func_cast->execute(arguments, makeNullable(type), arg.column->size()); - return func_cast->execute(arguments, type, arg.column->size()); + return func_cast->execute(arguments, makeNullable(type), arg.column->size(), /* dry_run = */ false); + return func_cast->execute(arguments, type, arg.column->size(), /* dry_run = */ false); } ColumnPtr castColumn(const ColumnWithTypeAndName & arg, const DataTypePtr & type, InternalCastFunctionCache * cache) diff --git a/src/Processors/Transforms/WindowTransform.cpp b/src/Processors/Transforms/WindowTransform.cpp index 597a6861eeb..9b9c8fccfef 100644 --- a/src/Processors/Transforms/WindowTransform.cpp +++ b/src/Processors/Transforms/WindowTransform.cpp @@ -2350,7 +2350,7 @@ struct WindowFunctionLagLeadInFrame final : public StatelessWindowFunction } }; - return func_cast->execute(arguments, argument_types[0], columns[idx[2]]->size()); + return func_cast->execute(arguments, argument_types[0], columns[idx[2]]->size(), /* dry_run = */ false); } static DataTypePtr createResultType(const DataTypes & argument_types_, const std::string & name_) diff --git a/src/Storages/MergeTree/KeyCondition.cpp b/src/Storages/MergeTree/KeyCondition.cpp index 2d1e2fb6484..fca4f5143a4 100644 --- a/src/Storages/MergeTree/KeyCondition.cpp +++ b/src/Storages/MergeTree/KeyCondition.cpp @@ -906,7 +906,7 @@ static Field applyFunctionForField( { arg_type->createColumnConst(1, arg_value), arg_type, "x" }, }; - auto col = func->execute(columns, func->getResultType(), 1); + auto col = func->execute(columns, func->getResultType(), 1, /* dry_run = */ false); return (*col)[0]; } @@ -940,7 +940,7 @@ static FieldRef applyFunction(const FunctionBasePtr & func, const DataTypePtr & /// When cache is missed, we calculate the whole column where the field comes from. This will avoid repeated calculation. ColumnsWithTypeAndName args{(*columns)[field.column_idx]}; field.columns->emplace_back(ColumnWithTypeAndName {nullptr, func->getResultType(), result_name}); - (*columns)[result_idx].column = func->execute(args, (*columns)[result_idx].type, columns->front().column->size()); + (*columns)[result_idx].column = func->execute(args, (*columns)[result_idx].type, columns->front().column->size(), /* dry_run = */ false); } return {field.columns, field.row_idx, result_idx}; @@ -1011,7 +1011,7 @@ bool applyFunctionChainToColumn( return false; result_column = castColumnAccurate({result_column, result_type, ""}, argument_type); - result_column = func->execute({{result_column, argument_type, ""}}, func->getResultType(), result_column->size()); + result_column = func->execute({{result_column, argument_type, ""}}, func->getResultType(), result_column->size(), /* dry_run = */ false); result_type = func->getResultType(); // Transforming nullable columns to the nested ones, in case no nulls found