This is an automated email from the ASF dual-hosted git repository. zhangstar333 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 3e3948c87fb [env](compile)open compile check in some function agg file (#44549) 3e3948c87fb is described below commit 3e3948c87fb285a5bf36fdf5d70bdebaeffc33ae Author: Mryange <yanxuech...@selectdb.com> AuthorDate: Tue Dec 3 11:33:40 2024 +0800 [env](compile)open compile check in some function agg file (#44549) ### What problem does this PR solve? This is part of the changes because modifying too much at once can easily cause conflicts with other PRs. --- be/src/vec/aggregate_functions/aggregate_function.h | 3 +++ .../aggregate_function_approx_count_distinct.cpp | 1 + .../aggregate_function_approx_count_distinct.h | 6 ++++-- .../aggregate_functions/aggregate_function_avg.cpp | 1 + .../vec/aggregate_functions/aggregate_function_avg.h | 16 ++++++++++++---- .../aggregate_function_avg_weighted.cpp | 1 + .../aggregate_function_avg_weighted.h | 5 ++++- .../aggregate_functions/aggregate_function_binary.h | 3 +++ .../aggregate_functions/aggregate_function_bit.cpp | 1 + .../vec/aggregate_functions/aggregate_function_bit.h | 4 +++- .../aggregate_function_bitmap.cpp | 7 ++++++- .../aggregate_functions/aggregate_function_bitmap.h | 4 +++- .../aggregate_function_bitmap_agg.cpp | 7 ++++++- .../aggregate_function_bitmap_agg.h | 4 +++- .../aggregate_function_collect.cpp | 1 + .../aggregate_functions/aggregate_function_collect.h | 3 +++ .../aggregate_function_combinator.h | 3 +++ .../aggregate_functions/aggregate_function_corr.cpp | 1 + .../aggregate_functions/aggregate_function_count.cpp | 1 + .../aggregate_functions/aggregate_function_count.h | 3 +++ .../aggregate_function_count_by_enum.cpp | 1 + .../aggregate_function_count_by_enum.h | 7 ++++--- .../aggregate_functions/aggregate_function_covar.cpp | 1 + .../aggregate_functions/aggregate_function_covar.h | 9 +++++---- .../aggregate_function_distinct.cpp | 1 + .../aggregate_function_distinct.h | 3 +++ .../aggregate_function_foreach.cpp | 1 + .../aggregate_functions/aggregate_function_foreach.h | 3 +++ .../aggregate_function_group_array_intersect.cpp | 1 + .../aggregate_function_group_array_intersect.h | 3 +++ .../aggregate_function_group_concat.cpp | 1 + .../aggregate_function_group_concat.h | 3 +++ .../aggregate_function_histogram.cpp | 1 + .../aggregate_function_histogram.h | 3 +++ .../aggregate_function_hll_union_agg.cpp | 1 + .../aggregate_function_hll_union_agg.h | 6 ++++-- .../aggregate_function_java_udaf.h | 18 ++++++++++++------ .../aggregate_function_kurtosis.cpp | 1 + .../aggregate_function_linear_histogram.cpp | 1 + .../aggregate_function_linear_histogram.h | 6 +++++- .../aggregate_functions/aggregate_function_map.cpp | 1 + .../vec/aggregate_functions/aggregate_function_map.h | 3 +++ .../aggregate_function_max_by.cpp | 1 + .../aggregate_function_min_by.cpp | 1 + .../aggregate_function_min_max.cpp | 1 + .../aggregate_functions/aggregate_function_min_max.h | 14 +++++++++----- .../aggregate_function_min_max_by.h | 3 +++ .../aggregate_functions/aggregate_function_null.h | 3 +++ .../aggregate_function_orthogonal_bitmap.cpp | 1 + .../aggregate_function_orthogonal_bitmap.h | 6 +++++- .../aggregate_functions/aggregate_function_product.h | 3 +++ .../aggregate_function_quantile_state.cpp | 1 + .../aggregate_function_quantile_state.h | 3 +++ .../aggregate_function_reader.cpp | 1 + .../aggregate_functions/aggregate_function_reader.h | 3 +++ .../aggregate_function_reader_first_last.h | 4 +++- .../aggregate_function_regr_union.cpp | 1 + .../aggregate_function_regr_union.h | 17 ++++++++++------- .../aggregate_function_retention.cpp | 1 + .../aggregate_function_retention.h | 4 +++- .../aggregate_function_sequence_match.cpp | 1 + .../aggregate_function_sequence_match.h | 6 +++++- .../aggregate_function_simple_factory.cpp | 1 + .../aggregate_function_simple_factory.h | 3 +++ .../aggregate_functions/aggregate_function_skew.cpp | 1 + .../aggregate_functions/aggregate_function_sort.cpp | 1 + .../aggregate_functions/aggregate_function_sort.h | 3 +++ .../aggregate_function_state_merge.h | 3 +++ .../aggregate_function_state_union.h | 3 +++ .../aggregate_function_statistic.h | 16 +++++++++++----- .../aggregate_function_stddev.cpp | 1 + .../aggregate_functions/aggregate_function_stddev.h | 20 +++++++++++--------- .../aggregate_functions/aggregate_function_sum.cpp | 1 + .../vec/aggregate_functions/aggregate_function_sum.h | 3 +++ .../aggregate_functions/aggregate_function_topn.cpp | 1 + .../aggregate_functions/aggregate_function_topn.h | 3 +++ .../aggregate_functions/aggregate_function_uniq.cpp | 1 + .../aggregate_functions/aggregate_function_uniq.h | 3 +++ .../aggregate_function_uniq_distribute_key.cpp | 1 + .../aggregate_function_uniq_distribute_key.h | 3 +++ .../aggregate_function_window.cpp | 1 + .../aggregate_functions/aggregate_function_window.h | 7 +++++-- .../aggregate_function_window_funnel.cpp | 1 + .../aggregate_function_window_funnel.h | 10 ++++++++-- be/src/vec/aggregate_functions/factory_helpers.h | 3 +++ be/src/vec/aggregate_functions/helpers.h | 3 +++ be/src/vec/aggregate_functions/moments.h | 4 +++- be/src/vec/common/string_buffer.hpp | 2 +- 88 files changed, 260 insertions(+), 64 deletions(-) diff --git a/be/src/vec/aggregate_functions/aggregate_function.h b/be/src/vec/aggregate_functions/aggregate_function.h index 32fc9d5efce..e0ec2bef62f 100644 --- a/be/src/vec/aggregate_functions/aggregate_function.h +++ b/be/src/vec/aggregate_functions/aggregate_function.h @@ -36,6 +36,7 @@ #include "vec/data_types/data_type_string.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" class Arena; class IColumn; @@ -598,3 +599,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.cpp b/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.cpp index 18662bf66cf..8bf6c32c087 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.cpp @@ -29,6 +29,7 @@ #include "vec/functions/function.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" AggregateFunctionPtr create_aggregate_function_approx_count_distinct( const std::string& name, const DataTypes& argument_types, const bool result_is_nullable, diff --git a/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.h b/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.h index d267499e059..3ef22be9fca 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.h +++ b/be/src/vec/aggregate_functions/aggregate_function_approx_count_distinct.h @@ -38,6 +38,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -64,8 +65,7 @@ struct AggregateFunctionApproxCountDistinctData { void write(BufferWritable& buf) const { std::string result; result.resize(hll_data.max_serialized_size()); - int size = hll_data.serialize((uint8_t*)result.data()); - result.resize(size); + result.resize(hll_data.serialize((uint8_t*)result.data())); write_binary(result, buf); } @@ -136,3 +136,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_avg.cpp b/be/src/vec/aggregate_functions/aggregate_function_avg.cpp index 6a6711f90f9..6109f0b0c60 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_avg.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_avg.cpp @@ -25,6 +25,7 @@ #include "vec/core/field.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T> struct Avg { diff --git a/be/src/vec/aggregate_functions/aggregate_function_avg.h b/be/src/vec/aggregate_functions/aggregate_function_avg.h index 62fbb8078ea..8b24db692ae 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_avg.h +++ b/be/src/vec/aggregate_functions/aggregate_function_avg.h @@ -41,6 +41,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -72,7 +73,8 @@ struct AggregateFunctionAvgData { ResultT result() const { if constexpr (std::is_floating_point_v<ResultT>) { if constexpr (std::numeric_limits<ResultT>::is_iec559) { - return static_cast<ResultT>(sum) / count; /// allow division by zero + return static_cast<ResultT>(sum) / + static_cast<ResultT>(count); /// allow division by zero } } @@ -91,7 +93,7 @@ struct AggregateFunctionAvgData { if constexpr (IsDecimal256<T>) { return static_cast<ResultT>(sum / T(count)); } else { - return static_cast<ResultT>(sum) / count; + return static_cast<ResultT>(sum) / static_cast<ResultT>(count); } } } @@ -124,7 +126,11 @@ public: IsDecimalV2<T>, ColumnDecimal<Decimal128V2>, std::conditional_t<IsDecimalNumber<T>, ColumnDecimal<typename Data::ResultType>, ColumnFloat64>>; + // The result calculated by PercentileApprox is an approximate value, + // so the underlying storage uses float. The following calls will involve + // an implicit cast to float. + using DataType = typename Data::ResultType; /// ctor for native types AggregateFunctionAvg(const DataTypes& argument_types_) : IAggregateFunctionDataHelper<Data, AggregateFunctionAvg<T, Data>>(argument_types_), @@ -148,9 +154,9 @@ public: const auto& column = assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); if constexpr (IsDecimalNumber<T>) { - this->data(place).sum += column.get_data()[row_num].value; + this->data(place).sum += (DataType)column.get_data()[row_num].value; } else { - this->data(place).sum += column.get_data()[row_num]; + this->data(place).sum += (DataType)column.get_data()[row_num]; } ++this->data(place).count; } @@ -282,3 +288,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_avg_weighted.cpp b/be/src/vec/aggregate_functions/aggregate_function_avg_weighted.cpp index fc5df5303fd..70a707b02e9 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_avg_weighted.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_avg_weighted.cpp @@ -21,6 +21,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_avg_weighted(AggregateFunctionSimpleFactory& factory) { factory.register_function_both("avg_weighted", creator_with_type::creator<AggregateFunctionAvgWeight>); diff --git a/be/src/vec/aggregate_functions/aggregate_function_avg_weighted.h b/be/src/vec/aggregate_functions/aggregate_function_avg_weighted.h index b59a3dccf0c..d1a5921b450 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_avg_weighted.h +++ b/be/src/vec/aggregate_functions/aggregate_function_avg_weighted.h @@ -35,6 +35,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -57,7 +58,7 @@ struct AggregateFunctionAvgWeightedData { DecimalV2Value value = binary_cast<Int128, DecimalV2Value>(data_val); data_sum = data_sum + (double(value) * weight_val); } else { - data_sum = data_sum + (data_val * weight_val); + data_sum = data_sum + (double(data_val) * weight_val); } weight_sum = weight_sum + weight_val; } @@ -138,3 +139,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_binary.h b/be/src/vec/aggregate_functions/aggregate_function_binary.h index 9fba9d11a10..fd5fc55d253 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_binary.h +++ b/be/src/vec/aggregate_functions/aggregate_function_binary.h @@ -36,6 +36,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T1, typename T2, template <typename> typename Moments> struct StatFunc { @@ -127,3 +128,5 @@ AggregateFunctionPtr create_with_two_basic_numeric_types(const DataTypePtr& firs } } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_bit.cpp b/be/src/vec/aggregate_functions/aggregate_function_bit.cpp index 97a6c0e92fa..981ced1fbd5 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bit.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_bit.cpp @@ -24,6 +24,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_bit(AggregateFunctionSimpleFactory& factory) { factory.register_function_both( diff --git a/be/src/vec/aggregate_functions/aggregate_function_bit.h b/be/src/vec/aggregate_functions/aggregate_function_bit.h index 1ab01b03cee..d9760fdd300 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bit.h +++ b/be/src/vec/aggregate_functions/aggregate_function_bit.h @@ -30,6 +30,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -142,4 +143,5 @@ public: } }; -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap.cpp b/be/src/vec/aggregate_functions/aggregate_function_bitmap.cpp index e9c86d4b955..47ddf2d81b6 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bitmap.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap.cpp @@ -23,6 +23,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <bool nullable, template <bool, typename> class AggregateFunctionTemplate> AggregateFunctionPtr create_with_int_data_type(const DataTypes& argument_type) { @@ -33,7 +34,11 @@ AggregateFunctionPtr create_with_int_data_type(const DataTypes& argument_type) { return std::make_shared<AggregateFunctionTemplate<nullable, ColumnVector<TYPE>>>( \ argument_type); \ } - FOR_INTEGER_TYPES(DISPATCH) + // Keep consistent with the FE definition; the function does not have an int128 type. + DISPATCH(Int8) + DISPATCH(Int16) + DISPATCH(Int32) + DISPATCH(Int64) #undef DISPATCH LOG(WARNING) << "with unknowed type, failed in create_with_int_data_type bitmap_union_int" << " and type is: " << argument_type[0]->get_name(); diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h index b0619a63e1f..fb17b0a80be 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h +++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h @@ -38,6 +38,7 @@ #include "vec/data_types/data_type_number.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -432,4 +433,5 @@ AggregateFunctionPtr create_aggregate_function_bitmap_union(const std::string& n const DataTypes& argument_types, const bool result_is_nullable); -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.cpp b/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.cpp index 0b95ddfd46f..2a2c86303f3 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.cpp @@ -23,6 +23,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <bool nullable> AggregateFunctionPtr create_with_int_data_type(const DataTypes& argument_types) { @@ -32,7 +33,11 @@ AggregateFunctionPtr create_with_int_data_type(const DataTypes& argument_types) if (which.idx == TypeIndex::TYPE) { \ return std::make_shared<AggregateFunctionBitmapAgg<nullable, TYPE>>(argument_types); \ } - FOR_INTEGER_TYPES(DISPATCH) + // Keep consistent with the FE definition; the function does not have an int128 type. + DISPATCH(Int8) + DISPATCH(Int16) + DISPATCH(Int32) + DISPATCH(Int64) #undef DISPATCH LOG(WARNING) << "with unknown type, failed in create_with_int_data_type bitmap_union_int" << " and type is: " << argument_types[0]->get_name(); diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.h b/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.h index 5747faf1b8e..bff32aa606c 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.h +++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap_agg.h @@ -31,6 +31,7 @@ #include "vec/data_types/data_type_bitmap.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -226,4 +227,5 @@ public: } }; -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_collect.cpp b/be/src/vec/aggregate_functions/aggregate_function_collect.cpp index d726b7c6355..a4853ff9865 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_collect.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_collect.cpp @@ -26,6 +26,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T, typename HasLimit, typename ShowNull> AggregateFunctionPtr do_create_agg_function_collect(bool distinct, const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_collect.h b/be/src/vec/aggregate_functions/aggregate_function_collect.h index da310c6e0cc..2d18a56313f 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_collect.h +++ b/be/src/vec/aggregate_functions/aggregate_function_collect.h @@ -46,6 +46,7 @@ #include "vec/io/var_int.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; } // namespace vectorized @@ -836,3 +837,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_combinator.h b/be/src/vec/aggregate_functions/aggregate_function_combinator.h index 1593d74ed4e..0908ac8d027 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_combinator.h +++ b/be/src/vec/aggregate_functions/aggregate_function_combinator.h @@ -26,6 +26,7 @@ #include "vec/data_types/data_type.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" /** Aggregate function combinator allows to take one aggregate function * and transform it to another aggregate function. @@ -69,3 +70,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_corr.cpp b/be/src/vec/aggregate_functions/aggregate_function_corr.cpp index cdaab6e086f..e0a51ca6629 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_corr.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_corr.cpp @@ -21,6 +21,7 @@ #include "vec/core/types.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T> struct CorrMoment { diff --git a/be/src/vec/aggregate_functions/aggregate_function_count.cpp b/be/src/vec/aggregate_functions/aggregate_function_count.cpp index 5cfe5af4198..72d12cf65fe 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_count.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_count.cpp @@ -26,6 +26,7 @@ #include "vec/aggregate_functions/factory_helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" AggregateFunctionPtr create_aggregate_function_count(const std::string& name, const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_count.h b/be/src/vec/aggregate_functions/aggregate_function_count.h index 7b54d074683..630994a7967 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_count.h +++ b/be/src/vec/aggregate_functions/aggregate_function_count.h @@ -41,6 +41,7 @@ #include "vec/io/var_int.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -321,3 +322,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_count_by_enum.cpp b/be/src/vec/aggregate_functions/aggregate_function_count_by_enum.cpp index 093b31d57db..20235d9e2ef 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_count_by_enum.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_count_by_enum.cpp @@ -26,6 +26,7 @@ #include "vec/core/types.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" AggregateFunctionPtr create_aggregate_function_count_by_enum(const std::string& name, const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_count_by_enum.h b/be/src/vec/aggregate_functions/aggregate_function_count_by_enum.h index 1f5093de682..543ae55f872 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_count_by_enum.h +++ b/be/src/vec/aggregate_functions/aggregate_function_count_by_enum.h @@ -32,6 +32,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" struct CountByEnumData { std::unordered_map<std::string, uint64_t> cbe; @@ -46,8 +47,7 @@ void build_json_from_vec(rapidjson::StringBuffer& buffer, doc.SetArray(); rapidjson::Document::AllocatorType& allocator = doc.GetAllocator(); - int vec_size_number = data_vec.size(); - for (int idx = 0; idx < vec_size_number; ++idx) { + for (size_t idx = 0; idx < data_vec.size(); ++idx) { rapidjson::Value obj(rapidjson::kObjectType); rapidjson::Value obj_cbe(rapidjson::kObjectType); @@ -239,4 +239,5 @@ private: size_t arg_count; }; -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_covar.cpp b/be/src/vec/aggregate_functions/aggregate_function_covar.cpp index 4c5fe132195..d9c091fb601 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_covar.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_covar.cpp @@ -28,6 +28,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <template <typename> class Function, template <typename> class Data> AggregateFunctionPtr create_function_single_value(const String& name, diff --git a/be/src/vec/aggregate_functions/aggregate_function_covar.h b/be/src/vec/aggregate_functions/aggregate_function_covar.h index b01d1ba11c8..56dd443f050 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_covar.h +++ b/be/src/vec/aggregate_functions/aggregate_function_covar.h @@ -75,11 +75,12 @@ struct BaseData { if (count == 1) { return 0.0; } - return sum_xy / count - sum_x * sum_y / (count * count); + return sum_xy / (double)count - sum_x * sum_y / ((double)count * (double)count); } double get_samp_result() const { - return sum_xy / (count - 1) - sum_x * sum_y / (count * (count - 1)); + return sum_xy / double(count - 1) - + sum_x * sum_y / ((double)(count) * ((double)(count - 1))); } void merge(const BaseData& rhs) { @@ -95,10 +96,10 @@ struct BaseData { void add(const IColumn* column_x, const IColumn* column_y, size_t row_num) { const auto& sources_x = assert_cast<const ColumnVector<T>&, TypeCheckOnRelease::DISABLE>(*column_x); - double source_data_x = sources_x.get_data()[row_num]; + double source_data_x = double(sources_x.get_data()[row_num]); const auto& sources_y = assert_cast<const ColumnVector<T>&, TypeCheckOnRelease::DISABLE>(*column_y); - double source_data_y = sources_y.get_data()[row_num]; + double source_data_y = double(sources_y.get_data()[row_num]); sum_x += source_data_x; sum_y += source_data_y; diff --git a/be/src/vec/aggregate_functions/aggregate_function_distinct.cpp b/be/src/vec/aggregate_functions/aggregate_function_distinct.cpp index fce58b38688..566d74dc4d5 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_distinct.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_distinct.cpp @@ -28,6 +28,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T> struct Reducer { diff --git a/be/src/vec/aggregate_functions/aggregate_function_distinct.h b/be/src/vec/aggregate_functions/aggregate_function_distinct.h index 64f60319aac..46450394627 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_distinct.h +++ b/be/src/vec/aggregate_functions/aggregate_function_distinct.h @@ -42,6 +42,7 @@ #include "vec/io/var_int.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -347,3 +348,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_foreach.cpp b/be/src/vec/aggregate_functions/aggregate_function_foreach.cpp index c1cbcc89996..4dba4dd52eb 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_foreach.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_foreach.cpp @@ -32,6 +32,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_combinator_foreach(AggregateFunctionSimpleFactory& factory) { AggregateFunctionCreator creator = diff --git a/be/src/vec/aggregate_functions/aggregate_function_foreach.h b/be/src/vec/aggregate_functions/aggregate_function_foreach.h index 7f746e53daa..9a4801c43bd 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_foreach.h +++ b/be/src/vec/aggregate_functions/aggregate_function_foreach.h @@ -31,6 +31,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" struct AggregateFunctionForEachData { size_t dynamic_array_size = 0; @@ -259,3 +260,5 @@ public: } }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.cpp b/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.cpp index 24faf58b2e1..395f1ea1e4c 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.cpp @@ -21,6 +21,7 @@ #include "vec/aggregate_functions/aggregate_function_group_array_intersect.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" IAggregateFunction* create_with_extra_types(const DataTypePtr& nested_type, const DataTypes& argument_types) { diff --git a/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h b/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h index fd6076686ac..dfa9e7e37e5 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h +++ b/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h @@ -37,6 +37,7 @@ #include "vec/io/var_int.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" class Arena; class BufferReadable; class BufferWritable; @@ -541,3 +542,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_group_concat.cpp b/be/src/vec/aggregate_functions/aggregate_function_group_concat.cpp index 286795ea2ba..b5ee82875f3 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_group_concat.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_group_concat.cpp @@ -23,6 +23,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" const std::string AggregateFunctionGroupConcatImplStr::separator = ","; diff --git a/be/src/vec/aggregate_functions/aggregate_function_group_concat.h b/be/src/vec/aggregate_functions/aggregate_function_group_concat.h index a0cac9ab780..5f598e411b2 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_group_concat.h +++ b/be/src/vec/aggregate_functions/aggregate_function_group_concat.h @@ -32,6 +32,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -169,3 +170,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_histogram.cpp b/be/src/vec/aggregate_functions/aggregate_function_histogram.cpp index fb2fa9c2513..9df12c4c551 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_histogram.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_histogram.cpp @@ -28,6 +28,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T> AggregateFunctionPtr create_agg_function_histogram(const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_histogram.h b/be/src/vec/aggregate_functions/aggregate_function_histogram.h index 1d2c5725ed3..aae5ab00ce3 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_histogram.h +++ b/be/src/vec/aggregate_functions/aggregate_function_histogram.h @@ -44,6 +44,7 @@ #include "vec/utils/histogram_helpers.hpp" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -243,3 +244,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_hll_union_agg.cpp b/be/src/vec/aggregate_functions/aggregate_function_hll_union_agg.cpp index 4f2232d00d5..42399a77f9b 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_hll_union_agg.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_hll_union_agg.cpp @@ -23,6 +23,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_HLL_union_agg(AggregateFunctionSimpleFactory& factory) { factory.register_function_both( diff --git a/be/src/vec/aggregate_functions/aggregate_function_hll_union_agg.h b/be/src/vec/aggregate_functions/aggregate_function_hll_union_agg.h index 44835194eb4..40e964eba78 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_hll_union_agg.h +++ b/be/src/vec/aggregate_functions/aggregate_function_hll_union_agg.h @@ -38,6 +38,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -58,8 +59,7 @@ struct AggregateFunctionHLLData { void write(BufferWritable& buf) const { std::string result(dst_hll.max_serialized_size(), '0'); - int size = dst_hll.serialize((uint8_t*)result.c_str()); - result.resize(size); + result.resize(dst_hll.serialize((uint8_t*)result.c_str())); write_binary(result, buf); } @@ -149,3 +149,5 @@ AggregateFunctionPtr create_aggregate_function_HLL(const std::string& name, const bool result_is_nullable); } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h b/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h index d16da1a34e6..c4c050f8079 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h +++ b/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h @@ -23,6 +23,7 @@ #include <cstdint> #include <memory> +#include "common/cast_set.h" #include "common/compiler_util.h" #include "common/exception.h" #include "common/logging.h" @@ -41,6 +42,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" const char* UDAF_EXECUTOR_CLASS = "org/apache/doris/udf/UdafExecutor"; const char* UDAF_EXECUTOR_CTOR_SIGNATURE = "([B)V"; @@ -57,7 +59,7 @@ const char* UDAF_EXECUTOR_RESET_SIGNATURE = "(J)V"; struct AggregateJavaUdafData { public: AggregateJavaUdafData() = default; - AggregateJavaUdafData(int64_t num_args) { argument_size = num_args; } + AggregateJavaUdafData(int64_t num_args) { cast_set(argument_size, num_args); } ~AggregateJavaUdafData() = default; @@ -115,8 +117,8 @@ public: } Status add(int64_t places_address, bool is_single_place, const IColumn** columns, - int row_num_start, int row_num_end, const DataTypes& argument_types, - int place_offset) { + int64_t row_num_start, int64_t row_num_end, const DataTypes& argument_types, + int64_t place_offset) { JNIEnv* env = nullptr; RETURN_NOT_OK_STATUS_WITH_WARN(JniUtil::GetJNIEnv(&env), "Java-Udaf add function"); @@ -134,8 +136,10 @@ public: {"columns_types", input_table_schema.second}}; jobject input_map = JniUtil::convert_to_java_map(env, input_params); // invoke add batch - env->CallObjectMethod(executor_obj, executor_add_batch_id, is_single_place, row_num_start, - row_num_end, places_address, place_offset, input_map); + // Keep consistent with the function signature of executor_add_batch_id. + env->CallObjectMethod(executor_obj, executor_add_batch_id, is_single_place, + cast_set<int>(row_num_start), cast_set<int>(row_num_end), + places_address, cast_set<int>(place_offset), input_map); env->DeleteLocalRef(input_map); return JniUtil::GetJniExceptionMsg(env); } @@ -144,7 +148,7 @@ public: JNIEnv* env = nullptr; RETURN_NOT_OK_STATUS_WITH_WARN(JniUtil::GetJNIEnv(&env), "Java-Udaf merge function"); serialize_data = rhs.serialize_data; - long len = serialize_data.length(); + jsize len = cast_set<jsize>(serialize_data.length()); // jsize needs to be used. jbyteArray arr = env->NewByteArray(len); env->SetByteArrayRegion(arr, 0, len, reinterpret_cast<jbyte*>(serialize_data.data())); env->CallNonvirtualVoidMethod(executor_obj, executor_cl, executor_merge_id, place, arr); @@ -417,3 +421,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_kurtosis.cpp b/be/src/vec/aggregate_functions/aggregate_function_kurtosis.cpp index a763721f3f4..777bb4393cc 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_kurtosis.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_kurtosis.cpp @@ -25,6 +25,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T> AggregateFunctionPtr type_dispatch_for_aggregate_function_kurt(const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.cpp b/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.cpp index 683cf1a18f7..e61a97aca9f 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.cpp @@ -20,6 +20,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" const std::string AggregateFunctionLinearHistogramConsts::NAME = "linear_histogram"; diff --git a/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.h b/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.h index 173324b9463..f4d4b5455f1 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.h +++ b/be/src/vec/aggregate_functions/aggregate_function_linear_histogram.h @@ -35,6 +35,7 @@ // TODO: support foreach namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T> struct AggregateFunctionLinearHistogramData { @@ -70,7 +71,8 @@ public: double val = 0; if constexpr (IsDecimalNumber<T>) { using NativeType = typename T::NativeType; - val = static_cast<double>(value.value) / decimal_scale_multiplier<NativeType>(scale); + val = static_cast<double>(value.value) / + static_cast<double>(decimal_scale_multiplier<NativeType>(scale)); } else { val = static_cast<double>(value); } @@ -255,3 +257,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_map.cpp b/be/src/vec/aggregate_functions/aggregate_function_map.cpp index f289d885f48..627a6019080 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_map.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_map.cpp @@ -21,6 +21,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename K> AggregateFunctionPtr create_agg_function_map_agg(const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_map.h b/be/src/vec/aggregate_functions/aggregate_function_map.h index 3ec25cdc706..17bc54f7499 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_map.h +++ b/be/src/vec/aggregate_functions/aggregate_function_map.h @@ -33,6 +33,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename K> struct AggregateFunctionMapAggData { @@ -345,3 +346,5 @@ protected: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_max_by.cpp b/be/src/vec/aggregate_functions/aggregate_function_max_by.cpp index 35b4a4400da..50e611b11d8 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_max_by.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_max_by.cpp @@ -21,6 +21,7 @@ #include "vec/aggregate_functions/aggregate_function_simple_factory.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_max_by(AggregateFunctionSimpleFactory& factory) { factory.register_function_both( diff --git a/be/src/vec/aggregate_functions/aggregate_function_min_by.cpp b/be/src/vec/aggregate_functions/aggregate_function_min_by.cpp index 6e1d96ddf5d..0af34292bbb 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_min_by.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_min_by.cpp @@ -21,6 +21,7 @@ #include "vec/aggregate_functions/aggregate_function_simple_factory.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_min_by(AggregateFunctionSimpleFactory& factory) { factory.register_function_both( diff --git a/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp b/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp index c1a72fd52bd..e6e558b7fdc 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp @@ -26,6 +26,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" /// min, max, any template <template <typename> class Data> AggregateFunctionPtr create_aggregate_function_single_value(const String& name, diff --git a/be/src/vec/aggregate_functions/aggregate_function_min_max.h b/be/src/vec/aggregate_functions/aggregate_function_min_max.h index efc2854ff14..4ced874e36d 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_min_max.h +++ b/be/src/vec/aggregate_functions/aggregate_function_min_max.h @@ -26,6 +26,7 @@ #include <memory> #include <vector> +#include "common/cast_set.h" #include "common/logging.h" #include "vec/aggregate_functions/aggregate_function.h" #include "vec/columns/column.h" @@ -41,6 +42,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; template <typename T> @@ -302,7 +304,8 @@ public: struct SingleValueDataString { private: using Self = SingleValueDataString; - + // This function uses int32 for storage, which triggers a 64-bit to 32-bit conversion warning. + // However, considering compatibility with future upgrades, no changes will be made here. Int32 size = -1; /// -1 indicates that there is no value. Int32 capacity = 0; /// power of two or zero std::unique_ptr<char[]> large_data; @@ -364,7 +367,7 @@ public: } } else { if (capacity < rhs_size) { - capacity = round_up_to_power_of_two_or_zero(rhs_size); + capacity = (Int32)round_up_to_power_of_two_or_zero(rhs_size); large_data.reset(new char[capacity]); } @@ -381,8 +384,7 @@ public: /// Assuming to.has() void change_impl(StringRef value, Arena*) { - Int32 value_size = value.size; - + Int32 value_size = cast_set<Int32>(value.size); if (value_size <= MAX_SMALL_STRING_SIZE) { /// Don't free large_data here. size = value_size; @@ -393,7 +395,7 @@ public: } else { if (capacity < value_size) { /// Don't free large_data here. - capacity = round_up_to_power_of_two_or_zero(value_size); + capacity = (Int32)round_up_to_power_of_two_or_zero(value_size); large_data.reset(new char[capacity]); } @@ -717,3 +719,5 @@ AggregateFunctionPtr create_aggregate_function_single_value(const String& name, const bool result_is_nullable, const AggregateFunctionAttr& attr = {}); } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_min_max_by.h b/be/src/vec/aggregate_functions/aggregate_function_min_max_by.h index 5c73ac9aa67..3b8d182ff46 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_min_max_by.h +++ b/be/src/vec/aggregate_functions/aggregate_function_min_max_by.h @@ -30,6 +30,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" /// For bitmap value struct BitmapValueData { @@ -295,3 +296,5 @@ AggregateFunctionPtr create_aggregate_function_min_max_by(const String& name, } } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_null.h b/be/src/vec/aggregate_functions/aggregate_function_null.h index 014a3e9c603..b3fa3b8230d 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_null.h +++ b/be/src/vec/aggregate_functions/aggregate_function_null.h @@ -31,6 +31,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename NestFunction, bool result_is_nullable, typename Derived> class AggregateFunctionNullBaseInline : public IAggregateFunctionHelper<Derived> { @@ -334,3 +335,5 @@ private: is_nullable; /// Plain array is better than std::vector due to one indirection less. }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_orthogonal_bitmap.cpp b/be/src/vec/aggregate_functions/aggregate_function_orthogonal_bitmap.cpp index fe41aba2f0b..94f942ec644 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_orthogonal_bitmap.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_orthogonal_bitmap.cpp @@ -26,6 +26,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris { +#include "common/compile_check_begin.h" struct StringRef; } // namespace doris diff --git a/be/src/vec/aggregate_functions/aggregate_function_orthogonal_bitmap.h b/be/src/vec/aggregate_functions/aggregate_function_orthogonal_bitmap.h index a81bdcddaa3..ed4b9675a76 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_orthogonal_bitmap.h +++ b/be/src/vec/aggregate_functions/aggregate_function_orthogonal_bitmap.h @@ -39,6 +39,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" class Arena; class BufferReadable; class BufferWritable; @@ -379,7 +380,8 @@ public: AggFunctionOrthBitmapFunc(const DataTypes& argument_types_) : IAggregateFunctionDataHelper<Impl, AggFunctionOrthBitmapFunc<Impl>>(argument_types_), - _argument_size(argument_types_.size()) {} + // The number of arguments will not exceed the size of an int + _argument_size(int(argument_types_.size())) {} DataTypePtr get_return_type() const override { return Impl::get_return_type(); } @@ -413,3 +415,5 @@ private: int _argument_size; }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_product.h b/be/src/vec/aggregate_functions/aggregate_function_product.h index 82f765a909d..bbec428b25a 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_product.h +++ b/be/src/vec/aggregate_functions/aggregate_function_product.h @@ -31,6 +31,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { template <typename T> @@ -174,3 +175,5 @@ private: } // namespace vectorized } // namespace doris + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_quantile_state.cpp b/be/src/vec/aggregate_functions/aggregate_function_quantile_state.cpp index 128edc59915..1af3bfb3529 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_quantile_state.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_quantile_state.cpp @@ -23,6 +23,7 @@ #include "vec/data_types/data_type.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" AggregateFunctionPtr create_aggregate_function_quantile_state_union( const std::string& name, const DataTypes& argument_types, const bool result_is_nullable, diff --git a/be/src/vec/aggregate_functions/aggregate_function_quantile_state.h b/be/src/vec/aggregate_functions/aggregate_function_quantile_state.h index c48ac920919..7da2118b5b0 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_quantile_state.h +++ b/be/src/vec/aggregate_functions/aggregate_function_quantile_state.h @@ -32,6 +32,7 @@ #include "vec/data_types/data_type_quantilestate.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -157,3 +158,5 @@ AggregateFunctionPtr create_aggregate_function_quantile_state_union( const AggregateFunctionAttr& attr); } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_reader.cpp b/be/src/vec/aggregate_functions/aggregate_function_reader.cpp index 6f27a5dd128..737f66832da 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_reader.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_reader.cpp @@ -30,6 +30,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" // auto spread at nullable condition, null value do not participate aggregate void register_aggregate_function_reader_load(AggregateFunctionSimpleFactory& factory) { diff --git a/be/src/vec/aggregate_functions/aggregate_function_reader.h b/be/src/vec/aggregate_functions/aggregate_function_reader.h index ef35ea16fd4..7aa6f00ee81 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_reader.h +++ b/be/src/vec/aggregate_functions/aggregate_function_reader.h @@ -18,6 +18,7 @@ #pragma once namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class AggregateFunctionSimpleFactory; } // namespace vectorized @@ -33,3 +34,5 @@ void register_aggregate_function_reader_load(AggregateFunctionSimpleFactory& fac void register_aggregate_function_replace_reader_load(AggregateFunctionSimpleFactory& factory); } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_reader_first_last.h b/be/src/vec/aggregate_functions/aggregate_function_reader_first_last.h index 066ef2a2579..2657feb9380 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_reader_first_last.h +++ b/be/src/vec/aggregate_functions/aggregate_function_reader_first_last.h @@ -30,6 +30,7 @@ #include "vec/functions/function.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename ColVecType, bool arg_is_nullable> struct Value { @@ -309,4 +310,5 @@ CREATE_READER_FUNCTION_WITH_NAME_AND_DATA(create_aggregate_function_last_non_nul ReaderFunctionLastNonNullData); #undef CREATE_READER_FUNCTION_WITH_NAME_AND_DATA -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized +#include "common/compile_check_end.h" \ No newline at end of file diff --git a/be/src/vec/aggregate_functions/aggregate_function_regr_union.cpp b/be/src/vec/aggregate_functions/aggregate_function_regr_union.cpp index c20b5977f21..8f17456ad2e 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_regr_union.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_regr_union.cpp @@ -26,6 +26,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T, template <typename> class StatFunctionTemplate> AggregateFunctionPtr type_dispatch_for_aggregate_function_regr(const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_regr_union.h b/be/src/vec/aggregate_functions/aggregate_function_regr_union.h index a95daaf0d84..b16763745a4 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_regr_union.h +++ b/be/src/vec/aggregate_functions/aggregate_function_regr_union.h @@ -36,6 +36,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T> struct AggregateFunctionRegrData { @@ -82,19 +83,19 @@ struct AggregateFunctionRegrData { } void add(T value_y, T value_x) { - sum_x += value_x; - sum_y += value_y; - sum_of_x_mul_y += value_x * value_y; - sum_of_x_squared += value_x * value_x; + sum_x += (double)value_x; + sum_y += (double)value_y; + sum_of_x_mul_y += (double)value_x * (double)value_y; + sum_of_x_squared += (double)value_x * (double)value_x; count += 1; } Float64 get_slope() const { - Float64 denominator = count * sum_of_x_squared - sum_x * sum_x; + Float64 denominator = (double)count * sum_of_x_squared - sum_x * sum_x; if (count < 2 || denominator == 0.0) { return std::numeric_limits<Float64>::quiet_NaN(); } - Float64 slope = (count * sum_of_x_mul_y - sum_x * sum_y) / denominator; + Float64 slope = ((double)count * sum_of_x_mul_y - sum_x * sum_y) / denominator; return slope; } }; @@ -115,7 +116,7 @@ struct RegrInterceptFunc : AggregateFunctionRegrData<T> { if (std::isnan(slope)) { return slope; } else { - Float64 intercept = (this->sum_y - slope * this->sum_x) / this->count; + Float64 intercept = (this->sum_y - slope * this->sum_x) / (double)this->count; return intercept; } } @@ -214,3 +215,5 @@ public: } }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_retention.cpp b/be/src/vec/aggregate_functions/aggregate_function_retention.cpp index 38dd8f9de66..ba45950f555 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_retention.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_retention.cpp @@ -21,6 +21,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_retention(AggregateFunctionSimpleFactory& factory) { factory.register_function_both("retention", creator_without_type::creator<AggregateFunctionRetention>); diff --git a/be/src/vec/aggregate_functions/aggregate_function_retention.h b/be/src/vec/aggregate_functions/aggregate_function_retention.h index f6bf03282e5..3318ac96ef3 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_retention.h +++ b/be/src/vec/aggregate_functions/aggregate_function_retention.h @@ -43,6 +43,7 @@ #include "vec/io/var_int.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -166,4 +167,5 @@ public: to_arr.get_offsets().push_back(to_nested_col.size()); } }; -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_sequence_match.cpp b/be/src/vec/aggregate_functions/aggregate_function_sequence_match.cpp index c49ee021dbf..f9e901b34da 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sequence_match.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_sequence_match.cpp @@ -26,6 +26,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <template <typename, typename> typename AggregateFunction> AggregateFunctionPtr create_aggregate_function_sequence_base(const std::string& name, diff --git a/be/src/vec/aggregate_functions/aggregate_function_sequence_match.h b/be/src/vec/aggregate_functions/aggregate_function_sequence_match.h index 58600304331..827e506a3b0 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sequence_match.h +++ b/be/src/vec/aggregate_functions/aggregate_function_sequence_match.h @@ -51,6 +51,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -144,7 +145,8 @@ public: write_binary(events.second.to_ulong(), buf); } - UInt32 conditions_met_value = conditions_met.to_ulong(); + // This is std::bitset<32>, which will not exceed 32 bits. + UInt32 conditions_met_value = (UInt32)conditions_met.to_ulong(); write_binary(conditions_met_value, buf); write_binary(pattern, buf); @@ -754,3 +756,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_simple_factory.cpp b/be/src/vec/aggregate_functions/aggregate_function_simple_factory.cpp index 90bdab70522..68692638823 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_simple_factory.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_simple_factory.cpp @@ -25,6 +25,7 @@ #include "vec/aggregate_functions/aggregate_function_reader.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_combinator_distinct(AggregateFunctionSimpleFactory& factory); void register_aggregate_function_combinator_foreach(AggregateFunctionSimpleFactory& factory); diff --git a/be/src/vec/aggregate_functions/aggregate_function_simple_factory.h b/be/src/vec/aggregate_functions/aggregate_function_simple_factory.h index aa33e7289df..842170c18eb 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_simple_factory.h +++ b/be/src/vec/aggregate_functions/aggregate_function_simple_factory.h @@ -36,6 +36,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" using DataTypePtr = std::shared_ptr<const IDataType>; using DataTypes = std::vector<DataTypePtr>; using AggregateFunctionCreator = std::function<AggregateFunctionPtr( @@ -184,3 +185,5 @@ public: static AggregateFunctionSimpleFactory& instance(); }; }; // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_skew.cpp b/be/src/vec/aggregate_functions/aggregate_function_skew.cpp index af2eb443eb0..993a558d290 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_skew.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_skew.cpp @@ -25,6 +25,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <typename T> AggregateFunctionPtr type_dispatch_for_aggregate_function_skew(const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_sort.cpp b/be/src/vec/aggregate_functions/aggregate_function_sort.cpp index c80d36aec58..99d93127f0c 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sort.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_sort.cpp @@ -22,6 +22,7 @@ #include "vec/aggregate_functions/aggregate_function_simple_factory.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" AggregateFunctionPtr transform_to_sort_agg_function(const AggregateFunctionPtr& nested_function, const DataTypes& arguments, diff --git a/be/src/vec/aggregate_functions/aggregate_function_sort.h b/be/src/vec/aggregate_functions/aggregate_function_sort.h index 981580f8e6a..a0a05cc7ddd 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sort.h +++ b/be/src/vec/aggregate_functions/aggregate_function_sort.h @@ -41,6 +41,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -204,3 +205,5 @@ AggregateFunctionPtr transform_to_sort_agg_function(const AggregateFunctionPtr& const SortDescription& sort_desc, RuntimeState* state); } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_state_merge.h b/be/src/vec/aggregate_functions/aggregate_function_state_merge.h index d16c823b029..64987337347 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_state_merge.h +++ b/be/src/vec/aggregate_functions/aggregate_function_state_merge.h @@ -20,6 +20,7 @@ #include "vec/aggregate_functions/aggregate_function_state_union.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" const static std::string AGG_MERGE_SUFFIX = "_merge"; class AggregateStateMerge : public AggregateStateUnion { @@ -55,3 +56,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_state_union.h b/be/src/vec/aggregate_functions/aggregate_function_state_union.h index 6ff900c90d3..c69a3b9c157 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_state_union.h +++ b/be/src/vec/aggregate_functions/aggregate_function_state_union.h @@ -23,6 +23,7 @@ #include "vec/data_types/data_type_agg_state.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" const static std::string AGG_UNION_SUFFIX = "_union"; class AggregateStateUnion : public IAggregateFunctionHelper<AggregateStateUnion> { @@ -112,3 +113,5 @@ protected: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_statistic.h b/be/src/vec/aggregate_functions/aggregate_function_statistic.h index a1fd4395eb8..9c3ff9cbf73 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_statistic.h +++ b/be/src/vec/aggregate_functions/aggregate_function_statistic.h @@ -35,6 +35,7 @@ #include "vec/data_types/data_type_number.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" enum class STATISTICS_FUNCTION_KIND : uint8_t { SKEW_POP, KURT_POP }; @@ -53,6 +54,7 @@ template <typename T, std::size_t _level> struct StatFuncOneArg { using Type = T; using Data = VarMoments<Float64, _level>; + using DataType = Float64; }; template <typename StatFunc, bool NullableInput> @@ -63,6 +65,7 @@ class AggregateFunctionVarianceSimple public: using InputCol = ColumnVector<typename StatFunc::Type>; using ResultCol = ColumnVector<Float64>; + using InputType = typename StatFunc::DataType; explicit AggregateFunctionVarianceSimple(STATISTICS_FUNCTION_KIND kind_, const DataTypes& argument_types_) @@ -88,14 +91,16 @@ public: if (column_with_nullable.is_null_at(row_num)) { return; } else { - this->data(place).add(assert_cast<const InputCol&, TypeCheckOnRelease::DISABLE>( - column_with_nullable.get_nested_column()) - .get_data()[row_num]); + this->data(place).add( + (InputType)assert_cast<const InputCol&, TypeCheckOnRelease::DISABLE>( + column_with_nullable.get_nested_column()) + .get_data()[row_num]); } } else { this->data(place).add( - assert_cast<const InputCol&, TypeCheckOnRelease::DISABLE>(*columns[0]) + (InputType)assert_cast<const InputCol&, TypeCheckOnRelease::DISABLE>( + *columns[0]) .get_data()[row_num]); } } @@ -160,4 +165,5 @@ private: STATISTICS_FUNCTION_KIND kind; }; -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_stddev.cpp b/be/src/vec/aggregate_functions/aggregate_function_stddev.cpp index 5a76c3b836d..6c463b8417e 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_stddev.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_stddev.cpp @@ -28,6 +28,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <template <typename> class Function, typename Name, template <typename, typename, bool> class Data, bool is_stddev> diff --git a/be/src/vec/aggregate_functions/aggregate_function_stddev.h b/be/src/vec/aggregate_functions/aggregate_function_stddev.h index 9b3cd190991..d42adc28d73 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_stddev.h +++ b/be/src/vec/aggregate_functions/aggregate_function_stddev.h @@ -34,7 +34,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { - +#include "common/compile_check_begin.h" class Arena; class BufferReadable; class BufferWritable; @@ -88,12 +88,12 @@ struct BaseData { if (count == 1) { return 0.0; } - double res = m2 / count; + double res = m2 / (double)count; return get_result(res); } double get_samp_result() const { - double res = m2 / (count - 1); + double res = m2 / double(count - 1); return get_result(res); } @@ -102,21 +102,21 @@ struct BaseData { return; } double delta = mean - rhs.mean; - double sum_count = count + rhs.count; - mean = rhs.mean + delta * count / sum_count; - m2 = rhs.m2 + m2 + (delta * delta) * rhs.count * count / sum_count; + double sum_count = double(count + rhs.count); + mean = rhs.mean + delta * (double)count / sum_count; + m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; count = int64_t(sum_count); } void add(const IColumn* column, size_t row_num) { const auto& sources = assert_cast<const ColumnVector<T>&, TypeCheckOnRelease::DISABLE>(*column); - double source_data = sources.get_data()[row_num]; + double source_data = (double)sources.get_data()[row_num]; double delta = source_data - mean; - double r = delta / (1 + count); + double r = delta / double(1 + count); mean += r; - m2 += count * delta * r; + m2 += (double)count * delta * r; count += 1; } @@ -217,3 +217,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_sum.cpp b/be/src/vec/aggregate_functions/aggregate_function_sum.cpp index 91063c22dc6..3ad9efa121c 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sum.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_sum.cpp @@ -24,6 +24,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void register_aggregate_function_sum(AggregateFunctionSimpleFactory& factory) { AggregateFunctionCreator creator = [&](const std::string& name, const DataTypes& types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_sum.h b/be/src/vec/aggregate_functions/aggregate_function_sum.h index 13fb3864bd1..68fb1806724 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sum.h +++ b/be/src/vec/aggregate_functions/aggregate_function_sum.h @@ -37,6 +37,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -248,3 +249,5 @@ template <typename T> using AggregateFunctionSumSimpleReader = typename SumSimple<T, false>::Function; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_topn.cpp b/be/src/vec/aggregate_functions/aggregate_function_topn.cpp index 799d8fe1c75..ea7a33969b9 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_topn.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_topn.cpp @@ -25,6 +25,7 @@ #include "vec/data_types/data_type.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" AggregateFunctionPtr create_aggregate_function_topn(const std::string& name, const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_topn.h b/be/src/vec/aggregate_functions/aggregate_function_topn.h index 1c0fba5099f..29eee8eee55 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_topn.h +++ b/be/src/vec/aggregate_functions/aggregate_function_topn.h @@ -50,6 +50,7 @@ #include "vec/io/io_helper.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -385,3 +386,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_uniq.cpp b/be/src/vec/aggregate_functions/aggregate_function_uniq.cpp index 25231025416..df0f2321947 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_uniq.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_uniq.cpp @@ -30,6 +30,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <template <typename> class Data> AggregateFunctionPtr create_aggregate_function_uniq(const std::string& name, diff --git a/be/src/vec/aggregate_functions/aggregate_function_uniq.h b/be/src/vec/aggregate_functions/aggregate_function_uniq.h index a3bdad63505..59f477363f7 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_uniq.h +++ b/be/src/vec/aggregate_functions/aggregate_function_uniq.h @@ -44,6 +44,7 @@ #include "vec/io/var_int.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -232,3 +233,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.cpp b/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.cpp index c89c8aa14f0..6a7c6b8f3b0 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.cpp @@ -24,6 +24,7 @@ #include "vec/aggregate_functions/helpers.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <template <typename> class Data> AggregateFunctionPtr create_aggregate_function_uniq(const std::string& name, diff --git a/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.h b/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.h index 90d137c6238..ee1ae91ab3e 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.h +++ b/be/src/vec/aggregate_functions/aggregate_function_uniq_distribute_key.h @@ -42,6 +42,7 @@ #include "vec/io/var_int.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -258,3 +259,5 @@ public: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_window.cpp b/be/src/vec/aggregate_functions/aggregate_function_window.cpp index 9da838a6b90..fcb0072abe8 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_window.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_window.cpp @@ -30,6 +30,7 @@ #include "vec/utils/template_helpers.hpp" namespace doris::vectorized { +#include "common/compile_check_begin.h" template <template <typename> class AggregateFunctionTemplate, template <typename ColVecType, bool, bool> class Data, diff --git a/be/src/vec/aggregate_functions/aggregate_function_window.h b/be/src/vec/aggregate_functions/aggregate_function_window.h index cb038fe3116..0011ae3aba9 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_window.h +++ b/be/src/vec/aggregate_functions/aggregate_function_window.h @@ -42,6 +42,7 @@ #include "vec/data_types/data_type_number.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" class Arena; class BufferReadable; class BufferWritable; @@ -181,7 +182,7 @@ class WindowFunctionPercentRank final : public IAggregateFunctionDataHelper<PercentRankData, WindowFunctionPercentRank> { private: static double _cal_percent(int64 rank, int64 total_rows) { - return total_rows <= 1 ? 0.0 : (rank - 1) * 1.0 / (total_rows - 1); + return total_rows <= 1 ? 0.0 : double(rank - 1) * 1.0 / double(total_rows - 1); } public: @@ -270,7 +271,7 @@ public: } void insert_result_into(ConstAggregateDataPtr place, IColumn& to) const override { - auto cume_dist = data(place).numerator * 1.0 / data(place).denominator; + auto cume_dist = (double)data(place).numerator * 1.0 / (double)data(place).denominator; assert_cast<ColumnFloat64&>(to).get_data().push_back(cume_dist); } @@ -580,3 +581,5 @@ private: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_window_funnel.cpp b/be/src/vec/aggregate_functions/aggregate_function_window_funnel.cpp index f95dccd547e..606df4d2c4f 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_window_funnel.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_window_funnel.cpp @@ -29,6 +29,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" AggregateFunctionPtr create_aggregate_function_window_funnel(const std::string& name, const DataTypes& argument_types, diff --git a/be/src/vec/aggregate_functions/aggregate_function_window_funnel.h b/be/src/vec/aggregate_functions/aggregate_function_window_funnel.h index 84222f0d01b..efd51444c56 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_window_funnel.h +++ b/be/src/vec/aggregate_functions/aggregate_function_window_funnel.h @@ -32,6 +32,7 @@ #include <utility> #include "agent/be_exec_version_manager.h" +#include "common/cast_set.h" #include "common/compiler_util.h" #include "common/exception.h" #include "util/binary_cast.hpp" @@ -49,6 +50,7 @@ #include "vec/runtime/vdatetime_value.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { class Arena; class BufferReadable; @@ -349,7 +351,9 @@ struct WindowFunnelState { in.read(buff.data(), data_bytes); PBlock pblock; - if (!pblock.ParseFromArray(buff.data(), data_bytes)) { + // It is preferable to change data_bytes to int type here, + // but due to compatibility issues, no changes will be made. + if (!pblock.ParseFromArray(buff.data(), (int)data_bytes)) { throw doris::Exception(ErrorCode::INTERNAL_ERROR, "Failed to parse window_funnel data to block"); } @@ -376,7 +380,7 @@ public: void create(AggregateDataPtr __restrict place) const override { auto data = new (place) WindowFunnelState<TYPE_INDEX, NativeType>( - IAggregateFunction::get_argument_types().size() - 3); + cast_set<int>(IAggregateFunction::get_argument_types().size() - 3)); /// support window funnel mode from 2.0. See `BeExecVersionManager::max_be_exec_version` data->enable_mode = version >= 3; } @@ -424,3 +428,5 @@ protected: }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/factory_helpers.h b/be/src/vec/aggregate_functions/factory_helpers.h index 553f05c3665..d5a4a022176 100644 --- a/be/src/vec/aggregate_functions/factory_helpers.h +++ b/be/src/vec/aggregate_functions/factory_helpers.h @@ -25,6 +25,7 @@ #include "vec/data_types/data_type.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" inline void assert_unary(const std::string& name, const DataTypes& argument_types) { CHECK_EQ(argument_types.size(), 1) @@ -57,3 +58,5 @@ void assert_arity_at_most(const std::string& name, const DataTypes& argument_typ } } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/helpers.h b/be/src/vec/aggregate_functions/helpers.h index 34b7e76c2ea..75ef07bae64 100644 --- a/be/src/vec/aggregate_functions/helpers.h +++ b/be/src/vec/aggregate_functions/helpers.h @@ -99,6 +99,7 @@ } while (false) namespace doris::vectorized { +#include "common/compile_check_begin.h" struct creator_without_type { template <bool multi_arguments, bool f, typename T> @@ -260,3 +261,5 @@ using creator_with_decimal_type = creator_with_type_base<false, false, true>; using creator_with_type = creator_with_type_base<true, true, true>; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/aggregate_functions/moments.h b/be/src/vec/aggregate_functions/moments.h index d9db1277470..0628b3116e2 100644 --- a/be/src/vec/aggregate_functions/moments.h +++ b/be/src/vec/aggregate_functions/moments.h @@ -24,6 +24,7 @@ #include "vec/io/io_helper.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" class BufferReadable; class BufferWritable; @@ -111,4 +112,5 @@ struct VarMoments { } }; -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized +#include "common/compile_check_end.h" diff --git a/be/src/vec/common/string_buffer.hpp b/be/src/vec/common/string_buffer.hpp index 8dca6f057a2..769b2e93d7d 100644 --- a/be/src/vec/common/string_buffer.hpp +++ b/be/src/vec/common/string_buffer.hpp @@ -76,7 +76,7 @@ public: return ref; } - void read(char* data, int len) { + void read(char* data, size_t len) { memcpy(data, _data, len); _data += len; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org