From a24a2e02bd018f8550e5d048d912980221c36728 Mon Sep 17 00:00:00 2001 From: Mryange <2319153948@qq.com> Date: Fri, 25 Oct 2024 18:44:05 +0800 Subject: [PATCH] upd --- be/src/vec/runtime/ip_address_cidr.h | 11 +++++++---- be/src/vec/runtime/ipv4_value.h | 3 +++ be/src/vec/runtime/ipv6_value.h | 3 +++ be/src/vec/runtime/partitioner.cpp | 12 +++++++----- be/src/vec/runtime/partitioner.h | 3 +++ be/src/vec/runtime/shared_hash_table_controller.cpp | 1 + be/src/vec/runtime/shared_hash_table_controller.h | 3 +++ be/src/vec/runtime/time_value.h | 7 ++++++- be/src/vec/runtime/vcsv_transformer.cpp | 8 +++++--- be/src/vec/runtime/vcsv_transformer.h | 3 +++ be/src/vec/runtime/vdata_stream_mgr.cpp | 5 +++-- be/src/vec/runtime/vdata_stream_mgr.h | 3 +++ be/src/vec/runtime/vdata_stream_recvr.cpp | 1 + be/src/vec/runtime/vdata_stream_recvr.h | 3 +++ be/src/vec/runtime/vfile_format_transformer.h | 3 +++ be/src/vec/runtime/vorc_transformer.cpp | 4 +++- be/src/vec/runtime/vorc_transformer.h | 3 +++ be/src/vec/runtime/vparquet_transformer.cpp | 1 + be/src/vec/runtime/vparquet_transformer.h | 3 +++ be/src/vec/runtime/vsorted_run_merger.cpp | 1 + be/src/vec/runtime/vsorted_run_merger.h | 3 +++ 21 files changed, 68 insertions(+), 16 deletions(-) diff --git a/be/src/vec/runtime/ip_address_cidr.h b/be/src/vec/runtime/ip_address_cidr.h index 9e6ac1fd57b666..d52bdede2f8031 100644 --- a/be/src/vec/runtime/ip_address_cidr.h +++ b/be/src/vec/runtime/ip_address_cidr.h @@ -22,7 +22,9 @@ #include "util/sse_util.hpp" #include "vec/common/format_ip.h" +#include "vec/common/ipv6_to_binary.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { static inline std::pair apply_cidr_mask(UInt32 src, UInt8 bits_to_keep) { @@ -46,7 +48,7 @@ static inline void apply_cidr_mask(const char* __restrict src, char* __restrict for (int8_t i = IPV6_BINARY_LENGTH - 1; i >= 0; --i) { dst_lower[i] = src[i] & mask[i]; - dst_upper[i] = dst_lower[i] | ~mask[i]; + dst_upper[i] = char(dst_lower[i] | ~mask[i]); } } } // namespace vectorized @@ -96,14 +98,14 @@ struct IPAddressCIDR { }; bool match_ipv4_subnet(uint32_t addr, uint32_t cidr_addr, uint8_t prefix) { - uint32_t mask = (prefix >= 32) ? 0xffffffffu : ~(0xffffffffu >> prefix); + uint32_t mask = (prefix >= 32) ? 0xffffffffU : ~(0xffffffffU >> prefix); return (addr & mask) == (cidr_addr & mask); } #if defined(__SSE2__) || defined(__aarch64__) bool match_ipv6_subnet(const uint8_t* addr, const uint8_t* cidr_addr, uint8_t prefix) { - uint16_t mask = _mm_movemask_epi8( + uint16_t mask = (uint16_t)_mm_movemask_epi8( _mm_cmpeq_epi8(_mm_loadu_si128(reinterpret_cast(addr)), _mm_loadu_si128(reinterpret_cast(cidr_addr)))); mask = ~mask; @@ -191,4 +193,5 @@ inline bool is_address_in_range(const IPAddressVariant& address, const IPAddress return false; } -} // namespace doris \ No newline at end of file +} // namespace doris +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/ipv4_value.h b/be/src/vec/runtime/ipv4_value.h index 76ae288e5be407..473c05c55d7f28 100644 --- a/be/src/vec/runtime/ipv4_value.h +++ b/be/src/vec/runtime/ipv4_value.h @@ -27,6 +27,7 @@ #include "vec/common/string_ref.h" namespace doris { +#include "common/compile_check_begin.h" class IPv4Value { public: @@ -101,3 +102,5 @@ class IPv4Value { }; } // namespace doris + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/ipv6_value.h b/be/src/vec/runtime/ipv6_value.h index 5a26af25243a0f..cd729ef1a35818 100644 --- a/be/src/vec/runtime/ipv6_value.h +++ b/be/src/vec/runtime/ipv6_value.h @@ -27,6 +27,7 @@ #include "vec/data_types/data_type_number_base.h" namespace doris { +#include "common/compile_check_begin.h" class IPv6Value { public: @@ -98,3 +99,5 @@ class IPv6Value { }; } // namespace doris + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/partitioner.cpp b/be/src/vec/runtime/partitioner.cpp index 660ffe51a83486..671e77e9f1c32a 100644 --- a/be/src/vec/runtime/partitioner.cpp +++ b/be/src/vec/runtime/partitioner.cpp @@ -17,21 +17,23 @@ #include "partitioner.h" +#include "common/cast_set.h" #include "pipeline/local_exchange/local_exchange_sink_operator.h" #include "runtime/thread_context.h" #include "vec/columns/column_const.h" #include "vec/sink/vdata_stream_sender.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" template Status Crc32HashPartitioner::do_partitioning(RuntimeState* state, Block* block) const { - int rows = block->rows(); + size_t rows = block->rows(); if (rows > 0) { auto column_to_keep = block->columns(); - int result_size = _partition_expr_ctxs.size(); + int result_size = cast_set(_partition_expr_ctxs.size()); std::vector result(result_size); _hash_vals.resize(rows); @@ -42,7 +44,7 @@ Status Crc32HashPartitioner::do_partitioning(RuntimeState* state, Bl _do_hash(unpack_if_const(block->get_by_position(result[j]).column).first, hashes, j); } - for (int i = 0; i < rows; i++) { + for (size_t i = 0; i < rows; i++) { hashes[i] = ChannelIds()(hashes[i], _partition_count); } @@ -55,13 +57,13 @@ template void Crc32HashPartitioner::_do_hash(const ColumnPtr& column, uint32_t* __restrict result, int idx) const { column->update_crcs_with_value(result, _partition_expr_ctxs[idx]->root()->type().type, - column->size()); + cast_set(column->size())); } template Status Crc32HashPartitioner::clone(RuntimeState* state, std::unique_ptr& partitioner) { - auto* new_partitioner = new Crc32HashPartitioner(_partition_count); + auto* new_partitioner = new Crc32HashPartitioner(cast_set(_partition_count)); partitioner.reset(new_partitioner); new_partitioner->_partition_expr_ctxs.resize(_partition_expr_ctxs.size()); for (size_t i = 0; i < _partition_expr_ctxs.size(); i++) { diff --git a/be/src/vec/runtime/partitioner.h b/be/src/vec/runtime/partitioner.h index e8feb74335ab6c..39ed0e899411b8 100644 --- a/be/src/vec/runtime/partitioner.h +++ b/be/src/vec/runtime/partitioner.h @@ -22,6 +22,7 @@ #include "vec/exprs/vexpr_context.h" namespace doris { +#include "common/compile_check_begin.h" class MemTracker; namespace vectorized { @@ -111,3 +112,5 @@ struct SpillPartitionChannelIds { } // namespace vectorized } // namespace doris + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/shared_hash_table_controller.cpp b/be/src/vec/runtime/shared_hash_table_controller.cpp index e5a28bed6ce50a..286f32bb38be86 100644 --- a/be/src/vec/runtime/shared_hash_table_controller.cpp +++ b/be/src/vec/runtime/shared_hash_table_controller.cpp @@ -26,6 +26,7 @@ #include "pipeline/exec/hashjoin_build_sink.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" void SharedHashTableController::set_builder_and_consumers(TUniqueId builder, int node_id) { // Only need to set builder and consumers with pipeline engine enabled. diff --git a/be/src/vec/runtime/shared_hash_table_controller.h b/be/src/vec/runtime/shared_hash_table_controller.h index c831d1b46e4e78..7bd032c6b56237 100644 --- a/be/src/vec/runtime/shared_hash_table_controller.h +++ b/be/src/vec/runtime/shared_hash_table_controller.h @@ -29,6 +29,7 @@ #include "vec/core/block.h" namespace doris { +#include "common/compile_check_begin.h" class RuntimeState; class MinMaxFuncBase; @@ -101,3 +102,5 @@ class SharedHashTableController { } // namespace vectorized } // namespace doris + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/time_value.h b/be/src/vec/runtime/time_value.h index d94e62b977c44d..3f9f378503e611 100644 --- a/be/src/vec/runtime/time_value.h +++ b/be/src/vec/runtime/time_value.h @@ -25,6 +25,7 @@ #include "vec/data_types/data_type_time.h" namespace doris { +#include "common/compile_check_begin.h" /// TODO: Due to the "Time type is not supported for OLAP table" issue, a lot of basic content is missing.It will be supplemented later. class TimeValue { @@ -58,7 +59,9 @@ class TimeValue { static std::string to_string(TimeType time, int scale) { return timev2_to_buffer_from_double(time, scale); } - static int32_t hour(TimeType time) { return check_over_max_time(time) / ONE_HOUR_MICROSECONDS; } + static int32_t hour(TimeType time) { + return static_cast(check_over_max_time(time) / ONE_HOUR_MICROSECONDS); + } static int32_t minute(TimeType time) { return (check_over_max_time(time) % ONE_HOUR_MICROSECONDS) / ONE_MINUTE_MICROSECONDS; @@ -70,3 +73,5 @@ class TimeValue { }; } // namespace doris + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/vcsv_transformer.cpp b/be/src/vec/runtime/vcsv_transformer.cpp index 51ac2eb2729921..a05431466b8c23 100644 --- a/be/src/vec/runtime/vcsv_transformer.cpp +++ b/be/src/vec/runtime/vcsv_transformer.cpp @@ -22,6 +22,7 @@ #include #include +#include "common/cast_set.h" #include "common/status.h" #include "io/fs/file_writer.h" #include "runtime/primitive_type.h" @@ -36,6 +37,7 @@ #include "vec/exprs/vexpr_context.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" static const unsigned char bom[] = {0xEF, 0xBB, 0xBF}; @@ -70,7 +72,7 @@ VCSVTransformer::VCSVTransformer(RuntimeState* state, doris::io::FileWriter* fil _options.escape_char = hive_serde_properties->escape_char[0]; } _options.null_format = hive_serde_properties->null_format.data(); - _options.null_len = hive_serde_properties->null_format.length(); + _options.null_len = cast_set(hive_serde_properties->null_format.length()); // The list of separators + escapeChar are the bytes required to be escaped. if (_options.escape_char != 0) { _options.need_escape[_options.escape_char & 0xff] = true; @@ -111,7 +113,7 @@ Status VCSVTransformer::write(const Block& block) { auto ser_col = ColumnString::create(); ser_col->reserve(block.columns()); VectorBufferWriter buffer_writer(*ser_col.get()); - for (size_t i = 0; i < block.rows(); i++) { + for (int i = 0; i < block.rows(); i++) { for (size_t col_id = 0; col_id < block.columns(); col_id++) { if (col_id != 0) { buffer_writer.write(_column_separator.data(), _column_separator.size()); @@ -158,7 +160,7 @@ Status VCSVTransformer::_flush_plain_text_outstream(ColumnString& ser_col) { std::string VCSVTransformer::_gen_csv_header_types() { std::string types; - int num_columns = _output_vexpr_ctxs.size(); + int num_columns = (int)_output_vexpr_ctxs.size(); for (int i = 0; i < num_columns; ++i) { types += type_to_string(_output_vexpr_ctxs[i]->root()->type().type); if (i < num_columns - 1) { diff --git a/be/src/vec/runtime/vcsv_transformer.h b/be/src/vec/runtime/vcsv_transformer.h index 6c4bbc333113d5..abfe5c3198858b 100644 --- a/be/src/vec/runtime/vcsv_transformer.h +++ b/be/src/vec/runtime/vcsv_transformer.h @@ -33,6 +33,7 @@ #include "vfile_format_transformer.h" namespace doris { +#include "common/compile_check_begin.h" namespace io { class FileWriter; } // namespace io @@ -83,3 +84,5 @@ class VCSVTransformer final : public VFileFormatTransformer { }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/vdata_stream_mgr.cpp b/be/src/vec/runtime/vdata_stream_mgr.cpp index 78067b9b18106c..573b842f2e68cc 100644 --- a/be/src/vec/runtime/vdata_stream_mgr.cpp +++ b/be/src/vec/runtime/vdata_stream_mgr.cpp @@ -31,6 +31,7 @@ #include "vec/runtime/vdata_stream_recvr.h" namespace doris { +#include "common/compile_check_begin.h" namespace vectorized { VDataStreamMgr::VDataStreamMgr() { @@ -81,7 +82,7 @@ Status VDataStreamMgr::find_recvr(const TUniqueId& fragment_instance_id, PlanNod std::shared_ptr* res, bool acquire_lock) { VLOG_ROW << "looking up fragment_instance_id=" << print_id(fragment_instance_id) << ", node=" << node_id; - size_t hash_value = get_hash_value(fragment_instance_id, node_id); + uint32_t hash_value = get_hash_value(fragment_instance_id, node_id); // Create lock guard and not own lock currently and will lock conditionally std::unique_lock recvr_lock(_lock, std::defer_lock); if (acquire_lock) { @@ -157,7 +158,7 @@ Status VDataStreamMgr::deregister_recvr(const TUniqueId& fragment_instance_id, P std::shared_ptr targert_recvr; VLOG_QUERY << "deregister_recvr(): fragment_instance_id=" << print_id(fragment_instance_id) << ", node=" << node_id; - size_t hash_value = get_hash_value(fragment_instance_id, node_id); + uint32_t hash_value = get_hash_value(fragment_instance_id, node_id); { std::lock_guard l(_lock); auto range = _receiver_map.equal_range(hash_value); diff --git a/be/src/vec/runtime/vdata_stream_mgr.h b/be/src/vec/runtime/vdata_stream_mgr.h index bd5e6f9b91ee57..30fa1c0e318f9e 100644 --- a/be/src/vec/runtime/vdata_stream_mgr.h +++ b/be/src/vec/runtime/vdata_stream_mgr.h @@ -30,6 +30,7 @@ #include "common/status.h" namespace google { +#include "common/compile_check_begin.h" namespace protobuf { class Closure; } @@ -96,3 +97,5 @@ class VDataStreamMgr { }; } // namespace vectorized } // namespace doris + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/vdata_stream_recvr.cpp b/be/src/vec/runtime/vdata_stream_recvr.cpp index f1dfbbf304763f..b48b9f780b8754 100644 --- a/be/src/vec/runtime/vdata_stream_recvr.cpp +++ b/be/src/vec/runtime/vdata_stream_recvr.cpp @@ -41,6 +41,7 @@ #include "vec/runtime/vsorted_run_merger.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" VDataStreamRecvr::SenderQueue::SenderQueue( VDataStreamRecvr* parent_recvr, int num_senders, RuntimeProfile* profile, diff --git a/be/src/vec/runtime/vdata_stream_recvr.h b/be/src/vec/runtime/vdata_stream_recvr.h index b2d76590ba2717..08fb004f3b1a8e 100644 --- a/be/src/vec/runtime/vdata_stream_recvr.h +++ b/be/src/vec/runtime/vdata_stream_recvr.h @@ -50,6 +50,7 @@ #include "vec/exprs/vexpr_fwd.h" namespace doris { +#include "common/compile_check_begin.h" class MemTracker; class PBlock; class MemTrackerLimiter; @@ -273,3 +274,5 @@ class VDataStreamRecvr::SenderQueue { } // namespace vectorized } // namespace doris + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/vfile_format_transformer.h b/be/src/vec/runtime/vfile_format_transformer.h index 19f873a632d1d6..aecd1276868512 100644 --- a/be/src/vec/runtime/vfile_format_transformer.h +++ b/be/src/vec/runtime/vfile_format_transformer.h @@ -28,6 +28,7 @@ #include "vec/exprs/vexpr_fwd.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" class VFileFormatTransformer { public: @@ -61,3 +62,5 @@ class VFileFormatTransformer { vectorized::DataTypeSerDe::FormatOptions _options; }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/vorc_transformer.cpp b/be/src/vec/runtime/vorc_transformer.cpp index 6c512a94373d20..e3d2b475f81e46 100644 --- a/be/src/vec/runtime/vorc_transformer.cpp +++ b/be/src/vec/runtime/vorc_transformer.cpp @@ -24,6 +24,7 @@ #include #include +#include "common/cast_set.h" #include "common/status.h" #include "io/fs/file_writer.h" #include "orc/Int128.hh" @@ -59,6 +60,7 @@ #include "vec/runtime/vdatetime_value.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" VOrcOutputStream::VOrcOutputStream(doris::io::FileWriter* file_writer) : _file_writer(file_writer), _cur_pos(0), _written_len(0), _name("VOrcOutputStream") {} @@ -344,7 +346,7 @@ Status VOrcTransformer::write(const Block& block) { } }}; - size_t sz = block.rows(); + int sz = cast_set(block.rows()); auto row_batch = _create_row_batch(sz); auto* root = dynamic_cast(row_batch.get()); try { diff --git a/be/src/vec/runtime/vorc_transformer.h b/be/src/vec/runtime/vorc_transformer.h index 134e949e76cabd..596938fe10fbd9 100644 --- a/be/src/vec/runtime/vorc_transformer.h +++ b/be/src/vec/runtime/vorc_transformer.h @@ -33,6 +33,7 @@ #include "vec/runtime/vparquet_transformer.h" namespace doris { +#include "common/compile_check_begin.h" namespace io { class FileWriter; } // namespace io @@ -131,3 +132,5 @@ class VOrcTransformer final : public VFileFormatTransformer { }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/vparquet_transformer.cpp b/be/src/vec/runtime/vparquet_transformer.cpp index f0810d6c7ceead..ab288537313973 100644 --- a/be/src/vec/runtime/vparquet_transformer.cpp +++ b/be/src/vec/runtime/vparquet_transformer.cpp @@ -71,6 +71,7 @@ #include "vec/runtime/vdatetime_value.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" ParquetOutputStream::ParquetOutputStream(doris::io::FileWriter* file_writer) : _file_writer(file_writer), _cur_pos(0), _written_len(0) { diff --git a/be/src/vec/runtime/vparquet_transformer.h b/be/src/vec/runtime/vparquet_transformer.h index 9eae25d8ac4ff5..9fdbb271373212 100644 --- a/be/src/vec/runtime/vparquet_transformer.h +++ b/be/src/vec/runtime/vparquet_transformer.h @@ -30,6 +30,7 @@ #include "vfile_format_transformer.h" namespace doris { +#include "common/compile_check_begin.h" namespace io { class FileWriter; } // namespace io @@ -134,3 +135,5 @@ class VParquetTransformer final : public VFileFormatTransformer { }; } // namespace doris::vectorized + +#include "common/compile_check_end.h" diff --git a/be/src/vec/runtime/vsorted_run_merger.cpp b/be/src/vec/runtime/vsorted_run_merger.cpp index e2b2e9e25537f2..9a63c271852110 100644 --- a/be/src/vec/runtime/vsorted_run_merger.cpp +++ b/be/src/vec/runtime/vsorted_run_merger.cpp @@ -29,6 +29,7 @@ #include "vec/utils/util.hpp" namespace doris::vectorized { +#include "common/compile_check_begin.h" VSortedRunMerger::VSortedRunMerger(const VExprContextSPtrs& ordering_expr, const std::vector& is_asc_order, diff --git a/be/src/vec/runtime/vsorted_run_merger.h b/be/src/vec/runtime/vsorted_run_merger.h index f01e6794e6e9f5..898b52a8601e21 100644 --- a/be/src/vec/runtime/vsorted_run_merger.h +++ b/be/src/vec/runtime/vsorted_run_merger.h @@ -31,6 +31,7 @@ #include "vec/exprs/vexpr_fwd.h" namespace doris::vectorized { +#include "common/compile_check_begin.h" // VSortedRunMerger is used to merge multiple sorted runs of blocks. A run is a sorted // sequence of blocks, which are fetched from a BlockSupplier function object. @@ -98,3 +99,5 @@ class VSortedRunMerger { }; } // namespace doris::vectorized + +#include "common/compile_check_end.h"