This is an automated email from the ASF dual-hosted git repository. panxiaolei 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 7b4893642d0 [env](compile) open compile check in some file (#41940) 7b4893642d0 is described below commit 7b4893642d064abeb96972c34b550b6ec0b877c1 Author: Mryange <59914473+mrya...@users.noreply.github.com> AuthorDate: Mon Oct 21 10:09:01 2024 +0800 [env](compile) open compile check in some file (#41940) open compile check in some file --- be/src/common/compile_check_begin.h | 6 +++--- be/src/common/compile_check_end.h | 2 -- be/src/pipeline/exec/aggregation_sink_operator.h | 3 ++- be/src/pipeline/exec/aggregation_source_operator.h | 3 ++- be/src/pipeline/exec/analytic_sink_operator.h | 3 ++- be/src/pipeline/exec/analytic_source_operator.h | 3 ++- be/src/pipeline/exec/assert_num_rows_operator.cpp | 2 +- be/src/pipeline/exec/cache_sink_operator.cpp | 2 +- be/src/pipeline/exec/cache_source_operator.cpp | 2 +- be/src/pipeline/exec/data_queue.cpp | 2 +- be/src/pipeline/exec/datagen_operator.cpp | 2 +- .../distinct_streaming_aggregation_operator.cpp | 12 +++++------ .../exec/distinct_streaming_aggregation_operator.h | 3 ++- be/src/pipeline/exec/es_scan_operator.cpp | 2 +- be/src/pipeline/exec/exchange_source_operator.cpp | 2 +- be/src/pipeline/exec/file_scan_operator.cpp | 6 +++--- .../exec/group_commit_block_sink_operator.cpp | 4 ++-- .../pipeline/exec/group_commit_scan_operator.cpp | 2 +- be/src/pipeline/exec/hashjoin_build_sink.cpp | 2 +- be/src/pipeline/exec/hashjoin_build_sink.h | 7 ++++--- be/src/pipeline/exec/hashjoin_probe_operator.cpp | 4 ++-- be/src/pipeline/exec/hashjoin_probe_operator.h | 3 ++- be/src/pipeline/exec/hive_table_sink_operator.cpp | 2 +- .../pipeline/exec/iceberg_table_sink_operator.cpp | 2 +- be/src/pipeline/exec/jdbc_scan_operator.cpp | 2 +- be/src/pipeline/exec/jdbc_table_sink_operator.cpp | 2 +- be/src/pipeline/exec/join_build_sink_operator.cpp | 2 +- be/src/pipeline/exec/join_probe_operator.cpp | 2 +- .../pipeline/exec/memory_scratch_sink_operator.cpp | 2 +- be/src/pipeline/exec/meta_scan_operator.cpp | 2 +- .../pipeline/exec/multi_cast_data_stream_sink.cpp | 2 +- .../exec/multi_cast_data_stream_source.cpp | 2 +- .../pipeline/exec/multi_cast_data_stream_source.h | 2 ++ be/src/pipeline/exec/multi_cast_data_streamer.cpp | 2 +- .../exec/nested_loop_join_build_operator.cpp | 6 +++--- .../exec/nested_loop_join_probe_operator.cpp | 18 ++++++++++------- .../exec/nested_loop_join_probe_operator.h | 23 ++++++++++++++-------- be/src/vec/core/block.cpp | 2 +- be/src/vec/core/block.h | 2 +- 39 files changed, 85 insertions(+), 67 deletions(-) diff --git a/be/src/common/compile_check_begin.h b/be/src/common/compile_check_begin.h index 8f5358fb89c..d3b7f60439c 100644 --- a/be/src/common/compile_check_begin.h +++ b/be/src/common/compile_check_begin.h @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#pragma once - #ifdef __clang__ #pragma clang diagnostic push -#pragma clang diagnostic error "-Wshorten-64-to-32" +#pragma clang diagnostic error "-Wconversion" +#pragma clang diagnostic ignored "-Wsign-conversion" +#pragma clang diagnostic ignored "-Wfloat-conversion" #endif //#include "common/compile_check_begin.h" \ No newline at end of file diff --git a/be/src/common/compile_check_end.h b/be/src/common/compile_check_end.h index 491f41b6c27..6cba13c7f66 100644 --- a/be/src/common/compile_check_end.h +++ b/be/src/common/compile_check_end.h @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#pragma once - #ifdef __clang__ #pragma clang diagnostic pop #endif diff --git a/be/src/pipeline/exec/aggregation_sink_operator.h b/be/src/pipeline/exec/aggregation_sink_operator.h index 087ac05f9f2..1f846ec88ff 100644 --- a/be/src/pipeline/exec/aggregation_sink_operator.h +++ b/be/src/pipeline/exec/aggregation_sink_operator.h @@ -23,7 +23,7 @@ #include "runtime/exec_env.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" class AggSinkOperatorX; class AggSinkLocalState : public PipelineXSinkLocalState<AggSharedState> { @@ -209,3 +209,4 @@ protected: }; } // namespace doris::pipeline +#include "common/compile_check_end.h" diff --git a/be/src/pipeline/exec/aggregation_source_operator.h b/be/src/pipeline/exec/aggregation_source_operator.h index a3824a381eb..473a051ae35 100644 --- a/be/src/pipeline/exec/aggregation_source_operator.h +++ b/be/src/pipeline/exec/aggregation_source_operator.h @@ -25,7 +25,7 @@ namespace doris { class RuntimeState; namespace pipeline { - +#include "common/compile_check_begin.h" class AggSourceOperatorX; class AggLocalState final : public PipelineXLocalState<AggSharedState> { @@ -122,3 +122,4 @@ private: } // namespace pipeline } // namespace doris +#include "common/compile_check_end.h" diff --git a/be/src/pipeline/exec/analytic_sink_operator.h b/be/src/pipeline/exec/analytic_sink_operator.h index e961f31da28..1a0a671cf9f 100644 --- a/be/src/pipeline/exec/analytic_sink_operator.h +++ b/be/src/pipeline/exec/analytic_sink_operator.h @@ -24,7 +24,7 @@ #include "pipeline/dependency.h" namespace doris { - +#include "common/compile_check_begin.h" namespace pipeline { class AnalyticSinkOperatorX; @@ -114,3 +114,4 @@ private: } // namespace pipeline } // namespace doris +#include "common/compile_check_end.h" \ No newline at end of file diff --git a/be/src/pipeline/exec/analytic_source_operator.h b/be/src/pipeline/exec/analytic_source_operator.h index d8dafa875de..0080ad5e03c 100644 --- a/be/src/pipeline/exec/analytic_source_operator.h +++ b/be/src/pipeline/exec/analytic_source_operator.h @@ -26,7 +26,7 @@ namespace doris { class RuntimeState; namespace pipeline { - +#include "common/compile_check_begin.h" enum AnalyticFnScope { PARTITION, RANGE, ROWS }; class AnalyticSourceOperatorX; @@ -156,3 +156,4 @@ private: } // namespace pipeline } // namespace doris +#include "common/compile_check_end.h" \ No newline at end of file diff --git a/be/src/pipeline/exec/assert_num_rows_operator.cpp b/be/src/pipeline/exec/assert_num_rows_operator.cpp index 71688ff530d..c1a02b6f838 100644 --- a/be/src/pipeline/exec/assert_num_rows_operator.cpp +++ b/be/src/pipeline/exec/assert_num_rows_operator.cpp @@ -21,7 +21,7 @@ #include "vec/utils/util.hpp" namespace doris::pipeline { - +#include "common/compile_check_begin.h" AssertNumRowsOperatorX::AssertNumRowsOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id, const DescriptorTbl& descs) : StreamingOperatorX<AssertNumRowsLocalState>(pool, tnode, operator_id, descs), diff --git a/be/src/pipeline/exec/cache_sink_operator.cpp b/be/src/pipeline/exec/cache_sink_operator.cpp index b8b5b534659..b09921245bb 100644 --- a/be/src/pipeline/exec/cache_sink_operator.cpp +++ b/be/src/pipeline/exec/cache_sink_operator.cpp @@ -27,7 +27,7 @@ #include "util/runtime_profile.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" Status CacheSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& info) { RETURN_IF_ERROR(Base::init(state, info)); SCOPED_TIMER(exec_time_counter()); diff --git a/be/src/pipeline/exec/cache_source_operator.cpp b/be/src/pipeline/exec/cache_source_operator.cpp index 4f953dc225d..2e9b21976f8 100644 --- a/be/src/pipeline/exec/cache_source_operator.cpp +++ b/be/src/pipeline/exec/cache_source_operator.cpp @@ -29,7 +29,7 @@ namespace doris { class RuntimeState; namespace pipeline { - +#include "common/compile_check_begin.h" Status CacheSourceLocalState::init(RuntimeState* state, LocalStateInfo& info) { RETURN_IF_ERROR(Base::init(state, info)); SCOPED_TIMER(exec_time_counter()); diff --git a/be/src/pipeline/exec/data_queue.cpp b/be/src/pipeline/exec/data_queue.cpp index 20fae125e3b..436a98e6b03 100644 --- a/be/src/pipeline/exec/data_queue.cpp +++ b/be/src/pipeline/exec/data_queue.cpp @@ -29,7 +29,7 @@ namespace doris { namespace pipeline { - +#include "common/compile_check_begin.h" DataQueue::DataQueue(int child_count) : _queue_blocks_lock(child_count), _queue_blocks(child_count), diff --git a/be/src/pipeline/exec/datagen_operator.cpp b/be/src/pipeline/exec/datagen_operator.cpp index 93b3d058154..faa6359e874 100644 --- a/be/src/pipeline/exec/datagen_operator.cpp +++ b/be/src/pipeline/exec/datagen_operator.cpp @@ -30,7 +30,7 @@ class RuntimeState; } // namespace doris namespace doris::pipeline { - +#include "common/compile_check_begin.h" DataGenSourceOperatorX::DataGenSourceOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id, const DescriptorTbl& descs) : OperatorX<DataGenLocalState>(pool, tnode, operator_id, descs), diff --git a/be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp b/be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp index ed4a39f10e2..540a7577826 100644 --- a/be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp +++ b/be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp @@ -31,7 +31,7 @@ class RuntimeState; } // namespace doris namespace doris::pipeline { - +#include "common/compile_check_begin.h" struct StreamingHtMinReductionEntry { // Use 'streaming_ht_min_reduction' if the total size of hash table bucket directories in // bytes is greater than this threshold. @@ -139,8 +139,8 @@ bool DistinctStreamingAggLocalState::_should_expand_preagg_hash_tables() { const int64_t aggregated_input_rows = input_rows - _num_rows_returned; // TODO chenhao // const int64_t expected_input_rows = estimated_input_cardinality_ - num_rows_returned_; - double current_reduction = - static_cast<double>(aggregated_input_rows) / ht_rows; + double current_reduction = static_cast<double>(aggregated_input_rows) / + static_cast<double>(ht_rows); // TODO: workaround for IMPALA-2490: subplan node rows_returned counter may be // inaccurate, which could lead to a divide by zero below. @@ -198,7 +198,7 @@ Status DistinctStreamingAggLocalState::_distinct_pre_agg_with_serialized_key( } } - int rows = in_block->rows(); + size_t rows = in_block->rows(); _distinct_row.clear(); _distinct_row.reserve(rows); @@ -376,8 +376,8 @@ Status DistinctStreamingAggOperatorX::open(RuntimeState* state) { DCHECK_EQ(_intermediate_tuple_desc->slots().size(), _output_tuple_desc->slots().size()); RETURN_IF_ERROR(vectorized::VExpr::prepare(_probe_expr_ctxs, state, _child->row_desc())); - int j = _probe_expr_ctxs.size(); - for (int i = 0; i < j; ++i) { + size_t j = _probe_expr_ctxs.size(); + for (size_t i = 0; i < j; ++i) { auto nullable_output = _output_tuple_desc->slots()[i]->is_nullable(); auto nullable_input = _probe_expr_ctxs[i]->root()->is_nullable(); if (nullable_output != nullable_input) { diff --git a/be/src/pipeline/exec/distinct_streaming_aggregation_operator.h b/be/src/pipeline/exec/distinct_streaming_aggregation_operator.h index edeb4321763..99e45e10711 100644 --- a/be/src/pipeline/exec/distinct_streaming_aggregation_operator.h +++ b/be/src/pipeline/exec/distinct_streaming_aggregation_operator.h @@ -32,7 +32,7 @@ class ExecNode; class RuntimeState; namespace pipeline { - +#include "common/compile_check_begin.h" class DistinctStreamingAggOperatorX; class DistinctStreamingAggLocalState final : public PipelineXLocalState<FakeSharedState> { @@ -140,3 +140,4 @@ private: } // namespace pipeline } // namespace doris +#include "common/compile_check_end.h" \ No newline at end of file diff --git a/be/src/pipeline/exec/es_scan_operator.cpp b/be/src/pipeline/exec/es_scan_operator.cpp index c7e953a7fa3..7b846e715f3 100644 --- a/be/src/pipeline/exec/es_scan_operator.cpp +++ b/be/src/pipeline/exec/es_scan_operator.cpp @@ -22,7 +22,7 @@ #include "vec/exec/scan/new_es_scanner.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" // Prefer to the local host static std::string get_host_and_port(const std::vector<doris::TNetworkAddress>& es_hosts) { std::string host_port; diff --git a/be/src/pipeline/exec/exchange_source_operator.cpp b/be/src/pipeline/exec/exchange_source_operator.cpp index ca5194e7077..666f9465cf2 100644 --- a/be/src/pipeline/exec/exchange_source_operator.cpp +++ b/be/src/pipeline/exec/exchange_source_operator.cpp @@ -29,7 +29,7 @@ #include "vec/runtime/vdata_stream_recvr.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" ExchangeLocalState::ExchangeLocalState(RuntimeState* state, OperatorXBase* parent) : Base(state, parent), num_rows_skipped(0), is_ready(false) {} diff --git a/be/src/pipeline/exec/file_scan_operator.cpp b/be/src/pipeline/exec/file_scan_operator.cpp index 6fa7401e278..7afbb29134c 100644 --- a/be/src/pipeline/exec/file_scan_operator.cpp +++ b/be/src/pipeline/exec/file_scan_operator.cpp @@ -29,7 +29,7 @@ #include "vec/exec/scan/vfile_scanner.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" Status FileScanLocalState::_init_scanners(std::list<vectorized::VScannerSPtr>* scanners) { if (_split_source->num_scan_ranges() == 0) { _eos = true; @@ -37,10 +37,10 @@ Status FileScanLocalState::_init_scanners(std::list<vectorized::VScannerSPtr>* s } auto& p = _parent->cast<FileScanOperatorX>(); - size_t shard_num = std::min<size_t>( + uint32_t shard_num = std::min( config::doris_scanner_thread_pool_thread_num / state()->query_parallel_instance_num(), _max_scanners); - shard_num = std::max(shard_num, (size_t)1); + shard_num = std::max(shard_num, 1U); _kv_cache.reset(new vectorized::ShardedKVCache(shard_num)); for (int i = 0; i < _max_scanners; ++i) { std::unique_ptr<vectorized::VFileScanner> scanner = vectorized::VFileScanner::create_unique( diff --git a/be/src/pipeline/exec/group_commit_block_sink_operator.cpp b/be/src/pipeline/exec/group_commit_block_sink_operator.cpp index a8d5145d90d..e0171b41ab1 100644 --- a/be/src/pipeline/exec/group_commit_block_sink_operator.cpp +++ b/be/src/pipeline/exec/group_commit_block_sink_operator.cpp @@ -23,7 +23,7 @@ #include "vec/sink/vtablet_block_convertor.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" GroupCommitBlockSinkLocalState::~GroupCommitBlockSinkLocalState() { if (_load_block_queue) { _remove_estimated_wal_bytes(); @@ -293,7 +293,7 @@ Status GroupCommitBlockSinkOperatorX::sink(RuntimeState* state, vectorized::Bloc int64_t num_selected_rows = state->num_rows_load_total() - state->num_rows_load_unselected(); if (num_selected_rows > 0 && - (double)state->num_rows_load_filtered() / num_selected_rows > + (double)state->num_rows_load_filtered() / (double)num_selected_rows > _max_filter_ratio) { return Status::DataQualityError("too many filtered rows"); } diff --git a/be/src/pipeline/exec/group_commit_scan_operator.cpp b/be/src/pipeline/exec/group_commit_scan_operator.cpp index 3e6ad62c5dc..9577639813a 100644 --- a/be/src/pipeline/exec/group_commit_scan_operator.cpp +++ b/be/src/pipeline/exec/group_commit_scan_operator.cpp @@ -20,7 +20,7 @@ #include <fmt/format.h> namespace doris::pipeline { - +#include "common/compile_check_begin.h" GroupCommitOperatorX::GroupCommitOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id, const DescriptorTbl& descs, int parallel_tasks) diff --git a/be/src/pipeline/exec/hashjoin_build_sink.cpp b/be/src/pipeline/exec/hashjoin_build_sink.cpp index 5b946326fbc..b2925800112 100644 --- a/be/src/pipeline/exec/hashjoin_build_sink.cpp +++ b/be/src/pipeline/exec/hashjoin_build_sink.cpp @@ -27,7 +27,7 @@ #include "vec/utils/template_helpers.hpp" namespace doris::pipeline { - +#include "common/compile_check_begin.h" HashJoinBuildSinkLocalState::HashJoinBuildSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state) : JoinBuildSinkLocalState(parent, state) { diff --git a/be/src/pipeline/exec/hashjoin_build_sink.h b/be/src/pipeline/exec/hashjoin_build_sink.h index 2b0390d7596..fc1745af30e 100644 --- a/be/src/pipeline/exec/hashjoin_build_sink.h +++ b/be/src/pipeline/exec/hashjoin_build_sink.h @@ -22,7 +22,7 @@ #include "operator.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" class HashJoinBuildSinkOperatorX; class HashJoinBuildSinkLocalState final @@ -179,7 +179,7 @@ private: template <class HashTableContext> struct ProcessHashTableBuild { - ProcessHashTableBuild(int rows, vectorized::ColumnRawPtrs& build_raw_ptrs, + ProcessHashTableBuild(size_t rows, vectorized::ColumnRawPtrs& build_raw_ptrs, HashJoinBuildSinkLocalState* parent, int batch_size, RuntimeState* state) : _rows(rows), _build_raw_ptrs(build_raw_ptrs), @@ -223,7 +223,7 @@ struct ProcessHashTableBuild { } private: - const uint32_t _rows; + const size_t _rows; vectorized::ColumnRawPtrs& _build_raw_ptrs; HashJoinBuildSinkLocalState* _parent = nullptr; int _batch_size; @@ -231,3 +231,4 @@ private: }; } // namespace doris::pipeline +#include "common/compile_check_end.h" \ No newline at end of file diff --git a/be/src/pipeline/exec/hashjoin_probe_operator.cpp b/be/src/pipeline/exec/hashjoin_probe_operator.cpp index fc1b1cccb1c..45660439d5c 100644 --- a/be/src/pipeline/exec/hashjoin_probe_operator.cpp +++ b/be/src/pipeline/exec/hashjoin_probe_operator.cpp @@ -26,7 +26,7 @@ #include "vec/data_types/data_type_nullable.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" HashJoinProbeLocalState::HashJoinProbeLocalState(RuntimeState* state, OperatorXBase* parent) : JoinProbeLocalState<HashJoinSharedState, HashJoinProbeLocalState>(state, parent), _process_hashtable_ctx_variants(std::make_unique<HashTableCtxVariants>()) {} @@ -645,7 +645,7 @@ Status HashJoinProbeOperatorX::open(RuntimeState* state) { } } - const int right_col_idx = + const size_t right_col_idx = (_is_right_semi_anti && !_have_other_join_conjunct) ? 0 : _left_table_data_types.size(); size_t idx = 0; for (const auto* slot : slots_to_check) { diff --git a/be/src/pipeline/exec/hashjoin_probe_operator.h b/be/src/pipeline/exec/hashjoin_probe_operator.h index dde9c00dfe4..917c2692b44 100644 --- a/be/src/pipeline/exec/hashjoin_probe_operator.h +++ b/be/src/pipeline/exec/hashjoin_probe_operator.h @@ -26,7 +26,7 @@ namespace doris { class RuntimeState; namespace pipeline { - +#include "common/compile_check_begin.h" class HashJoinProbeLocalState; using HashTableCtxVariants = @@ -194,3 +194,4 @@ private: } // namespace pipeline } // namespace doris +#include "common/compile_check_end.h" \ No newline at end of file diff --git a/be/src/pipeline/exec/hive_table_sink_operator.cpp b/be/src/pipeline/exec/hive_table_sink_operator.cpp index f7cb31eea5e..314df2bf066 100644 --- a/be/src/pipeline/exec/hive_table_sink_operator.cpp +++ b/be/src/pipeline/exec/hive_table_sink_operator.cpp @@ -20,7 +20,7 @@ #include "common/status.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" Status HiveTableSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& info) { RETURN_IF_ERROR(Base::init(state, info)); SCOPED_TIMER(exec_time_counter()); diff --git a/be/src/pipeline/exec/iceberg_table_sink_operator.cpp b/be/src/pipeline/exec/iceberg_table_sink_operator.cpp index 44bde4e8812..9f59ff040a5 100644 --- a/be/src/pipeline/exec/iceberg_table_sink_operator.cpp +++ b/be/src/pipeline/exec/iceberg_table_sink_operator.cpp @@ -20,7 +20,7 @@ #include "common/status.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" Status IcebergTableSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& info) { RETURN_IF_ERROR(Base::init(state, info)); SCOPED_TIMER(exec_time_counter()); diff --git a/be/src/pipeline/exec/jdbc_scan_operator.cpp b/be/src/pipeline/exec/jdbc_scan_operator.cpp index 54f76396343..58198055e17 100644 --- a/be/src/pipeline/exec/jdbc_scan_operator.cpp +++ b/be/src/pipeline/exec/jdbc_scan_operator.cpp @@ -21,7 +21,7 @@ #include "vec/exec/scan/new_jdbc_scanner.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" std::string JDBCScanLocalState::name_suffix() const { return fmt::format(" (id={}. nereids_id={} . table name = {})", std::to_string(_parent->node_id()), std::to_string(_parent->nereids_id()), diff --git a/be/src/pipeline/exec/jdbc_table_sink_operator.cpp b/be/src/pipeline/exec/jdbc_table_sink_operator.cpp index dba9f6259ff..10fd0d8e40b 100644 --- a/be/src/pipeline/exec/jdbc_table_sink_operator.cpp +++ b/be/src/pipeline/exec/jdbc_table_sink_operator.cpp @@ -25,7 +25,7 @@ #include "vec/exprs/vexpr_context.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" JdbcTableSinkOperatorX::JdbcTableSinkOperatorX(const RowDescriptor& row_desc, int operator_id, const std::vector<TExpr>& t_output_expr) : DataSinkOperatorX(operator_id, 0), _row_desc(row_desc), _t_output_expr(t_output_expr) {} diff --git a/be/src/pipeline/exec/join_build_sink_operator.cpp b/be/src/pipeline/exec/join_build_sink_operator.cpp index 2439dbc8fe1..a1f3262d6ed 100644 --- a/be/src/pipeline/exec/join_build_sink_operator.cpp +++ b/be/src/pipeline/exec/join_build_sink_operator.cpp @@ -23,7 +23,7 @@ #include "pipeline/exec/partitioned_hash_join_sink_operator.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" template <typename SharedStateArg, typename Derived> Status JoinBuildSinkLocalState<SharedStateArg, Derived>::init(RuntimeState* state, LocalSinkStateInfo& info) { diff --git a/be/src/pipeline/exec/join_probe_operator.cpp b/be/src/pipeline/exec/join_probe_operator.cpp index 05c62544d2b..8e5010d7513 100644 --- a/be/src/pipeline/exec/join_probe_operator.cpp +++ b/be/src/pipeline/exec/join_probe_operator.cpp @@ -23,7 +23,7 @@ #include "pipeline/exec/partitioned_hash_join_probe_operator.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" template <typename SharedStateArg, typename Derived> Status JoinProbeLocalState<SharedStateArg, Derived>::init(RuntimeState* state, LocalStateInfo& info) { diff --git a/be/src/pipeline/exec/memory_scratch_sink_operator.cpp b/be/src/pipeline/exec/memory_scratch_sink_operator.cpp index 8f721bb8645..a0ff65d6c75 100644 --- a/be/src/pipeline/exec/memory_scratch_sink_operator.cpp +++ b/be/src/pipeline/exec/memory_scratch_sink_operator.cpp @@ -28,7 +28,7 @@ #include "vec/exprs/vexpr_context.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" Status MemoryScratchSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& info) { RETURN_IF_ERROR(Base::init(state, info)); SCOPED_TIMER(exec_time_counter()); diff --git a/be/src/pipeline/exec/meta_scan_operator.cpp b/be/src/pipeline/exec/meta_scan_operator.cpp index 0ff8a7337bb..1d7e40afedc 100644 --- a/be/src/pipeline/exec/meta_scan_operator.cpp +++ b/be/src/pipeline/exec/meta_scan_operator.cpp @@ -20,7 +20,7 @@ #include "vec/exec/scan/vmeta_scanner.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" Status MetaScanLocalState::_init_scanners(std::list<vectorized::VScannerSPtr>* scanners) { if (Base::_eos) { return Status::OK(); diff --git a/be/src/pipeline/exec/multi_cast_data_stream_sink.cpp b/be/src/pipeline/exec/multi_cast_data_stream_sink.cpp index d0827c2ca18..eb72e9601e1 100644 --- a/be/src/pipeline/exec/multi_cast_data_stream_sink.cpp +++ b/be/src/pipeline/exec/multi_cast_data_stream_sink.cpp @@ -21,7 +21,7 @@ #include "pipeline/exec/multi_cast_data_streamer.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" std::string MultiCastDataStreamSinkLocalState::name_suffix() { auto& sinks = static_cast<MultiCastDataStreamSinkOperatorX*>(_parent)->sink_node().sinks; std::string id_name = " (dst id : "; diff --git a/be/src/pipeline/exec/multi_cast_data_stream_source.cpp b/be/src/pipeline/exec/multi_cast_data_stream_source.cpp index 49dc384a4e7..71204f1285c 100644 --- a/be/src/pipeline/exec/multi_cast_data_stream_source.cpp +++ b/be/src/pipeline/exec/multi_cast_data_stream_source.cpp @@ -24,7 +24,7 @@ #include "vec/core/materialize_block.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" MultiCastDataStreamSourceLocalState::MultiCastDataStreamSourceLocalState(RuntimeState* state, OperatorXBase* parent) : Base(state, parent), diff --git a/be/src/pipeline/exec/multi_cast_data_stream_source.h b/be/src/pipeline/exec/multi_cast_data_stream_source.h index 76472f3ce85..2059f706cad 100644 --- a/be/src/pipeline/exec/multi_cast_data_stream_source.h +++ b/be/src/pipeline/exec/multi_cast_data_stream_source.h @@ -33,6 +33,7 @@ class Block; } // namespace vectorized namespace pipeline { +#include "common/compile_check_begin.h" class MultiCastDataStreamer; class MultiCastDataStreamerSourceOperatorX; @@ -137,3 +138,4 @@ private: } // namespace pipeline } // namespace doris +#include "common/compile_check_end.h" \ No newline at end of file diff --git a/be/src/pipeline/exec/multi_cast_data_streamer.cpp b/be/src/pipeline/exec/multi_cast_data_streamer.cpp index d44cf3974a6..3e629093e23 100644 --- a/be/src/pipeline/exec/multi_cast_data_streamer.cpp +++ b/be/src/pipeline/exec/multi_cast_data_streamer.cpp @@ -22,7 +22,7 @@ #include "runtime/runtime_state.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" MultiCastBlock::MultiCastBlock(vectorized::Block* block, int used_count, int un_finish_copy, size_t mem_size) : _used_count(used_count), _un_finish_copy(un_finish_copy), _mem_size(mem_size) { diff --git a/be/src/pipeline/exec/nested_loop_join_build_operator.cpp b/be/src/pipeline/exec/nested_loop_join_build_operator.cpp index 793a37c7396..59020a5df43 100644 --- a/be/src/pipeline/exec/nested_loop_join_build_operator.cpp +++ b/be/src/pipeline/exec/nested_loop_join_build_operator.cpp @@ -23,7 +23,7 @@ #include "pipeline/exec/operator.h" namespace doris::pipeline { - +#include "common/compile_check_begin.h" struct RuntimeFilterBuild { RuntimeFilterBuild(NestedLoopJoinBuildSinkLocalState* parent) : _parent(parent) {} Status operator()(RuntimeState* state) { @@ -109,9 +109,9 @@ Status NestedLoopJoinBuildSinkOperatorX::init(const TPlanNode& tnode, RuntimeSta Status NestedLoopJoinBuildSinkOperatorX::open(RuntimeState* state) { RETURN_IF_ERROR(JoinBuildSinkOperatorX<NestedLoopJoinBuildSinkLocalState>::open(state)); - int num_build_tuples = _child->row_desc().tuple_descriptors().size(); + size_t num_build_tuples = _child->row_desc().tuple_descriptors().size(); - for (int i = 0; i < num_build_tuples; ++i) { + for (size_t i = 0; i < num_build_tuples; ++i) { TupleDescriptor* build_tuple_desc = _child->row_desc().tuple_descriptors()[i]; auto tuple_idx = _row_descriptor.get_tuple_idx(build_tuple_desc->id()); RETURN_IF_INVALID_TUPLE_IDX(build_tuple_desc->id(), tuple_idx); diff --git a/be/src/pipeline/exec/nested_loop_join_probe_operator.cpp b/be/src/pipeline/exec/nested_loop_join_probe_operator.cpp index fe8ff268018..d0fb4ee19a5 100644 --- a/be/src/pipeline/exec/nested_loop_join_probe_operator.cpp +++ b/be/src/pipeline/exec/nested_loop_join_probe_operator.cpp @@ -19,6 +19,7 @@ #include <memory> +#include "common/cast_set.h" #include "common/exception.h" #include "pipeline/exec/operator.h" #include "vec/columns/column_filter_helper.h" @@ -29,7 +30,7 @@ class RuntimeState; } // namespace doris namespace doris::pipeline { - +#include "common/compile_check_begin.h" NestedLoopJoinProbeLocalState::NestedLoopJoinProbeLocalState(RuntimeState* state, OperatorXBase* parent) : JoinProbeLocalState<NestedLoopJoinSharedState, NestedLoopJoinProbeLocalState>(state, @@ -129,6 +130,8 @@ Status NestedLoopJoinProbeLocalState::generate_join_block_data(RuntimeState* sta if (!_matched_rows_done && !_need_more_input_data) { // We should try to join rows if there still are some rows from probe side. + // _probe_offset_stack and _build_offset_stack use u16 for storage + // because on the FE side, it is guaranteed that the batch size will not exceed 65535 (the maximum value for u16).s while (_join_block.rows() < state->batch_size()) { while (_current_build_pos == _shared_state->build_blocks.size() || _left_block_pos == _child_block->rows()) { @@ -140,7 +143,8 @@ Status NestedLoopJoinProbeLocalState::generate_join_block_data(RuntimeState* sta _reset_with_next_probe_row(); if (_left_block_pos < _child_block->rows()) { if constexpr (set_probe_side_flag) { - _probe_offset_stack.push(_join_block.rows()); + _probe_offset_stack.push( + cast_set<uint16_t, size_t, false>(_join_block.rows())); } } else { if (_shared_state->left_side_eos) { @@ -159,7 +163,7 @@ Status NestedLoopJoinProbeLocalState::generate_join_block_data(RuntimeState* sta const auto& now_process_build_block = _shared_state->build_blocks[_current_build_pos++]; if constexpr (set_build_side_flag) { - _build_offset_stack.push(_join_block.rows()); + _build_offset_stack.push(cast_set<uint16_t, size_t, false>(_join_block.rows())); } _process_left_child_block(_join_block, now_process_build_block); } @@ -202,8 +206,8 @@ Status NestedLoopJoinProbeLocalState::generate_join_block_data(RuntimeState* sta } void NestedLoopJoinProbeLocalState::_resize_fill_tuple_is_null_column(size_t new_size, - int left_flag, - int right_flag) { + uint8_t left_flag, + uint8_t right_flag) { auto& p = _parent->cast<NestedLoopJoinProbeOperatorX>(); if (p._is_outer_join) { reinterpret_cast<vectorized::ColumnUInt8*>(_tuple_is_null_left_flag_column.get()) @@ -237,7 +241,7 @@ void NestedLoopJoinProbeLocalState::_finalize_current_phase(vectorized::Block& b std::vector<uint32_t> selector(num_rows); size_t selector_idx = 0; - for (size_t j = 0; j < num_rows; j++) { + for (uint32_t j = 0; j < num_rows; j++) { if constexpr (IsSemi) { if (cur_visited_flags[j]) { selector[selector_idx++] = j; @@ -375,7 +379,7 @@ void NestedLoopJoinProbeLocalState::_process_left_child_block( vectorized::Block& block, const vectorized::Block& now_process_build_block) const { auto& p = _parent->cast<NestedLoopJoinProbeOperatorX>(); auto dst_columns = block.mutate_columns(); - const int max_added_rows = now_process_build_block.rows(); + const size_t max_added_rows = now_process_build_block.rows(); for (size_t i = 0; i < p._num_probe_side_columns; ++i) { const vectorized::ColumnWithTypeAndName& src_column = _child_block->get_by_position(i); if (!src_column.column->is_nullable() && dst_columns[i]->is_nullable()) { diff --git a/be/src/pipeline/exec/nested_loop_join_probe_operator.h b/be/src/pipeline/exec/nested_loop_join_probe_operator.h index f46a99306a5..4121de64210 100644 --- a/be/src/pipeline/exec/nested_loop_join_probe_operator.h +++ b/be/src/pipeline/exec/nested_loop_join_probe_operator.h @@ -19,6 +19,9 @@ #include <stdint.h> +#include <cstdint> + +#include "common/cast_set.h" #include "common/status.h" #include "operator.h" #include "pipeline/exec/join_probe_operator.h" @@ -28,7 +31,7 @@ namespace doris { class RuntimeState; namespace pipeline { - +#include "common/compile_check_begin.h" class NestedLoopJoinProbeOperatorX; class NestedLoopJoinProbeLocalState final : public JoinProbeLocalState<NestedLoopJoinSharedState, NestedLoopJoinProbeLocalState> { @@ -54,15 +57,17 @@ private: void _update_additional_flags(vectorized::Block* block); template <bool BuildSide, bool IsSemi> void _finalize_current_phase(vectorized::Block& block, size_t batch_size); - void _resize_fill_tuple_is_null_column(size_t new_size, int left_flag, int right_flag); + void _resize_fill_tuple_is_null_column(size_t new_size, uint8_t left_flag, uint8_t right_flag); void _reset_with_next_probe_row(); void _append_left_data_with_null(vectorized::Block& block) const; void _process_left_child_block(vectorized::Block& block, const vectorized::Block& now_process_build_block) const; template <typename Filter, bool SetBuildSideFlag, bool SetProbeSideFlag> - void _do_filtering_and_update_visited_flags_impl(vectorized::Block* block, int column_to_keep, - int build_block_idx, int processed_blocks_num, - bool materialize, Filter& filter) { + void _do_filtering_and_update_visited_flags_impl(vectorized::Block* block, + uint32_t column_to_keep, + size_t build_block_idx, + size_t processed_blocks_num, bool materialize, + Filter& filter) { if constexpr (SetBuildSideFlag) { for (size_t i = 0; i < processed_blocks_num; i++) { auto& build_side_flag = @@ -81,11 +86,11 @@ private: } } if constexpr (SetProbeSideFlag) { - int end = filter.size(); + int64_t end = filter.size(); for (int i = _left_block_pos == _child_block->rows() ? _left_block_pos - 1 : _left_block_pos; i >= _left_block_start_pos; i--) { - int offset = 0; + int64_t offset = 0; if (!_probe_offset_stack.empty()) { offset = _probe_offset_stack.top(); _probe_offset_stack.pop(); @@ -108,7 +113,8 @@ private: // need exception safety template <bool SetBuildSideFlag, bool SetProbeSideFlag, bool IgnoreNull> Status _do_filtering_and_update_visited_flags(vectorized::Block* block, bool materialize) { - auto column_to_keep = block->columns(); + // The number of columns will not exceed the range of u32. + uint32_t column_to_keep = cast_set<uint32_t>(block->columns()); // If we need to set visited flags for build side, // 1. Execute conjuncts and get a column with bool type to do filtering. // 2. Use bool column to update build-side visited flags. @@ -222,3 +228,4 @@ private: } // namespace pipeline } // namespace doris +#include "common/compile_check_end.h" \ No newline at end of file diff --git a/be/src/vec/core/block.cpp b/be/src/vec/core/block.cpp index 2e54bd76fff..2eb06e3c6a5 100644 --- a/be/src/vec/core/block.cpp +++ b/be/src/vec/core/block.cpp @@ -726,7 +726,7 @@ std::string Block::print_use_count() { return ss.str(); } -void Block::clear_column_data(int column_size) noexcept { +void Block::clear_column_data(int64_t column_size) noexcept { SCOPED_SKIP_MEMORY_CHECK(); // data.size() greater than column_size, means here have some // function exec result in block, need erase it here diff --git a/be/src/vec/core/block.h b/be/src/vec/core/block.h index f1804601693..bbcdd9472ae 100644 --- a/be/src/vec/core/block.h +++ b/be/src/vec/core/block.h @@ -247,7 +247,7 @@ public: // Default column size = -1 means clear all column in block // Else clear column [0, column_size) delete column [column_size, data.size) - void clear_column_data(int column_size = -1) noexcept; + void clear_column_data(int64_t column_size = -1) noexcept; bool mem_reuse() { return !data.empty(); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org