diff --git a/be/src/agent/task_worker_pool.cpp b/be/src/agent/task_worker_pool.cpp index dc0f4510df..d80a49bdbb 100644 --- a/be/src/agent/task_worker_pool.cpp +++ b/be/src/agent/task_worker_pool.cpp @@ -221,10 +221,10 @@ void TaskWorkerPool::start() { CHECK(_thread_model == ThreadModel::MULTI_THREADS || _worker_count == 1); #ifndef BE_TEST - ThreadPoolBuilder(_name) - .set_min_threads(_worker_count) - .set_max_threads(_worker_count) - .build(&_thread_pool); + static_cast(ThreadPoolBuilder(_name) + .set_min_threads(_worker_count) + .set_max_threads(_worker_count) + .build(&_thread_pool)); for (int i = 0; i < _worker_count; i++) { auto st = _thread_pool->submit_func(_cb); @@ -663,7 +663,8 @@ void TaskWorkerPool::_report_disk_state_worker_thread_callback() { request.__isset.disks = true; std::vector data_dir_infos; - StorageEngine::instance()->get_all_data_dir_info(&data_dir_infos, true /* update */); + static_cast(StorageEngine::instance()->get_all_data_dir_info(&data_dir_infos, + true /* update */)); for (auto& root_path_info : data_dir_infos) { TDisk disk; @@ -720,8 +721,9 @@ void TaskWorkerPool::_report_tablet_worker_thread_callback() { request.__isset.tablets = true; uint64_t report_version = _s_report_version; - StorageEngine::instance()->tablet_manager()->build_all_report_tablets_info( - &request.tablets); + static_cast( + StorageEngine::instance()->tablet_manager()->build_all_report_tablets_info( + &request.tablets)); if (report_version < _s_report_version) { // TODO llj This can only reduce the possibility for report error, but can't avoid it. // If FE create a tablet in FE meta and send CREATE task to this BE, the tablet may not be included in this @@ -1597,8 +1599,8 @@ void PublishVersionTaskPool::_publish_version_worker_thread_callback() { if (tablet != nullptr) { tablet->publised_count++; if (tablet->publised_count % 10 == 0) { - StorageEngine::instance()->submit_compaction_task( - tablet, CompactionType::CUMULATIVE_COMPACTION, true); + static_cast(StorageEngine::instance()->submit_compaction_task( + tablet, CompactionType::CUMULATIVE_COMPACTION, true)); LOG(INFO) << "trigger compaction succ, tablet_id:" << tablet_id << ", publised:" << tablet->publised_count; } diff --git a/be/src/agent/user_resource_listener.cpp b/be/src/agent/user_resource_listener.cpp index 95851549a4..6a73edf6db 100644 --- a/be/src/agent/user_resource_listener.cpp +++ b/be/src/agent/user_resource_listener.cpp @@ -95,7 +95,7 @@ void UserResourceListener::update_users_resource(int64_t new_version) { } } catch (TException& e) { // Already try twice, log here - client.reopen(config::thrift_rpc_timeout_ms); + static_cast(client.reopen(config::thrift_rpc_timeout_ms)); LOG(WARNING) << "retry to fetchResource from " << _master_info.network_address.hostname << ":" << _master_info.network_address.port << " failed:\n" << e.what(); diff --git a/be/src/agent/utils.cpp b/be/src/agent/utils.cpp index 19792fd1f8..2c98a6906b 100644 --- a/be/src/agent/utils.cpp +++ b/be/src/agent/utils.cpp @@ -102,7 +102,7 @@ Status MasterServerClient::finish_task(const TFinishTaskRequest& request, TMaste client->finishTask(*result, request); } } catch (std::exception& e) { - client.reopen(config::thrift_rpc_timeout_ms); + static_cast(client.reopen(config::thrift_rpc_timeout_ms)); LOG(WARNING) << "fail to finish_task. " << "host=" << _master_info.network_address.hostname << ", port=" << _master_info.network_address.port << ", error=" << e.what(); @@ -152,7 +152,7 @@ Status MasterServerClient::report(const TReportRequest& request, TMasterResult* } } } catch (std::exception& e) { - client.reopen(config::thrift_rpc_timeout_ms); + static_cast(client.reopen(config::thrift_rpc_timeout_ms)); LOG(WARNING) << "fail to report to master. " << "host=" << _master_info.network_address.hostname << ", port=" << _master_info.network_address.port @@ -203,7 +203,7 @@ Status MasterServerClient::confirm_unused_remote_files( } } } catch (std::exception& e) { - client.reopen(config::thrift_rpc_timeout_ms); + static_cast(client.reopen(config::thrift_rpc_timeout_ms)); return Status::InternalError( "fail to confirm unused remote files. host={}, port={}, code={}, reason={}", _master_info.network_address.hostname, _master_info.network_address.port, diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index e8632d47d9..9b4140bc29 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -1526,9 +1526,12 @@ Status set_fuzzy_config(const std::string& field, const std::string& value) { void set_fuzzy_configs() { // random value true or false - set_fuzzy_config("disable_storage_page_cache", ((rand() % 2) == 0) ? "true" : "false"); - set_fuzzy_config("enable_system_metrics", ((rand() % 2) == 0) ? "true" : "false"); - set_fuzzy_config("enable_simdjson_reader", ((rand() % 2) == 0) ? "true" : "false"); + static_cast( + set_fuzzy_config("disable_storage_page_cache", ((rand() % 2) == 0) ? "true" : "false")); + static_cast( + set_fuzzy_config("enable_system_metrics", ((rand() % 2) == 0) ? "true" : "false")); + static_cast( + set_fuzzy_config("enable_simdjson_reader", ((rand() % 2) == 0) ? "true" : "false")); // random value from 8 to 48 // s = set_fuzzy_config("doris_scanner_thread_pool_thread_num", std::to_string((rand() % 41) + 8)); // LOG(INFO) << s.to_string(); diff --git a/be/src/common/status.h b/be/src/common/status.h index 162d3b493b..c3beb942c8 100644 --- a/be/src/common/status.h +++ b/be/src/common/status.h @@ -322,7 +322,7 @@ constexpr bool capture_stacktrace(int code) { } // clang-format on -class Status { +class [[nodiscard]] Status { public: Status() : _code(ErrorCode::OK), _err_msg(nullptr) {} diff --git a/be/src/exec/es/es_scroll_parser.cpp b/be/src/exec/es/es_scroll_parser.cpp index 34397b8468..745be0b50c 100644 --- a/be/src/exec/es/es_scroll_parser.cpp +++ b/be/src/exec/es/es_scroll_parser.cpp @@ -526,39 +526,44 @@ Status ScrollParser::fill_columns(const TupleDescriptor* tuple_desc, } case TYPE_TINYINT: { - insert_int_value(col, type, col_ptr, pure_doc_value, slot_desc->is_nullable()); + static_cast(insert_int_value(col, type, col_ptr, pure_doc_value, + slot_desc->is_nullable())); break; } case TYPE_SMALLINT: { - insert_int_value(col, type, col_ptr, pure_doc_value, slot_desc->is_nullable()); + static_cast(insert_int_value(col, type, col_ptr, pure_doc_value, + slot_desc->is_nullable())); break; } case TYPE_INT: { - insert_int_value(col, type, col_ptr, pure_doc_value, slot_desc->is_nullable()); + static_cast(insert_int_value(col, type, col_ptr, pure_doc_value, + slot_desc->is_nullable())); break; } case TYPE_BIGINT: { - insert_int_value(col, type, col_ptr, pure_doc_value, slot_desc->is_nullable()); + static_cast(insert_int_value(col, type, col_ptr, pure_doc_value, + slot_desc->is_nullable())); break; } case TYPE_LARGEINT: { - insert_int_value<__int128>(col, type, col_ptr, pure_doc_value, - slot_desc->is_nullable()); + static_cast(insert_int_value<__int128>(col, type, col_ptr, pure_doc_value, + slot_desc->is_nullable())); break; } case TYPE_DOUBLE: { - insert_float_value(col, type, col_ptr, pure_doc_value, - slot_desc->is_nullable()); + static_cast(insert_float_value(col, type, col_ptr, pure_doc_value, + slot_desc->is_nullable())); break; } case TYPE_FLOAT: { - insert_float_value(col, type, col_ptr, pure_doc_value, slot_desc->is_nullable()); + static_cast(insert_float_value(col, type, col_ptr, pure_doc_value, + slot_desc->is_nullable())); break; } diff --git a/be/src/exec/odbc_connector.cpp b/be/src/exec/odbc_connector.cpp index 25ce819ca3..efeb779f2c 100644 --- a/be/src/exec/odbc_connector.cpp +++ b/be/src/exec/odbc_connector.cpp @@ -24,6 +24,7 @@ #include +#include "common/status.h" #include "runtime/define_primitive_type.h" #include "runtime/descriptors.h" #include "runtime/types.h" @@ -61,7 +62,7 @@ ODBCConnector::ODBCConnector(const ODBCConnectorParam& param) Status ODBCConnector::close(Status) { // do not commit transaction, roll back if (_is_in_transaction) { - abort_trans(); + static_cast(abort_trans()); } if (_stmt != nullptr) { @@ -150,7 +151,7 @@ Status ODBCConnector::open(RuntimeState* state, bool read) { LOG(INFO) << "connect success:" << _connect_string.substr(0, _connect_string.find("Pwd=")); _is_open = true; - begin_trans(); + static_cast(begin_trans()); return Status::OK(); } diff --git a/be/src/exec/olap_common.h b/be/src/exec/olap_common.h index 7a58645b74..6ef0edd7a3 100644 --- a/be/src/exec/olap_common.h +++ b/be/src/exec/olap_common.h @@ -367,7 +367,7 @@ public: int scale() const { return _scale; } static void add_fixed_value_range(ColumnValueRange& range, CppType* value) { - range.add_fixed_value(*value); + static_cast(range.add_fixed_value(*value)); } static void remove_fixed_value_range(ColumnValueRange& range, CppType* value) { @@ -376,17 +376,17 @@ public: static void add_value_range(ColumnValueRange& range, SQLFilterOp op, CppType* value) { - range.add_range(op, *value); + static_cast(range.add_range(op, *value)); } static void add_compound_value_range(ColumnValueRange& range, SQLFilterOp op, CppType* value) { - range.add_compound_value(op, *value); + static_cast(range.add_compound_value(op, *value)); } static void add_match_value_range(ColumnValueRange& range, MatchType match_type, CppType* match_value) { - range.add_match_value(match_type, *match_value); + static_cast(range.add_match_value(match_type, *match_value)); } static ColumnValueRange create_empty_column_value_range(bool is_nullable_col, @@ -904,7 +904,7 @@ Status ColumnValueRange::add_range(SQLFilterOp op, CppType value if (FILTER_LARGER_OR_EQUAL == _low_op && FILTER_LESS_OR_EQUAL == _high_op && _high_value == _low_value) { - add_fixed_value(_high_value); + static_cast(add_fixed_value(_high_value)); _high_value = TYPE_MIN; _low_value = TYPE_MAX; } @@ -1003,7 +1003,7 @@ void ColumnValueRange::intersection(ColumnValueRange(add_match_value(value.first, value.second)); } } else { set_empty_value_range(); @@ -1015,8 +1015,8 @@ void ColumnValueRange::intersection(ColumnValueRange(add_range(range._high_op, range._high_value)); + static_cast(add_range(range._low_op, range._low_value)); } } } diff --git a/be/src/exec/schema_scanner/schema_charsets_scanner.cpp b/be/src/exec/schema_scanner/schema_charsets_scanner.cpp index 4a801f50c1..200c2c1b0c 100644 --- a/be/src/exec/schema_scanner/schema_charsets_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_charsets_scanner.cpp @@ -74,7 +74,7 @@ Status SchemaCharsetsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(_s_charsets[i].charset, strlen(_s_charsets[i].charset)); datas[i] = strs + i; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } // DEFAULT_COLLATE_NAME { @@ -84,7 +84,7 @@ Status SchemaCharsetsScanner::_fill_block_impl(vectorized::Block* block) { strlen(_s_charsets[i].default_collation)); datas[i] = strs + i; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // DESCRIPTION { @@ -93,7 +93,7 @@ Status SchemaCharsetsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(_s_charsets[i].description, strlen(_s_charsets[i].description)); datas[i] = strs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // maxlen { @@ -102,7 +102,7 @@ Status SchemaCharsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i] = _s_charsets[i].maxlen; datas[i] = srcs + i; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_collations_scanner.cpp b/be/src/exec/schema_scanner/schema_collations_scanner.cpp index f63e7622b4..a5203a1ca6 100644 --- a/be/src/exec/schema_scanner/schema_collations_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_collations_scanner.cpp @@ -77,7 +77,7 @@ Status SchemaCollationsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(_s_collations[i].name, strlen(_s_collations[i].name)); datas[i] = strs + i; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } // charset { @@ -86,7 +86,7 @@ Status SchemaCollationsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(_s_collations[i].charset, strlen(_s_collations[i].charset)); datas[i] = strs + i; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // id { @@ -95,7 +95,7 @@ Status SchemaCollationsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i] = _s_collations[i].id; datas[i] = srcs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // is_default { @@ -104,7 +104,7 @@ Status SchemaCollationsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(_s_collations[i].is_default, strlen(_s_collations[i].is_default)); datas[i] = strs + i; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } // IS_COMPILED { @@ -113,7 +113,7 @@ Status SchemaCollationsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(_s_collations[i].is_compile, strlen(_s_collations[i].is_compile)); datas[i] = strs + i; } - fill_dest_column_for_range(block, 4, datas); + static_cast(fill_dest_column_for_range(block, 4, datas)); } // sortlen { @@ -122,7 +122,7 @@ Status SchemaCollationsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i] = _s_collations[i].sortlen; datas[i] = srcs + i; } - fill_dest_column_for_range(block, 5, datas); + static_cast(fill_dest_column_for_range(block, 5, datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_columns_scanner.cpp b/be/src/exec/schema_scanner/schema_columns_scanner.cpp index e2c2c66d3d..0c728643f7 100644 --- a/be/src/exec/schema_scanner/schema_columns_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_columns_scanner.cpp @@ -341,14 +341,14 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { // TABLE_CATALOG { if (!_db_result.__isset.catalogs) { - fill_dest_column_for_range(block, 0, null_datas); + static_cast(fill_dest_column_for_range(block, 0, null_datas)); } else { std::string catalog_name = _db_result.catalogs[_db_index - 1]; StringRef str = StringRef(catalog_name.c_str(), catalog_name.size()); for (int i = 0; i < columns_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } } // TABLE_SCHEMA @@ -358,7 +358,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < columns_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // TABLE_NAME { @@ -375,7 +375,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { _table_result.tables[cur_table_index].length()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // COLUMN_NAME { @@ -385,7 +385,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { _desc_result.columns[i].columnDesc.columnName.length()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } // ORDINAL_POSITION { @@ -400,10 +400,10 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i] = columns_index++; datas[i] = srcs + i; } - fill_dest_column_for_range(block, 4, datas); + static_cast(fill_dest_column_for_range(block, 4, datas)); } // COLUMN_DEFAULT - { fill_dest_column_for_range(block, 5, null_datas); } + { static_cast(fill_dest_column_for_range(block, 5, null_datas)); } // IS_NULLABLE { StringRef str_yes = StringRef("YES", 3); @@ -419,7 +419,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = &str_no; } } - fill_dest_column_for_range(block, 6, datas); + static_cast(fill_dest_column_for_range(block, 6, datas)); } // DATA_TYPE { @@ -430,7 +430,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(buffers[i].c_str(), buffers[i].length()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 7, datas); + static_cast(fill_dest_column_for_range(block, 7, datas)); } // CHARACTER_MAXIMUM_LENGTH // For string columns, the maximum length in characters. @@ -450,7 +450,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 8, datas); + static_cast(fill_dest_column_for_range(block, 8, datas)); } // CHARACTER_OCTET_LENGTH // For string columns, the maximum length in bytes. @@ -470,7 +470,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 9, datas); + static_cast(fill_dest_column_for_range(block, 9, datas)); } // NUMERIC_PRECISION { @@ -483,7 +483,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 10, datas); + static_cast(fill_dest_column_for_range(block, 10, datas)); } // NUMERIC_SCALE { @@ -496,14 +496,14 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 11, datas); + static_cast(fill_dest_column_for_range(block, 11, datas)); } // DATETIME_PRECISION - { fill_dest_column_for_range(block, 12, null_datas); } + { static_cast(fill_dest_column_for_range(block, 12, null_datas)); } // CHARACTER_SET_NAME - { fill_dest_column_for_range(block, 13, null_datas); } + { static_cast(fill_dest_column_for_range(block, 13, null_datas)); } // COLLATION_NAME - { fill_dest_column_for_range(block, 14, null_datas); } + { static_cast(fill_dest_column_for_range(block, 14, null_datas)); } // COLUMN_TYPE { std::string buffers[columns_num]; @@ -513,7 +513,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(buffers[i].c_str(), buffers[i].length()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 15, datas); + static_cast(fill_dest_column_for_range(block, 15, datas)); } // COLUMN_KEY { @@ -528,19 +528,19 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = &str; } } - fill_dest_column_for_range(block, 16, datas); + static_cast(fill_dest_column_for_range(block, 16, datas)); } // EXTRA { StringRef str = StringRef("", 0); std::vector datas(columns_num, &str); - fill_dest_column_for_range(block, 17, datas); + static_cast(fill_dest_column_for_range(block, 17, datas)); } // PRIVILEGES { StringRef str = StringRef("", 0); std::vector datas(columns_num, &str); - fill_dest_column_for_range(block, 18, datas); + static_cast(fill_dest_column_for_range(block, 18, datas)); } // COLUMN_COMMENT { @@ -550,7 +550,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { _desc_result.columns[i].comment.length()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 19, datas); + static_cast(fill_dest_column_for_range(block, 19, datas)); } // COLUMN_SIZE { @@ -563,7 +563,7 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 20, datas); + static_cast(fill_dest_column_for_range(block, 20, datas)); } // DECIMAL_DIGITS { @@ -576,12 +576,12 @@ Status SchemaColumnsScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 21, datas); + static_cast(fill_dest_column_for_range(block, 21, datas)); } // GENERATION_EXPRESSION - { fill_dest_column_for_range(block, 22, null_datas); } + { static_cast(fill_dest_column_for_range(block, 22, null_datas)); } // SRS_ID - { fill_dest_column_for_range(block, 23, null_datas); } + { static_cast(fill_dest_column_for_range(block, 23, null_datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_metadata_name_ids_scanner.cpp b/be/src/exec/schema_scanner/schema_metadata_name_ids_scanner.cpp index 5c3b686b15..2a1d91fc9f 100644 --- a/be/src/exec/schema_scanner/schema_metadata_name_ids_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_metadata_name_ids_scanner.cpp @@ -145,9 +145,9 @@ Status SchemaMetadataNameIdsScanner::_fill_block_impl(vectorized::Block* block) srcs[i] = id; datas[i] = srcs + i; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } else { - fill_dest_column_for_range(block, 0, null_datas); + static_cast(fill_dest_column_for_range(block, 0, null_datas)); } } @@ -159,9 +159,9 @@ Status SchemaMetadataNameIdsScanner::_fill_block_impl(vectorized::Block* block) for (int i = 0; i < table_num; ++i) { datas[i] = &str_slot; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } else { - fill_dest_column_for_range(block, 1, null_datas); + static_cast(fill_dest_column_for_range(block, 1, null_datas)); } } @@ -174,9 +174,9 @@ Status SchemaMetadataNameIdsScanner::_fill_block_impl(vectorized::Block* block) srcs[i] = id; datas[i] = srcs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } else { - fill_dest_column_for_range(block, 2, null_datas); + static_cast(fill_dest_column_for_range(block, 2, null_datas)); } } @@ -188,9 +188,9 @@ Status SchemaMetadataNameIdsScanner::_fill_block_impl(vectorized::Block* block) for (int i = 0; i < table_num; ++i) { datas[i] = &str_slot; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } else { - fill_dest_column_for_range(block, 3, null_datas); + static_cast(fill_dest_column_for_range(block, 3, null_datas)); } } // table_id @@ -204,7 +204,7 @@ Status SchemaMetadataNameIdsScanner::_fill_block_impl(vectorized::Block* block) datas[i] = nullptr; } } - fill_dest_column_for_range(block, 4, datas); + static_cast(fill_dest_column_for_range(block, 4, datas)); } //table_name @@ -219,7 +219,7 @@ Status SchemaMetadataNameIdsScanner::_fill_block_impl(vectorized::Block* block) datas[i] = nullptr; } } - fill_dest_column_for_range(block, 5, datas); + static_cast(fill_dest_column_for_range(block, 5, datas)); } return Status::OK(); diff --git a/be/src/exec/schema_scanner/schema_rowsets_scanner.cpp b/be/src/exec/schema_scanner/schema_rowsets_scanner.cpp index 49a8d1fe7f..a1c45f2831 100644 --- a/be/src/exec/schema_scanner/schema_rowsets_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_rowsets_scanner.cpp @@ -120,7 +120,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { for (int i = fill_idx_begin; i < fill_idx_end; ++i) { datas[i - fill_idx_begin] = &src; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } // ROWSET_ID { @@ -133,7 +133,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { rowset_ids[i - fill_idx_begin].size()); datas[i - fill_idx_begin] = strs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // TABLET_ID { @@ -143,7 +143,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->rowset_meta()->tablet_id(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // ROWSET_NUM_ROWS { @@ -153,7 +153,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->num_rows(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } // TXN_ID { @@ -163,7 +163,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->txn_id(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 4, datas); + static_cast(fill_dest_column_for_range(block, 4, datas)); } // NUM_SEGMENTS { @@ -173,7 +173,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->num_segments(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 5, datas); + static_cast(fill_dest_column_for_range(block, 5, datas)); } // START_VERSION { @@ -183,7 +183,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->start_version(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 6, datas); + static_cast(fill_dest_column_for_range(block, 6, datas)); } // END_VERSION { @@ -193,7 +193,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->end_version(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 7, datas); + static_cast(fill_dest_column_for_range(block, 7, datas)); } // INDEX_DISK_SIZE { @@ -203,7 +203,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->index_disk_size(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 8, datas); + static_cast(fill_dest_column_for_range(block, 8, datas)); } // DATA_DISK_SIZE { @@ -213,7 +213,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->data_disk_size(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 9, datas); + static_cast(fill_dest_column_for_range(block, 9, datas)); } // CREATION_TIME { @@ -223,7 +223,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->creation_time(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 10, datas); + static_cast(fill_dest_column_for_range(block, 10, datas)); } // NEWEST_WRITE_TIMESTAMP { @@ -233,7 +233,7 @@ Status SchemaRowsetsScanner::_fill_block_impl(vectorized::Block* block) { srcs[i - fill_idx_begin] = rowset->newest_write_timestamp(); datas[i - fill_idx_begin] = srcs + i - fill_idx_begin; } - fill_dest_column_for_range(block, 11, datas); + static_cast(fill_dest_column_for_range(block, 11, datas)); } _rowsets_idx += fill_rowsets_num; return Status::OK(); diff --git a/be/src/exec/schema_scanner/schema_schema_privileges_scanner.cpp b/be/src/exec/schema_scanner/schema_schema_privileges_scanner.cpp index 093d5e04ef..b9d6a882d9 100644 --- a/be/src/exec/schema_scanner/schema_schema_privileges_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_schema_privileges_scanner.cpp @@ -22,6 +22,7 @@ #include +#include "common/status.h" #include "exec/schema_scanner/schema_helper.h" #include "runtime/define_primitive_type.h" #include "util/runtime_profile.h" @@ -109,7 +110,7 @@ Status SchemaSchemaPrivilegesScanner::_fill_block_impl(vectorized::Block* block) strs[i] = StringRef(priv_status.grantee.c_str(), priv_status.grantee.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } // catalog // This value is always def. @@ -119,7 +120,7 @@ Status SchemaSchemaPrivilegesScanner::_fill_block_impl(vectorized::Block* block) for (int i = 0; i < privileges_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // schema { @@ -129,7 +130,7 @@ Status SchemaSchemaPrivilegesScanner::_fill_block_impl(vectorized::Block* block) strs[i] = StringRef(priv_status.schema.c_str(), priv_status.schema.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // privilege type { @@ -140,7 +141,7 @@ Status SchemaSchemaPrivilegesScanner::_fill_block_impl(vectorized::Block* block) priv_status.privilege_type.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } // is grantable { @@ -150,7 +151,7 @@ Status SchemaSchemaPrivilegesScanner::_fill_block_impl(vectorized::Block* block) strs[i] = StringRef(priv_status.is_grantable.c_str(), priv_status.is_grantable.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 4, datas); + static_cast(fill_dest_column_for_range(block, 4, datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_schemata_scanner.cpp b/be/src/exec/schema_scanner/schema_schemata_scanner.cpp index fb57f48b4f..704e91a709 100644 --- a/be/src/exec/schema_scanner/schema_schemata_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_schemata_scanner.cpp @@ -104,14 +104,14 @@ Status SchemaSchemataScanner::_fill_block_impl(vectorized::Block* block) { // catalog { if (!_db_result.__isset.catalogs) { - fill_dest_column_for_range(block, 0, null_datas); + static_cast(fill_dest_column_for_range(block, 0, null_datas)); } else { StringRef strs[dbs_num]; for (int i = 0; i < dbs_num; ++i) { strs[i] = StringRef(_db_result.catalogs[i].c_str(), _db_result.catalogs[i].size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } } // schema @@ -123,7 +123,7 @@ Status SchemaSchemataScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(db_names[i].c_str(), db_names[i].size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // DEFAULT_CHARACTER_SET_NAME { @@ -132,7 +132,7 @@ Status SchemaSchemataScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < dbs_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // DEFAULT_COLLATION_NAME { @@ -141,10 +141,10 @@ Status SchemaSchemataScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < dbs_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } // SQL_PATH - { fill_dest_column_for_range(block, 4, null_datas); } + { static_cast(fill_dest_column_for_range(block, 4, null_datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_table_privileges_scanner.cpp b/be/src/exec/schema_scanner/schema_table_privileges_scanner.cpp index 3bbaf528c0..367a26f21c 100644 --- a/be/src/exec/schema_scanner/schema_table_privileges_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_table_privileges_scanner.cpp @@ -22,6 +22,7 @@ #include +#include "common/status.h" #include "exec/schema_scanner/schema_helper.h" #include "runtime/define_primitive_type.h" #include "util/runtime_profile.h" @@ -111,7 +112,7 @@ Status SchemaTablePrivilegesScanner::_fill_block_impl(vectorized::Block* block) strs[i] = StringRef(priv_status.grantee.c_str(), priv_status.grantee.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } // catalog // This value is always def. @@ -121,7 +122,7 @@ Status SchemaTablePrivilegesScanner::_fill_block_impl(vectorized::Block* block) for (int i = 0; i < privileges_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // schema { @@ -131,7 +132,7 @@ Status SchemaTablePrivilegesScanner::_fill_block_impl(vectorized::Block* block) strs[i] = StringRef(priv_status.schema.c_str(), priv_status.schema.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // table name { @@ -141,7 +142,7 @@ Status SchemaTablePrivilegesScanner::_fill_block_impl(vectorized::Block* block) strs[i] = StringRef(priv_status.table_name.c_str(), priv_status.table_name.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } // privilege type { @@ -152,7 +153,7 @@ Status SchemaTablePrivilegesScanner::_fill_block_impl(vectorized::Block* block) priv_status.privilege_type.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 4, datas); + static_cast(fill_dest_column_for_range(block, 4, datas)); } // is grantable { @@ -162,7 +163,7 @@ Status SchemaTablePrivilegesScanner::_fill_block_impl(vectorized::Block* block) strs[i] = StringRef(priv_status.is_grantable.c_str(), priv_status.is_grantable.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 5, datas); + static_cast(fill_dest_column_for_range(block, 5, datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_tables_scanner.cpp b/be/src/exec/schema_scanner/schema_tables_scanner.cpp index 14ad1a8948..3a2654b9e1 100644 --- a/be/src/exec/schema_scanner/schema_tables_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_tables_scanner.cpp @@ -150,9 +150,9 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < table_num; ++i) { datas[i] = &str_slot; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } else { - fill_dest_column_for_range(block, 0, null_datas); + static_cast(fill_dest_column_for_range(block, 0, null_datas)); } } // schema @@ -162,7 +162,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < table_num; ++i) { datas[i] = &str_slot; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // name { @@ -172,7 +172,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(src->c_str(), src->size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // type { @@ -182,7 +182,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(src->c_str(), src->size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } // engine { @@ -197,12 +197,12 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 4, datas); + static_cast(fill_dest_column_for_range(block, 4, datas)); } // version - { fill_dest_column_for_range(block, 5, null_datas); } + { static_cast(fill_dest_column_for_range(block, 5, null_datas)); } // row_format - { fill_dest_column_for_range(block, 6, null_datas); } + { static_cast(fill_dest_column_for_range(block, 6, null_datas)); } // rows { int64_t srcs[table_num]; @@ -215,7 +215,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 7, datas); + static_cast(fill_dest_column_for_range(block, 7, datas)); } // avg_row_length { @@ -229,7 +229,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 8, datas); + static_cast(fill_dest_column_for_range(block, 8, datas)); } // data_length { @@ -243,16 +243,16 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 9, datas); + static_cast(fill_dest_column_for_range(block, 9, datas)); } // max_data_length - { fill_dest_column_for_range(block, 10, null_datas); } + { static_cast(fill_dest_column_for_range(block, 10, null_datas)); } // index_length - { fill_dest_column_for_range(block, 11, null_datas); } + { static_cast(fill_dest_column_for_range(block, 11, null_datas)); } // data_free - { fill_dest_column_for_range(block, 12, null_datas); } + { static_cast(fill_dest_column_for_range(block, 12, null_datas)); } // auto_increment - { fill_dest_column_for_range(block, 13, null_datas); } + { static_cast(fill_dest_column_for_range(block, 13, null_datas)); } // creation_time { vectorized::VecDateTimeValue srcs[table_num]; @@ -270,7 +270,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 14, datas); + static_cast(fill_dest_column_for_range(block, 14, datas)); } // update_time { @@ -289,7 +289,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 15, datas); + static_cast(fill_dest_column_for_range(block, 15, datas)); } // check_time { @@ -308,7 +308,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 16, datas); + static_cast(fill_dest_column_for_range(block, 16, datas)); } // collation { @@ -323,12 +323,12 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { datas[i] = nullptr; } } - fill_dest_column_for_range(block, 17, datas); + static_cast(fill_dest_column_for_range(block, 17, datas)); } // checksum - { fill_dest_column_for_range(block, 18, null_datas); } + { static_cast(fill_dest_column_for_range(block, 18, null_datas)); } // create_options - { fill_dest_column_for_range(block, 19, null_datas); } + { static_cast(fill_dest_column_for_range(block, 19, null_datas)); } // create_comment { StringRef strs[table_num]; @@ -337,7 +337,7 @@ Status SchemaTablesScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(src->c_str(), src->size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 20, datas); + static_cast(fill_dest_column_for_range(block, 20, datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_user_privileges_scanner.cpp b/be/src/exec/schema_scanner/schema_user_privileges_scanner.cpp index a9bf7c3409..1501e07a66 100644 --- a/be/src/exec/schema_scanner/schema_user_privileges_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_user_privileges_scanner.cpp @@ -109,7 +109,7 @@ Status SchemaUserPrivilegesScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(priv_status.grantee.c_str(), priv_status.grantee.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } // catalog // This value is always def. @@ -119,7 +119,7 @@ Status SchemaUserPrivilegesScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < privileges_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // privilege type { @@ -130,7 +130,7 @@ Status SchemaUserPrivilegesScanner::_fill_block_impl(vectorized::Block* block) { priv_status.privilege_type.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // is grantable { @@ -140,7 +140,7 @@ Status SchemaUserPrivilegesScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(priv_status.is_grantable.c_str(), priv_status.is_grantable.size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_variables_scanner.cpp b/be/src/exec/schema_scanner/schema_variables_scanner.cpp index 8fbca7ca7d..1713755d81 100644 --- a/be/src/exec/schema_scanner/schema_variables_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_variables_scanner.cpp @@ -98,7 +98,7 @@ Status SchemaVariablesScanner::_fill_block_impl(vectorized::Block* block) { datas[idx] = strs + idx; ++idx; } - fill_dest_column_for_range(block, 0, datas); + static_cast(fill_dest_column_for_range(block, 0, datas)); } // value { @@ -109,7 +109,7 @@ Status SchemaVariablesScanner::_fill_block_impl(vectorized::Block* block) { datas[idx] = strs + idx; ++idx; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } return Status::OK(); } diff --git a/be/src/exec/schema_scanner/schema_views_scanner.cpp b/be/src/exec/schema_scanner/schema_views_scanner.cpp index 8183cfaa9f..7619f72d1f 100644 --- a/be/src/exec/schema_scanner/schema_views_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_views_scanner.cpp @@ -140,7 +140,7 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { std::vector datas(tables_num); // catalog - { fill_dest_column_for_range(block, 0, null_datas); } + { static_cast(fill_dest_column_for_range(block, 0, null_datas)); } // schema { std::string db_name = SchemaHelper::extract_db_name(_db_result.dbs[_db_index - 1]); @@ -148,7 +148,7 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < tables_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 1, datas); + static_cast(fill_dest_column_for_range(block, 1, datas)); } // name { @@ -159,7 +159,7 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(src->c_str(), src->size()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 2, datas); + static_cast(fill_dest_column_for_range(block, 2, datas)); } // definition { @@ -170,7 +170,7 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { strs[i] = StringRef(src->c_str(), src->length()); datas[i] = strs + i; } - fill_dest_column_for_range(block, 3, datas); + static_cast(fill_dest_column_for_range(block, 3, datas)); } // check_option { @@ -179,7 +179,7 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < tables_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 4, datas); + static_cast(fill_dest_column_for_range(block, 4, datas)); } // is_updatable { @@ -189,7 +189,7 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < tables_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 5, datas); + static_cast(fill_dest_column_for_range(block, 5, datas)); } // definer { @@ -199,7 +199,7 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < tables_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 6, datas); + static_cast(fill_dest_column_for_range(block, 6, datas)); } // security_type { @@ -209,7 +209,7 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < tables_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 7, datas); + static_cast(fill_dest_column_for_range(block, 7, datas)); } // character_set_client { @@ -219,10 +219,10 @@ Status SchemaViewsScanner::_fill_block_impl(vectorized::Block* block) { for (int i = 0; i < tables_num; ++i) { datas[i] = &str; } - fill_dest_column_for_range(block, 8, datas); + static_cast(fill_dest_column_for_range(block, 8, datas)); } // collation_connection - { fill_dest_column_for_range(block, 9, null_datas); } + { static_cast(fill_dest_column_for_range(block, 9, null_datas)); } return Status::OK(); } diff --git a/be/src/exprs/runtime_filter.cpp b/be/src/exprs/runtime_filter.cpp index 0ca8f47c1d..f7d6004313 100644 --- a/be/src/exprs/runtime_filter.cpp +++ b/be/src/exprs/runtime_filter.cpp @@ -231,7 +231,7 @@ Status create_vbin_predicate(const TypeDescriptor& type, TExprOpcode::type opcod fn_name.__set_function_name("ge"); break; default: - Status::InvalidArgument( + return Status::InvalidArgument( strings::Substitute("Invalid opcode for max_min_runtimefilter: '$0'", opcode)); } fn.__set_name(fn_name); @@ -359,7 +359,7 @@ public: _is_bloomfilter = true; BloomFilterFuncBase* bf = _context.bloom_filter_func.get(); // BloomFilter may be not init - bf->init_with_fixed_length(); + static_cast(bf->init_with_fixed_length()); insert_to_bloom_filter(bf); // release in filter _context.hybrid_set.reset(create_set(_column_return_type)); @@ -576,11 +576,13 @@ public: break; } case RuntimeFilterType::MINMAX_FILTER: { - _context.minmax_func->merge(wrapper->_context.minmax_func.get(), _pool); + static_cast( + _context.minmax_func->merge(wrapper->_context.minmax_func.get(), _pool)); break; } case RuntimeFilterType::BLOOM_FILTER: { - _context.bloom_filter_func->merge(wrapper->_context.bloom_filter_func.get()); + static_cast( + _context.bloom_filter_func->merge(wrapper->_context.bloom_filter_func.get())); break; } case RuntimeFilterType::IN_OR_BLOOM_FILTER: { @@ -604,7 +606,8 @@ public: VLOG_DEBUG << " change runtime filter to bloom filter(id=" << _filter_id << ") because: already exist a bloom filter"; change_to_bloom_filter(); - _context.bloom_filter_func->merge(wrapper->_context.bloom_filter_func.get()); + static_cast(_context.bloom_filter_func->merge( + wrapper->_context.bloom_filter_func.get())); } } else { if (wrapper->_filter_type == @@ -616,7 +619,8 @@ public: wrapper->insert_to_bloom_filter(_context.bloom_filter_func.get()); // bloom filter merge bloom filter } else { - _context.bloom_filter_func->merge(wrapper->_context.bloom_filter_func.get()); + static_cast(_context.bloom_filter_func->merge( + wrapper->_context.bloom_filter_func.get())); } } break; @@ -1450,7 +1454,7 @@ void IRuntimeFilter::to_protobuf(PInFilter* filter) { } HybridSetBase::IteratorBase* it; - _wrapper->get_in_filter_iterator(&it); + static_cast(_wrapper->get_in_filter_iterator(&it)); DCHECK(it != nullptr); switch (column_type) { @@ -1573,7 +1577,7 @@ void IRuntimeFilter::to_protobuf(PInFilter* filter) { void IRuntimeFilter::to_protobuf(PMinMaxFilter* filter) { void* min_data = nullptr; void* max_data = nullptr; - _wrapper->get_minmax_filter_desc(&min_data, &max_data); + static_cast(_wrapper->get_minmax_filter_desc(&min_data, &max_data)); DCHECK(min_data != nullptr); DCHECK(max_data != nullptr); filter->set_column_type(to_proto(_wrapper->column_type())); diff --git a/be/src/exprs/runtime_filter_slots.h b/be/src/exprs/runtime_filter_slots.h index fe71f683a0..e0ff2cb006 100644 --- a/be/src/exprs/runtime_filter_slots.h +++ b/be/src/exprs/runtime_filter_slots.h @@ -47,7 +47,7 @@ public: auto ignore_local_filter = [state](int filter_id) { std::vector filters; - state->runtime_filter_mgr()->get_consume_filters(filter_id, filters); + static_cast(state->runtime_filter_mgr()->get_consume_filters(filter_id, filters)); if (filters.empty()) { throw Exception(ErrorCode::INTERNAL_ERROR, "filters empty, filter_id={}", filter_id); @@ -211,7 +211,7 @@ public: void finish_publish() { for (auto& pair : _runtime_filters) { for (auto filter : pair.second) { - filter->join_rpc(); + static_cast(filter->join_rpc()); } } } @@ -243,7 +243,7 @@ public: if (ret == context->runtime_filters.end()) { return Status::Aborted("invalid runtime filter id: {}", filter_id); } - filter->copy_from_shared_context(ret->second); + static_cast(filter->copy_from_shared_context(ret->second)); } } return Status::OK(); diff --git a/be/src/http/action/compaction_action.cpp b/be/src/http/action/compaction_action.cpp index c81c65da1f..ff9cf3f4f9 100644 --- a/be/src/http/action/compaction_action.cpp +++ b/be/src/http/action/compaction_action.cpp @@ -29,6 +29,7 @@ #include #include "common/logging.h" +#include "common/status.h" #include "gutil/strings/substitute.h" #include "http/http_channel.h" #include "http/http_headers.h" @@ -122,8 +123,8 @@ Status CompactionAction::_handle_run_compaction(HttpRequest* req, std::string* j return tablet->get_table_id() == table_id; }); for (const auto& tablet : tablet_vec) { - StorageEngine::instance()->submit_compaction_task( - tablet, CompactionType::FULL_COMPACTION, false); + static_cast(StorageEngine::instance()->submit_compaction_task( + tablet, CompactionType::FULL_COMPACTION, false)); } } else { // 2. fetch the tablet by tablet_id diff --git a/be/src/http/action/download_action.cpp b/be/src/http/action/download_action.cpp index 7e0083c5eb..f2068d83c7 100644 --- a/be/src/http/action/download_action.cpp +++ b/be/src/http/action/download_action.cpp @@ -50,17 +50,18 @@ DownloadAction::DownloadAction(ExecEnv* exec_env, const std::vector } if (_num_workers > 0) { // for single-replica-load - ThreadPoolBuilder("DownloadThreadPool") - .set_min_threads(num_workers) - .set_max_threads(num_workers) - .build(&_download_workers); + static_cast(ThreadPoolBuilder("DownloadThreadPool") + .set_min_threads(num_workers) + .set_max_threads(num_workers) + .build(&_download_workers)); } } DownloadAction::DownloadAction(ExecEnv* exec_env, const std::string& error_log_root_dir) : _exec_env(exec_env), _download_type(ERROR_LOG), _num_workers(0) { #ifndef BE_TEST - io::global_local_filesystem()->canonicalize(error_log_root_dir, &_error_log_root_dir); + static_cast( + io::global_local_filesystem()->canonicalize(error_log_root_dir, &_error_log_root_dir)); #endif } diff --git a/be/src/http/action/pad_rowset_action.cpp b/be/src/http/action/pad_rowset_action.cpp index d337c0199d..63c19dbc94 100644 --- a/be/src/http/action/pad_rowset_action.cpp +++ b/be/src/http/action/pad_rowset_action.cpp @@ -115,7 +115,7 @@ Status PadRowsetAction::_pad_rowset(TabletSharedPtr tablet, const Version& versi { std::unique_lock wlock(tablet->get_header_lock()); SCOPED_SIMPLE_TRACE_IF_TIMEOUT(TRACE_TABLET_LOCK_THRESHOLD); - tablet->modify_rowsets(to_add, to_delete); + static_cast(tablet->modify_rowsets(to_add, to_delete)); tablet->save_meta(); } diff --git a/be/src/http/action/restore_tablet_action.cpp b/be/src/http/action/restore_tablet_action.cpp index d8c5dbcd2b..d416134040 100644 --- a/be/src/http/action/restore_tablet_action.cpp +++ b/be/src/http/action/restore_tablet_action.cpp @@ -30,6 +30,7 @@ #include #include +#include "common/status.h" #include "http/http_channel.h" #include "http/http_request.h" #include "http/http_status.h" @@ -182,7 +183,8 @@ Status RestoreTabletAction::_restore(const std::string& key, int64_t tablet_id, Status s = _create_hard_link_recursive(latest_tablet_path, restore_schema_hash_path); if (!s.ok()) { // do not check the status of delete_directory, return status of link operation - io::global_local_filesystem()->delete_directory(restore_schema_hash_path); + static_cast( + io::global_local_filesystem()->delete_directory(restore_schema_hash_path)); return s; } std::string restore_shard_path = store->get_absolute_shard_path(tablet_meta.shard_id()); @@ -275,7 +277,7 @@ bool RestoreTabletAction::_get_timestamp_and_count_from_schema_hash_path( path time_label_path = schema_hash_path.parent_path().parent_path(); std::string time_label = time_label_path.filename().string(); std::vector parts; - doris::split_string(time_label, '.', &parts); + static_cast(doris::split_string(time_label, '.', &parts)); if (parts.size() != 2) { LOG(WARNING) << "invalid time label:" << time_label; return false; diff --git a/be/src/http/action/tablet_migration_action.cpp b/be/src/http/action/tablet_migration_action.cpp index 3d5b40ae18..f6c2ca29bb 100644 --- a/be/src/http/action/tablet_migration_action.cpp +++ b/be/src/http/action/tablet_migration_action.cpp @@ -39,10 +39,10 @@ const static std::string HEADER_JSON = "application/json"; void TabletMigrationAction::_init_migration_action() { int32_t max_thread_num = config::max_tablet_migration_threads; int32_t min_thread_num = config::min_tablet_migration_threads; - ThreadPoolBuilder("MigrationTaskThreadPool") - .set_min_threads(min_thread_num) - .set_max_threads(max_thread_num) - .build(&_migration_thread_pool); + static_cast(ThreadPoolBuilder("MigrationTaskThreadPool") + .set_min_threads(min_thread_num) + .set_max_threads(max_thread_num) + .build(&_migration_thread_pool)); } void TabletMigrationAction::handle(HttpRequest* req) { diff --git a/be/src/http/ev_http_server.cpp b/be/src/http/ev_http_server.cpp index b0743baee3..5d231cb908 100644 --- a/be/src/http/ev_http_server.cpp +++ b/be/src/http/ev_http_server.cpp @@ -103,10 +103,10 @@ void EvHttpServer::start() { // bind to auto s = _bind(); CHECK(s.ok()) << s.to_string(); - ThreadPoolBuilder("EvHttpServer") - .set_min_threads(_num_workers) - .set_max_threads(_num_workers) - .build(&_workers); + static_cast(ThreadPoolBuilder("EvHttpServer") + .set_min_threads(_num_workers) + .set_max_threads(_num_workers) + .build(&_workers)); evthread_use_pthreads(); _event_bases.resize(_num_workers); diff --git a/be/src/index-tools/index_tool.cpp b/be/src/index-tools/index_tool.cpp index 9cd72795ef..2fd51feb63 100644 --- a/be/src/index-tools/index_tool.cpp +++ b/be/src/index-tools/index_tool.cpp @@ -196,7 +196,7 @@ int main(int argc, char** argv) { std::vector files; bool exists = false; std::filesystem::path root_dir(FLAGS_directory); - fs->list(root_dir, true, &files, &exists); + static_cast(fs->list(root_dir, true, &files, &exists)); if (!exists) { std::cout << FLAGS_directory << " is not exists" << std::endl; return -1; diff --git a/be/src/io/cache/block/block_file_cache_factory.cpp b/be/src/io/cache/block/block_file_cache_factory.cpp index 6bbbba8023..e2b0707c86 100644 --- a/be/src/io/cache/block/block_file_cache_factory.cpp +++ b/be/src/io/cache/block/block_file_cache_factory.cpp @@ -64,9 +64,9 @@ void FileCacheFactory::create_file_cache(const std::string& cache_base_path, if (config::clear_file_cache) { auto fs = global_local_filesystem(); bool res = false; - fs->exists(cache_base_path, &res); + static_cast(fs->exists(cache_base_path, &res)); if (res) { - fs->delete_directory(cache_base_path); + static_cast(fs->delete_directory(cache_base_path)); } } diff --git a/be/src/io/cache/block/block_file_segment.cpp b/be/src/io/cache/block/block_file_segment.cpp index 38d230d9bb..3b179de343 100644 --- a/be/src/io/cache/block/block_file_segment.cpp +++ b/be/src/io/cache/block/block_file_segment.cpp @@ -131,7 +131,7 @@ void FileBlock::reset_downloader(std::lock_guard& segment_lock) { void FileBlock::reset_downloader_impl(std::lock_guard& segment_lock) { if (_downloaded_size == range().size()) { - set_downloaded(segment_lock); + static_cast(set_downloaded(segment_lock)); } else { _downloaded_size = 0; _download_state = State::EMPTY; diff --git a/be/src/io/cache/block/block_lru_file_cache.cpp b/be/src/io/cache/block/block_lru_file_cache.cpp index a15650d6d9..03a291ba74 100644 --- a/be/src/io/cache/block/block_lru_file_cache.cpp +++ b/be/src/io/cache/block/block_lru_file_cache.cpp @@ -958,19 +958,19 @@ std::string LRUFileCache::read_file_cache_version() const { std::string version_path = get_version_path(); const FileSystemSPtr& fs = global_local_filesystem(); bool exists = false; - fs->exists(version_path, &exists); + static_cast(fs->exists(version_path, &exists)); if (!exists) { return "1.0"; } FileReaderSPtr version_reader; int64_t file_size = -1; - fs->file_size(version_path, &file_size); + static_cast(fs->file_size(version_path, &file_size)); char version[file_size]; - fs->open_file(version_path, &version_reader); + static_cast(fs->open_file(version_path, &version_reader)); size_t bytes_read = 0; - version_reader->read_at(0, Slice(version, file_size), &bytes_read); - version_reader->close(); + static_cast(version_reader->read_at(0, Slice(version, file_size), &bytes_read)); + static_cast(version_reader->close()); return std::string(version, bytes_read); } diff --git a/be/src/io/cache/block/cached_remote_file_reader.cpp b/be/src/io/cache/block/cached_remote_file_reader.cpp index 7c51695ebd..fd19f88af6 100644 --- a/be/src/io/cache/block/cached_remote_file_reader.cpp +++ b/be/src/io/cache/block/cached_remote_file_reader.cpp @@ -68,7 +68,7 @@ CachedRemoteFileReader::CachedRemoteFileReader(FileReaderSPtr remote_file_reader } CachedRemoteFileReader::~CachedRemoteFileReader() { - close(); + static_cast(close()); } Status CachedRemoteFileReader::close() { diff --git a/be/src/io/file_factory.cpp b/be/src/io/file_factory.cpp index c75ec280b8..12037c1b62 100644 --- a/be/src/io/file_factory.cpp +++ b/be/src/io/file_factory.cpp @@ -151,8 +151,8 @@ Status FileFactory::create_pipe_reader(const TUniqueId& load_id, io::FileReaderS io::kMaxPipeBufferedBytes /* max_buffered_bytes */, 64 * 1024 /* min_chunk_size */, stream_load_ctx->schema_buffer->pos /* total_length */); stream_load_ctx->schema_buffer->flip(); - pipe->append(stream_load_ctx->schema_buffer); - pipe->finish(); + static_cast(pipe->append(stream_load_ctx->schema_buffer)); + static_cast(pipe->finish()); *file_reader = std::move(pipe); stream_load_ctx->need_schema = false; } else { diff --git a/be/src/io/fs/benchmark/fs_benchmark_tool.cpp b/be/src/io/fs/benchmark/fs_benchmark_tool.cpp index 77dee409d1..2a6ad2db3d 100644 --- a/be/src/io/fs/benchmark/fs_benchmark_tool.cpp +++ b/be/src/io/fs/benchmark/fs_benchmark_tool.cpp @@ -115,10 +115,10 @@ int main(int argc, char** argv) { // init s3 write buffer pool std::unique_ptr buffered_reader_prefetch_thread_pool; - doris::ThreadPoolBuilder("BufferedReaderPrefetchThreadPool") - .set_min_threads(num_cores) - .set_max_threads(num_cores) - .build(&buffered_reader_prefetch_thread_pool); + static_cast(doris::ThreadPoolBuilder("BufferedReaderPrefetchThreadPool") + .set_min_threads(num_cores) + .set_max_threads(num_cores) + .build(&buffered_reader_prefetch_thread_pool)); doris::io::S3FileBufferPool* s3_buffer_pool = doris::io::S3FileBufferPool::GetInstance(); s3_buffer_pool->init(524288000, 5242880, buffered_reader_prefetch_thread_pool.get()); diff --git a/be/src/io/fs/broker_file_reader.cpp b/be/src/io/fs/broker_file_reader.cpp index 482faa8404..73d79b7038 100644 --- a/be/src/io/fs/broker_file_reader.cpp +++ b/be/src/io/fs/broker_file_reader.cpp @@ -47,13 +47,13 @@ BrokerFileReader::BrokerFileReader(const TNetworkAddress& broker_addr, const Pat _broker_addr(broker_addr), _fd(fd), _fs(std::move(fs)) { - _fs->get_client(&_client); + static_cast(_fs->get_client(&_client)); DorisMetrics::instance()->broker_file_open_reading->increment(1); DorisMetrics::instance()->broker_file_reader_total->increment(1); } BrokerFileReader::~BrokerFileReader() { - BrokerFileReader::close(); + static_cast(BrokerFileReader::close()); } Status BrokerFileReader::close() { diff --git a/be/src/io/fs/broker_file_writer.cpp b/be/src/io/fs/broker_file_writer.cpp index 8d237a4026..526cbd784f 100644 --- a/be/src/io/fs/broker_file_writer.cpp +++ b/be/src/io/fs/broker_file_writer.cpp @@ -46,7 +46,7 @@ BrokerFileWriter::BrokerFileWriter(ExecEnv* env, const TNetworkAddress& broker_a BrokerFileWriter::~BrokerFileWriter() { if (_opened) { - close(); + static_cast(close()); } CHECK(!_opened || _closed) << "open: " << _opened << ", closed: " << _closed; } diff --git a/be/src/io/fs/buffered_reader.cpp b/be/src/io/fs/buffered_reader.cpp index 40ffae9680..0c4496fd3a 100644 --- a/be/src/io/fs/buffered_reader.cpp +++ b/be/src/io/fs/buffered_reader.cpp @@ -417,8 +417,8 @@ void PrefetchBuffer::reset_offset(size_t offset) { } else { _exceed = false; } - ExecEnv::GetInstance()->buffered_reader_prefetch_thread_pool()->submit_func( - [buffer_ptr = shared_from_this()]() { buffer_ptr->prefetch_buffer(); }); + static_cast(ExecEnv::GetInstance()->buffered_reader_prefetch_thread_pool()->submit_func( + [buffer_ptr = shared_from_this()]() { buffer_ptr->prefetch_buffer(); })); } // only this function would run concurrently in another thread @@ -649,7 +649,7 @@ PrefetchBufferedReader::~PrefetchBufferedReader() { std::for_each(_pre_buffers.begin(), _pre_buffers.end(), [](std::shared_ptr& buffer) { buffer->_sync_profile = nullptr; }); /// Better not to call virtual functions in a destructor. - _close_internal(); + static_cast(_close_internal()); } Status PrefetchBufferedReader::read_at_impl(size_t offset, Slice result, size_t* bytes_read, @@ -697,7 +697,7 @@ InMemoryFileReader::InMemoryFileReader(io::FileReaderSPtr reader) : _reader(std: } InMemoryFileReader::~InMemoryFileReader() { - _close_internal(); + static_cast(_close_internal()); } Status InMemoryFileReader::close() { diff --git a/be/src/io/fs/buffered_reader.h b/be/src/io/fs/buffered_reader.h index 7e30780e7e..f13a70c874 100644 --- a/be/src/io/fs/buffered_reader.h +++ b/be/src/io/fs/buffered_reader.h @@ -161,7 +161,7 @@ public: for (char* box : _boxes) { delete[] box; } - close(); + static_cast(close()); } Status close() override { diff --git a/be/src/io/fs/hdfs_file_reader.cpp b/be/src/io/fs/hdfs_file_reader.cpp index d344447ae5..0ea9c43015 100644 --- a/be/src/io/fs/hdfs_file_reader.cpp +++ b/be/src/io/fs/hdfs_file_reader.cpp @@ -70,7 +70,7 @@ HdfsFileReader::HdfsFileReader(Path path, const std::string& name_node, } HdfsFileReader::~HdfsFileReader() { - close(); + static_cast(close()); } Status HdfsFileReader::close() { diff --git a/be/src/io/fs/hdfs_file_writer.cpp b/be/src/io/fs/hdfs_file_writer.cpp index 936defb2f6..82a8558b8c 100644 --- a/be/src/io/fs/hdfs_file_writer.cpp +++ b/be/src/io/fs/hdfs_file_writer.cpp @@ -40,7 +40,7 @@ HdfsFileWriter::HdfsFileWriter(Path file, FileSystemSPtr fs) : FileWriter(std::m HdfsFileWriter::~HdfsFileWriter() { if (_opened) { - close(); + static_cast(close()); } CHECK(!_opened || _closed) << "open: " << _opened << ", closed: " << _closed; } diff --git a/be/src/io/fs/local_file_writer.cpp b/be/src/io/fs/local_file_writer.cpp index 62536dd687..e1703f8b72 100644 --- a/be/src/io/fs/local_file_writer.cpp +++ b/be/src/io/fs/local_file_writer.cpp @@ -79,7 +79,7 @@ LocalFileWriter::LocalFileWriter(Path path, int fd) LocalFileWriter::~LocalFileWriter() { if (_opened) { - close(); + static_cast(close()); } CHECK(!_opened || _closed) << "open: " << _opened << ", closed: " << _closed; } diff --git a/be/src/io/fs/multi_table_pipe.cpp b/be/src/io/fs/multi_table_pipe.cpp index 12de3fa8d4..4af4eb08dc 100644 --- a/be/src/io/fs/multi_table_pipe.cpp +++ b/be/src/io/fs/multi_table_pipe.cpp @@ -214,12 +214,13 @@ Status MultiTablePipe::exec_plans(ExecEnv* exec_env, std::vector para } if constexpr (std::is_same_v) { - putPipe(plan.params.fragment_instance_id, _planned_pipes[plan.table_name]); + static_cast( + putPipe(plan.params.fragment_instance_id, _planned_pipes[plan.table_name])); LOG(INFO) << "fragment_instance_id=" << plan.params.fragment_instance_id << " table=" << plan.table_name; } else if constexpr (std::is_same_v) { auto pipe_id = calculate_pipe_id(plan.query_id, plan.fragment_id); - putPipe(pipe_id, _planned_pipes[plan.table_name]); + static_cast(putPipe(pipe_id, _planned_pipes[plan.table_name])); LOG(INFO) << "pipe_id=" << pipe_id << "table=" << plan.table_name; } else { LOG(WARNING) << "illegal exec param type, need `TExecPlanFragmentParams` or " @@ -227,52 +228,54 @@ Status MultiTablePipe::exec_plans(ExecEnv* exec_env, std::vector para CHECK(false); } - exec_env->fragment_mgr()->exec_plan_fragment(plan, [this](RuntimeState* state, - Status* status) { - { - std::lock_guard l(_tablet_commit_infos_lock); - _tablet_commit_infos.insert(_tablet_commit_infos.end(), - state->tablet_commit_infos().begin(), - state->tablet_commit_infos().end()); - } - _number_total_rows += state->num_rows_load_total(); - _number_loaded_rows += state->num_rows_load_success(); - _number_filtered_rows += state->num_rows_load_filtered(); - _number_unselected_rows += state->num_rows_load_unselected(); + static_cast(exec_env->fragment_mgr()->exec_plan_fragment( + plan, [this](RuntimeState* state, Status* status) { + { + std::lock_guard l(_tablet_commit_infos_lock); + _tablet_commit_infos.insert(_tablet_commit_infos.end(), + state->tablet_commit_infos().begin(), + state->tablet_commit_infos().end()); + } + _number_total_rows += state->num_rows_load_total(); + _number_loaded_rows += state->num_rows_load_success(); + _number_filtered_rows += state->num_rows_load_filtered(); + _number_unselected_rows += state->num_rows_load_unselected(); - // check filtered ratio for this plan fragment - 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 > - _ctx->max_filter_ratio) { - *status = Status::InternalError("too many filtered rows"); - } - if (_number_filtered_rows > 0 && !state->get_error_log_file_path().empty()) { - _ctx->error_url = to_load_error_http_path(state->get_error_log_file_path()); - } + // check filtered ratio for this plan fragment + 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 > + _ctx->max_filter_ratio) { + *status = Status::InternalError("too many filtered rows"); + } + if (_number_filtered_rows > 0 && !state->get_error_log_file_path().empty()) { + _ctx->error_url = to_load_error_http_path(state->get_error_log_file_path()); + } - // if any of the plan fragment exec failed, set the status to the first failed plan - if (!status->ok()) { - LOG(WARNING) << "plan fragment exec failed. errmsg=" << *status << _ctx->brief(); - _status = *status; - } + // if any of the plan fragment exec failed, set the status to the first failed plan + if (!status->ok()) { + LOG(WARNING) + << "plan fragment exec failed. errmsg=" << *status << _ctx->brief(); + _status = *status; + } - --_inflight_plan_cnt; - if (_inflight_plan_cnt == 0 && is_consume_finished()) { - _ctx->number_total_rows = _number_total_rows; - _ctx->number_loaded_rows = _number_loaded_rows; - _ctx->number_filtered_rows = _number_filtered_rows; - _ctx->number_unselected_rows = _number_unselected_rows; - _ctx->commit_infos = _tablet_commit_infos; - LOG(INFO) << "all plan for multi-table load complete. number_total_rows=" - << _ctx->number_total_rows - << " number_loaded_rows=" << _ctx->number_loaded_rows - << " number_filtered_rows=" << _ctx->number_filtered_rows - << " number_unselected_rows=" << _ctx->number_unselected_rows; - _ctx->promise.set_value(_status); // when all done, finish the routine load task - } - }); + --_inflight_plan_cnt; + if (_inflight_plan_cnt == 0 && is_consume_finished()) { + _ctx->number_total_rows = _number_total_rows; + _ctx->number_loaded_rows = _number_loaded_rows; + _ctx->number_filtered_rows = _number_filtered_rows; + _ctx->number_unselected_rows = _number_unselected_rows; + _ctx->commit_infos = _tablet_commit_infos; + LOG(INFO) << "all plan for multi-table load complete. number_total_rows=" + << _ctx->number_total_rows + << " number_loaded_rows=" << _ctx->number_loaded_rows + << " number_filtered_rows=" << _ctx->number_filtered_rows + << " number_unselected_rows=" << _ctx->number_unselected_rows; + _ctx->promise.set_value( + _status); // when all done, finish the routine load task + } + })); } return Status::OK(); diff --git a/be/src/io/fs/s3_file_reader.cpp b/be/src/io/fs/s3_file_reader.cpp index 3b9ddccb32..2116ed3555 100644 --- a/be/src/io/fs/s3_file_reader.cpp +++ b/be/src/io/fs/s3_file_reader.cpp @@ -60,7 +60,7 @@ S3FileReader::S3FileReader(size_t file_size, std::string key, std::shared_ptr(close()); s3_file_being_read << -1; } diff --git a/be/src/io/fs/s3_file_write_bufferpool.cpp b/be/src/io/fs/s3_file_write_bufferpool.cpp index 48887f9c6e..30b927a2fb 100644 --- a/be/src/io/fs/s3_file_write_bufferpool.cpp +++ b/be/src/io/fs/s3_file_write_bufferpool.cpp @@ -60,7 +60,8 @@ void S3FileBuffer::submit() { _stream_ptr = std::make_shared(_buf.data, _size); } - _thread_pool->submit_func([buf = this->shared_from_this()]() { buf->_on_upload(); }); + static_cast( + _thread_pool->submit_func([buf = this->shared_from_this()]() { buf->_on_upload(); })); } void S3FileBufferPool::init(int32_t s3_write_buffer_whole_size, int32_t s3_write_buffer_size, diff --git a/be/src/io/fs/s3_file_writer.cpp b/be/src/io/fs/s3_file_writer.cpp index 57f661975f..b844e122a8 100644 --- a/be/src/io/fs/s3_file_writer.cpp +++ b/be/src/io/fs/s3_file_writer.cpp @@ -96,7 +96,7 @@ S3FileWriter::~S3FileWriter() { if (!_closed || _failed) { // if we don't abort multi part upload, the uploaded part in object // store will not automatically reclaim itself, it would cost more money - abort(); + static_cast(abort()); _bytes_written = 0; } s3_bytes_written_total << _bytes_written; @@ -183,7 +183,7 @@ Status S3FileWriter::close() { } Defer defer {[&]() { _closed = true; }}; if (_failed) { - abort(); + static_cast(abort()); return _st; } VLOG_DEBUG << "S3FileWriter::close, path: " << _path.native(); diff --git a/be/src/io/fs/stream_load_pipe.cpp b/be/src/io/fs/stream_load_pipe.cpp index db6bb085f5..a91abc80bd 100644 --- a/be/src/io/fs/stream_load_pipe.cpp +++ b/be/src/io/fs/stream_load_pipe.cpp @@ -25,6 +25,7 @@ // IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep +#include "common/status.h" #include "runtime/exec_env.h" #include "runtime/thread_context.h" #include "util/bit_util.h" @@ -228,7 +229,7 @@ Status StreamLoadPipe::_append(const ByteBufferPtr& buf, size_t proto_byte_size) Status StreamLoadPipe::finish() { if (_write_buf != nullptr) { _write_buf->flip(); - _append(_write_buf); + static_cast(_append(_write_buf)); _write_buf.reset(); } { diff --git a/be/src/olap/calc_delete_bitmap_executor.cpp b/be/src/olap/calc_delete_bitmap_executor.cpp index 51e77a3628..b7d1d5cd3c 100644 --- a/be/src/olap/calc_delete_bitmap_executor.cpp +++ b/be/src/olap/calc_delete_bitmap_executor.cpp @@ -78,10 +78,10 @@ Status CalcDeleteBitmapToken::get_delete_bitmap(DeleteBitmapPtr res_bitmap) { } void CalcDeleteBitmapExecutor::init() { - ThreadPoolBuilder("TabletCalcDeleteBitmapThreadPool") - .set_min_threads(1) - .set_max_threads(config::calc_delete_bitmap_max_thread) - .build(&_thread_pool); + static_cast(ThreadPoolBuilder("TabletCalcDeleteBitmapThreadPool") + .set_min_threads(1) + .set_max_threads(config::calc_delete_bitmap_max_thread) + .build(&_thread_pool)); } std::unique_ptr CalcDeleteBitmapExecutor::create_token() { diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index 2f23264cdb..1f8eb66337 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -115,7 +115,7 @@ Status Compaction::do_compaction(int64_t permits) { if (config::enable_compaction_checksum) { EngineChecksumTask checksum_task(_tablet->tablet_id(), _tablet->schema_hash(), _input_rowsets.back()->end_version(), &checksum_before); - checksum_task.execute(); + static_cast(checksum_task.execute()); } _tablet->data_dir()->disks_compaction_score_increment(permits); @@ -127,7 +127,7 @@ Status Compaction::do_compaction(int64_t permits) { if (config::enable_compaction_checksum) { EngineChecksumTask checksum_task(_tablet->tablet_id(), _tablet->schema_hash(), _input_rowsets.back()->end_version(), &checksum_after); - checksum_task.execute(); + static_cast(checksum_task.execute()); if (checksum_before != checksum_after) { LOG(WARNING) << "Compaction tablet=" << _tablet->tablet_id() << " checksum not consistent" @@ -174,7 +174,7 @@ bool Compaction::is_rowset_tidy(std::string& pre_max_key, const RowsetSharedPtr& // check segment size auto beta_rowset = reinterpret_cast(rhs.get()); std::vector segments_size; - beta_rowset->get_segments_size(&segments_size); + static_cast(beta_rowset->get_segments_size(&segments_size)); for (auto segment_size : segments_size) { // is segment is too small, need to do compaction if (segment_size < min_tidy_size) { @@ -210,7 +210,7 @@ Status Compaction::do_compact_ordered_rowsets() { seg_id += rowset->num_segments(); std::vector key_bounds; - rowset->get_segments_key_bounds(&key_bounds); + static_cast(rowset->get_segments_key_bounds(&key_bounds)); segment_key_bounds.insert(segment_key_bounds.end(), key_bounds.begin(), key_bounds.end()); } // build output rowset diff --git a/be/src/olap/data_dir.cpp b/be/src/olap/data_dir.cpp index 64ed9080ca..c3ba8fa23f 100644 --- a/be/src/olap/data_dir.cpp +++ b/be/src/olap/data_dir.cpp @@ -369,7 +369,7 @@ Status DataDir::load() { // if one rowset load failed, then the total data dir will not be loaded // necessarily check incompatible old format. when there are old metas, it may load to data missing - _check_incompatible_old_format_tablet(); + static_cast(_check_incompatible_old_format_tablet()); std::vector dir_rowset_metas; LOG(INFO) << "begin loading rowset from meta"; @@ -411,7 +411,7 @@ Status DataDir::load() { rowset_meta->serialize(&result); std::string key = ROWSET_PREFIX + tablet_uid.to_string() + "_" + rowset_id.to_string(); - _meta->put(META_COLUMN_FAMILY_INDEX, key, result); + static_cast(_meta->put(META_COLUMN_FAMILY_INDEX, key, result)); } } dir_rowset_metas.push_back(rowset_meta); @@ -481,8 +481,8 @@ Status DataDir::load() { for (int64_t tablet_id : tablet_ids) { TabletSharedPtr tablet = _tablet_manager->get_tablet(tablet_id); if (tablet && tablet->set_tablet_schema_into_rowset_meta()) { - TabletMetaManager::save(this, tablet->tablet_id(), tablet->schema_hash(), - tablet->tablet_meta()); + static_cast(TabletMetaManager::save( + this, tablet->tablet_id(), tablet->schema_hash(), tablet->tablet_meta())); } } @@ -499,7 +499,8 @@ Status DataDir::load() { pending_publish_info_pb.transaction_id(), true); return true; }; - TabletMetaManager::traverse_pending_publish(_meta, load_pending_publish_info_func); + static_cast( + TabletMetaManager::traverse_pending_publish(_meta, load_pending_publish_info_func)); // traverse rowset // 1. add committed rowset to txn map @@ -530,8 +531,9 @@ Status DataDir::load() { rowset_meta->tablet_uid() == tablet->tablet_uid()) { if (!rowset_meta->tablet_schema()) { rowset_meta->set_tablet_schema(tablet->tablet_schema()); - RowsetMetaManager::save(_meta, rowset_meta->tablet_uid(), rowset_meta->rowset_id(), - rowset_meta->get_rowset_pb()); + static_cast(RowsetMetaManager::save(_meta, rowset_meta->tablet_uid(), + rowset_meta->rowset_id(), + rowset_meta->get_rowset_pb())); } Status commit_txn_status = _txn_manager->commit_txn( _meta, rowset_meta->partition_id(), rowset_meta->txn_id(), @@ -551,8 +553,9 @@ Status DataDir::load() { rowset_meta->tablet_uid() == tablet->tablet_uid()) { if (!rowset_meta->tablet_schema()) { rowset_meta->set_tablet_schema(tablet->tablet_schema()); - RowsetMetaManager::save(_meta, rowset_meta->tablet_uid(), rowset_meta->rowset_id(), - rowset_meta->get_rowset_pb()); + static_cast(RowsetMetaManager::save(_meta, rowset_meta->tablet_uid(), + rowset_meta->rowset_id(), + rowset_meta->get_rowset_pb())); } Status publish_status = tablet->add_rowset(rowset); if (!publish_status && !publish_status.is()) { @@ -611,7 +614,7 @@ Status DataDir::load() { } return true; }; - TabletMetaManager::traverse_delete_bitmap(_meta, load_delete_bitmap_func); + static_cast(TabletMetaManager::traverse_delete_bitmap(_meta, load_delete_bitmap_func)); // At startup, we only count these invalid rowset, but do not actually delete it. // The actual delete operation is in StorageEngine::_clean_unused_rowset_metas, @@ -936,7 +939,7 @@ Status DataDir::move_to_trash(const std::string& tablet_path) { if (sub_files.empty()) { LOG(INFO) << "remove empty dir " << source_parent_dir; // no need to exam return status - io::global_local_filesystem()->delete_directory(source_parent_dir); + static_cast(io::global_local_filesystem()->delete_directory(source_parent_dir)); } return Status::OK(); @@ -949,7 +952,8 @@ void DataDir::perform_remote_rowset_gc() { gc_kvs.emplace_back(key, value); return true; }; - _meta->iterate(META_COLUMN_FAMILY_INDEX, REMOTE_ROWSET_GC_PREFIX, traverse_remote_rowset_func); + static_cast(_meta->iterate(META_COLUMN_FAMILY_INDEX, REMOTE_ROWSET_GC_PREFIX, + traverse_remote_rowset_func)); std::vector deleted_keys; for (auto& [key, val] : gc_kvs) { auto rowset_id = key.substr(REMOTE_ROWSET_GC_PREFIX.size()); @@ -980,7 +984,7 @@ void DataDir::perform_remote_rowset_gc() { } } for (const auto& key : deleted_keys) { - _meta->remove(META_COLUMN_FAMILY_INDEX, key); + static_cast(_meta->remove(META_COLUMN_FAMILY_INDEX, key)); } } @@ -991,7 +995,8 @@ void DataDir::perform_remote_tablet_gc() { tablet_gc_kvs.emplace_back(key, value); return true; }; - _meta->iterate(META_COLUMN_FAMILY_INDEX, REMOTE_TABLET_GC_PREFIX, traverse_remote_tablet_func); + static_cast(_meta->iterate(META_COLUMN_FAMILY_INDEX, REMOTE_TABLET_GC_PREFIX, + traverse_remote_tablet_func)); std::vector deleted_keys; for (auto& [key, val] : tablet_gc_kvs) { auto tablet_id = key.substr(REMOTE_TABLET_GC_PREFIX.size()); @@ -1022,7 +1027,7 @@ void DataDir::perform_remote_tablet_gc() { } } for (const auto& key : deleted_keys) { - _meta->remove(META_COLUMN_FAMILY_INDEX, key); + static_cast(_meta->remove(META_COLUMN_FAMILY_INDEX, key)); } } diff --git a/be/src/olap/delete_handler.cpp b/be/src/olap/delete_handler.cpp index df0f6211aa..886d11a872 100644 --- a/be/src/olap/delete_handler.cpp +++ b/be/src/olap/delete_handler.cpp @@ -112,7 +112,7 @@ void DeleteHandler::convert_to_sub_pred_v2(DeletePredicatePB* delete_pred, for (const auto& condition_str : delete_pred->sub_predicates()) { auto* sub_pred = delete_pred->add_sub_predicates_v2(); TCondition condition; - parse_condition(condition_str, &condition); + static_cast(parse_condition(condition_str, &condition)); sub_pred->set_column_unique_id(schema->column(condition.column_name).unique_id()); sub_pred->set_column_name(condition.column_name); sub_pred->set_op(condition.condition_op); diff --git a/be/src/olap/delta_writer.cpp b/be/src/olap/delta_writer.cpp index 8e44377915..2f2ff7cc93 100644 --- a/be/src/olap/delta_writer.cpp +++ b/be/src/olap/delta_writer.cpp @@ -83,7 +83,7 @@ DeltaWriter::~DeltaWriter() { } // cancel and wait all memtables in flush queue to be finished - _memtable_writer->cancel(); + static_cast(_memtable_writer->cancel()); if (_rowset_builder.tablet() != nullptr) { const FlushStatistic& stat = _memtable_writer->get_flush_token_stats(); diff --git a/be/src/olap/delta_writer_v2.cpp b/be/src/olap/delta_writer_v2.cpp index ff1a341f5e..0be2e1751a 100644 --- a/be/src/olap/delta_writer_v2.cpp +++ b/be/src/olap/delta_writer_v2.cpp @@ -93,7 +93,7 @@ DeltaWriterV2::~DeltaWriterV2() { } // cancel and wait all memtables in flush queue to be finished - _memtable_writer->cancel(); + static_cast(_memtable_writer->cancel()); } Status DeltaWriterV2::init() { @@ -123,9 +123,9 @@ Status DeltaWriterV2::init() { context.data_dir = nullptr; _rowset_writer = std::make_shared(_streams); - _rowset_writer->init(context); - _memtable_writer->init(_rowset_writer, _tablet_schema, - _streams[0]->enable_unique_mow(_req.index_id)); + RETURN_IF_ERROR(_rowset_writer->init(context)); + RETURN_IF_ERROR(_memtable_writer->init(_rowset_writer, _tablet_schema, + _streams[0]->enable_unique_mow(_req.index_id))); ExecEnv::GetInstance()->memtable_memory_limiter()->register_writer(_memtable_writer); _is_init = true; _streams.clear(); diff --git a/be/src/olap/full_compaction.cpp b/be/src/olap/full_compaction.cpp index 7feb857723..913956a921 100644 --- a/be/src/olap/full_compaction.cpp +++ b/be/src/olap/full_compaction.cpp @@ -157,8 +157,8 @@ Status FullCompaction::_full_compaction_update_delete_bitmap(const RowsetSharedP int64_t max_version = _tablet->max_version().second; DCHECK(max_version >= rowset->version().second); if (max_version > rowset->version().second) { - _tablet->capture_consistent_rowsets({rowset->version().second + 1, max_version}, - &tmp_rowsets); + static_cast(_tablet->capture_consistent_rowsets( + {rowset->version().second + 1, max_version}, &tmp_rowsets)); } for (const auto& it : tmp_rowsets) { diff --git a/be/src/olap/like_column_predicate.cpp b/be/src/olap/like_column_predicate.cpp index 1d20104ee5..94b65c0eca 100644 --- a/be/src/olap/like_column_predicate.cpp +++ b/be/src/olap/like_column_predicate.cpp @@ -35,7 +35,7 @@ LikeColumnPredicate::LikeColumnPredicate(bool opposite, uint32_t column_id, "TYPE_STRING"); _state = reinterpret_cast( fn_ctx->get_function_state(doris::FunctionContext::THREAD_LOCAL)); - _state->search_state.clone(_like_state); + static_cast(_state->search_state.clone(_like_state)); } template @@ -68,9 +68,9 @@ uint16_t LikeColumnPredicate::evaluate(const vectorized::IColumn& column, uin sel[new_size] = idx; StringRef cell_value = nested_col_ptr->get_shrink_value(data_array[idx]); unsigned char flag = 0; - (_state->scalar_function)( + static_cast((_state->scalar_function)( const_cast(&_like_state), - StringRef(cell_value.data, cell_value.size), pattern, &flag); + StringRef(cell_value.data, cell_value.size), pattern, &flag)); new_size += _opposite ^ flag; } } else { @@ -84,9 +84,9 @@ uint16_t LikeColumnPredicate::evaluate(const vectorized::IColumn& column, uin StringRef cell_value = nested_col_ptr->get_shrink_value(data_array[idx]); unsigned char flag = 0; - (_state->scalar_function)( + static_cast((_state->scalar_function)( const_cast(&_like_state), - StringRef(cell_value.data, cell_value.size), pattern, &flag); + StringRef(cell_value.data, cell_value.size), pattern, &flag)); new_size += _opposite ^ flag; } } @@ -99,9 +99,9 @@ uint16_t LikeColumnPredicate::evaluate(const vectorized::IColumn& column, uin uint16_t idx = sel[i]; sel[new_size] = idx; unsigned char flag = 0; - (_state->scalar_function)( + static_cast((_state->scalar_function)( const_cast(&_like_state), - str_col->get_data_at(idx), pattern, &flag); + str_col->get_data_at(idx), pattern, &flag)); new_size += _opposite ^ flag; } } else { @@ -115,9 +115,9 @@ uint16_t LikeColumnPredicate::evaluate(const vectorized::IColumn& column, uin StringRef cell_value = str_col->get_data_at(idx); unsigned char flag = 0; - (_state->scalar_function)( + static_cast((_state->scalar_function)( const_cast(&_like_state), - StringRef(cell_value.data, cell_value.size), pattern, &flag); + StringRef(cell_value.data, cell_value.size), pattern, &flag)); new_size += _opposite ^ flag; } } @@ -132,9 +132,9 @@ uint16_t LikeColumnPredicate::evaluate(const vectorized::IColumn& column, uin sel[new_size] = idx; StringRef cell_value = nested_col_ptr->get_shrink_value(data_array[idx]); unsigned char flag = 0; - (_state->scalar_function)(const_cast(&_like_state), - StringRef(cell_value.data, cell_value.size), pattern, - &flag); + static_cast((_state->scalar_function)( + const_cast(&_like_state), + StringRef(cell_value.data, cell_value.size), pattern, &flag)); new_size += _opposite ^ flag; } } else { @@ -146,8 +146,9 @@ uint16_t LikeColumnPredicate::evaluate(const vectorized::IColumn& column, uin uint16_t idx = sel[i]; sel[new_size] = idx; unsigned char flag = 0; - (_state->scalar_function)(const_cast(&_like_state), - str_col->get_data_at(idx), pattern, &flag); + static_cast((_state->scalar_function)( + const_cast(&_like_state), + str_col->get_data_at(idx), pattern, &flag)); new_size += _opposite ^ flag; } } diff --git a/be/src/olap/like_column_predicate.h b/be/src/olap/like_column_predicate.h index dca6cf218a..1449815686 100644 --- a/be/src/olap/like_column_predicate.h +++ b/be/src/olap/like_column_predicate.h @@ -111,15 +111,15 @@ private: StringRef cell_value = nested_col_ptr->get_shrink_value(data_array[i]); if constexpr (is_and) { unsigned char flag = 0; - (_state->scalar_function)( + static_cast((_state->scalar_function)( const_cast(&_like_state), - StringRef(cell_value.data, cell_value.size), pattern, &flag); + StringRef(cell_value.data, cell_value.size), pattern, &flag)); flags[i] &= _opposite ^ flag; } else { unsigned char flag = 0; - (_state->scalar_function)( + static_cast((_state->scalar_function)( const_cast(&_like_state), - StringRef(cell_value.data, cell_value.size), pattern, &flag); + StringRef(cell_value.data, cell_value.size), pattern, &flag)); flags[i] = _opposite ^ flag; } } @@ -135,15 +135,15 @@ private: StringRef cell_value = nested_col_ptr->get_shrink_value(data_array[i]); if constexpr (is_and) { unsigned char flag = 0; - (_state->scalar_function)( + static_cast((_state->scalar_function)( const_cast(&_like_state), - StringRef(cell_value.data, cell_value.size), pattern, &flag); + StringRef(cell_value.data, cell_value.size), pattern, &flag)); flags[i] &= _opposite ^ flag; } else { unsigned char flag = 0; - (_state->scalar_function)( + static_cast((_state->scalar_function)( const_cast(&_like_state), - StringRef(cell_value.data, cell_value.size), pattern, &flag); + StringRef(cell_value.data, cell_value.size), pattern, &flag)); flags[i] = _opposite ^ flag; } } diff --git a/be/src/olap/match_predicate.cpp b/be/src/olap/match_predicate.cpp index 61d2572315..12fa2ea55c 100644 --- a/be/src/olap/match_predicate.cpp +++ b/be/src/olap/match_predicate.cpp @@ -64,7 +64,7 @@ Status MatchPredicate::evaluate(const Schema& schema, InvertedIndexIterator* ite } else if (column_desc->type() == FieldType::OLAP_FIELD_TYPE_ARRAY && is_numeric_type(column_desc->get_sub_field(0)->type_info()->type())) { char buf[column_desc->get_sub_field(0)->type_info()->size()]; - column_desc->get_sub_field(0)->from_string(buf, _value); + static_cast(column_desc->get_sub_field(0)->from_string(buf, _value)); RETURN_IF_ERROR(iterator->read_from_inverted_index( column_desc->name(), buf, inverted_index_query_type, num_rows, &roaring, true)); } diff --git a/be/src/olap/memtable_flush_executor.cpp b/be/src/olap/memtable_flush_executor.cpp index f37cdf1294..c0e9fbcf3e 100644 --- a/be/src/olap/memtable_flush_executor.cpp +++ b/be/src/olap/memtable_flush_executor.cpp @@ -167,17 +167,17 @@ void MemTableFlushExecutor::init(const std::vector& data_dirs) { int32_t data_dir_num = data_dirs.size(); size_t min_threads = std::max(1, config::flush_thread_num_per_store); size_t max_threads = data_dir_num * min_threads; - ThreadPoolBuilder("MemTableFlushThreadPool") - .set_min_threads(min_threads) - .set_max_threads(max_threads) - .build(&_flush_pool); + static_cast(ThreadPoolBuilder("MemTableFlushThreadPool") + .set_min_threads(min_threads) + .set_max_threads(max_threads) + .build(&_flush_pool)); min_threads = std::max(1, config::high_priority_flush_thread_num_per_store); max_threads = data_dir_num * min_threads; - ThreadPoolBuilder("MemTableHighPriorityFlushThreadPool") - .set_min_threads(min_threads) - .set_max_threads(max_threads) - .build(&_high_prio_flush_pool); + static_cast(ThreadPoolBuilder("MemTableHighPriorityFlushThreadPool") + .set_min_threads(min_threads) + .set_max_threads(max_threads) + .build(&_high_prio_flush_pool)); } // NOTE: we use SERIAL mode here to ensure all mem-tables from one tablet are flushed in order. diff --git a/be/src/olap/memtable_memory_limiter.cpp b/be/src/olap/memtable_memory_limiter.cpp index 4dc8e1c1d9..4ae75db56a 100644 --- a/be/src/olap/memtable_memory_limiter.cpp +++ b/be/src/olap/memtable_memory_limiter.cpp @@ -133,7 +133,7 @@ void MemTableMemoryLimiter::handle_memtable_flush() { "tablet_id={}, err={}", writer->tablet_id(), st.to_string()); LOG(WARNING) << err_msg; - writer->cancel_with_status(st); + static_cast(writer->cancel_with_status(st)); } mem_consumption_in_picked_writer += mem_size; if (mem_consumption_in_picked_writer > mem_to_flushed) { @@ -194,7 +194,7 @@ void MemTableMemoryLimiter::handle_memtable_flush() { "tablet_id={}, err={}", writer->tablet_id(), st.to_string()); LOG(WARNING) << err_msg; - writer->cancel_with_status(st); + static_cast(writer->cancel_with_status(st)); } } diff --git a/be/src/olap/merger.cpp b/be/src/olap/merger.cpp index 734b81794f..d64f4c307f 100644 --- a/be/src/olap/merger.cpp +++ b/be/src/olap/merger.cpp @@ -350,9 +350,9 @@ Status Merger::vertical_merge_rowsets(TabletSharedPtr tablet, ReaderType reader_ tablet, reader_type, tablet_schema, is_key, column_groups[i], &row_sources_buf, src_rowset_readers, dst_rowset_writer, max_rows_per_segment, stats_output)); if (is_key) { - row_sources_buf.flush(); + static_cast(row_sources_buf.flush()); } - row_sources_buf.seek_to_begin(); + static_cast(row_sources_buf.seek_to_begin()); } // finish compact, build output rowset diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp index 89d7e67f09..4388ac9246 100644 --- a/be/src/olap/olap_server.cpp +++ b/be/src/olap/olap_server.cpp @@ -116,29 +116,29 @@ Status StorageEngine::start_bg_threads() { data_dirs.push_back(tmp_store.second); } - ThreadPoolBuilder("BaseCompactionTaskThreadPool") - .set_min_threads(config::max_base_compaction_threads) - .set_max_threads(config::max_base_compaction_threads) - .build(&_base_compaction_thread_pool); - ThreadPoolBuilder("CumuCompactionTaskThreadPool") - .set_min_threads(config::max_cumu_compaction_threads) - .set_max_threads(config::max_cumu_compaction_threads) - .build(&_cumu_compaction_thread_pool); - ThreadPoolBuilder("SingleReplicaCompactionTaskThreadPool") - .set_min_threads(config::max_single_replica_compaction_threads) - .set_max_threads(config::max_single_replica_compaction_threads) - .build(&_single_replica_compaction_thread_pool); + static_cast(ThreadPoolBuilder("BaseCompactionTaskThreadPool") + .set_min_threads(config::max_base_compaction_threads) + .set_max_threads(config::max_base_compaction_threads) + .build(&_base_compaction_thread_pool)); + static_cast(ThreadPoolBuilder("CumuCompactionTaskThreadPool") + .set_min_threads(config::max_cumu_compaction_threads) + .set_max_threads(config::max_cumu_compaction_threads) + .build(&_cumu_compaction_thread_pool)); + static_cast(ThreadPoolBuilder("SingleReplicaCompactionTaskThreadPool") + .set_min_threads(config::max_single_replica_compaction_threads) + .set_max_threads(config::max_single_replica_compaction_threads) + .build(&_single_replica_compaction_thread_pool)); if (config::enable_segcompaction) { - ThreadPoolBuilder("SegCompactionTaskThreadPool") - .set_min_threads(config::segcompaction_num_threads) - .set_max_threads(config::segcompaction_num_threads) - .build(&_seg_compaction_thread_pool); + static_cast(ThreadPoolBuilder("SegCompactionTaskThreadPool") + .set_min_threads(config::segcompaction_num_threads) + .set_max_threads(config::segcompaction_num_threads) + .build(&_seg_compaction_thread_pool)); } - ThreadPoolBuilder("ColdDataCompactionTaskThreadPool") - .set_min_threads(config::cold_data_compaction_thread_num) - .set_max_threads(config::cold_data_compaction_thread_num) - .build(&_cold_data_compaction_thread_pool); + static_cast(ThreadPoolBuilder("ColdDataCompactionTaskThreadPool") + .set_min_threads(config::cold_data_compaction_thread_num) + .set_max_threads(config::cold_data_compaction_thread_num) + .build(&_cold_data_compaction_thread_pool)); // compaction tasks producer thread RETURN_IF_ERROR(Thread::create( @@ -156,14 +156,14 @@ Status StorageEngine::start_bg_threads() { if (max_checkpoint_thread_num < 0) { max_checkpoint_thread_num = data_dirs.size(); } - ThreadPoolBuilder("TabletMetaCheckpointTaskThreadPool") - .set_max_threads(max_checkpoint_thread_num) - .build(&_tablet_meta_checkpoint_thread_pool); + static_cast(ThreadPoolBuilder("TabletMetaCheckpointTaskThreadPool") + .set_max_threads(max_checkpoint_thread_num) + .build(&_tablet_meta_checkpoint_thread_pool)); - ThreadPoolBuilder("MultiGetTaskThreadPool") - .set_min_threads(config::multi_get_max_threads) - .set_max_threads(config::multi_get_max_threads) - .build(&_bg_multi_get_thread_pool); + static_cast(ThreadPoolBuilder("MultiGetTaskThreadPool") + .set_min_threads(config::multi_get_max_threads) + .set_max_threads(config::multi_get_max_threads) + .build(&_bg_multi_get_thread_pool)); RETURN_IF_ERROR(Thread::create( "StorageEngine", "tablet_checkpoint_tasks_producer_thread", [this, data_dirs]() { this->_tablet_checkpoint_callback(data_dirs); }, @@ -201,10 +201,10 @@ Status StorageEngine::start_bg_threads() { LOG(INFO) << "path scan/gc threads started. number:" << get_stores().size(); } - ThreadPoolBuilder("CooldownTaskThreadPool") - .set_min_threads(config::cooldown_thread_num) - .set_max_threads(config::cooldown_thread_num) - .build(&_cooldown_thread_pool); + static_cast(ThreadPoolBuilder("CooldownTaskThreadPool") + .set_min_threads(config::cooldown_thread_num) + .set_max_threads(config::cooldown_thread_num) + .build(&_cooldown_thread_pool)); LOG(INFO) << "cooldown thread pool started"; RETURN_IF_ERROR(Thread::create( @@ -226,10 +226,10 @@ Status StorageEngine::start_bg_threads() { LOG(INFO) << "cold data compaction producer thread started"; // add tablet publish version thread pool - ThreadPoolBuilder("TabletPublishTxnThreadPool") - .set_min_threads(config::tablet_publish_txn_max_thread) - .set_max_threads(config::tablet_publish_txn_max_thread) - .build(&_tablet_publish_txn_thread_pool); + static_cast(ThreadPoolBuilder("TabletPublishTxnThreadPool") + .set_min_threads(config::tablet_publish_txn_max_thread) + .set_max_threads(config::tablet_publish_txn_max_thread) + .build(&_tablet_publish_txn_thread_pool)); RETURN_IF_ERROR(Thread::create( "StorageEngine", "aync_publish_version_thread", @@ -1157,47 +1157,50 @@ void StorageEngine::_cold_data_compaction_producer_callback() { for (auto& [tablet, score] : tablet_to_compact) { LOG(INFO) << "submit cold data compaction. tablet_id=" << tablet->tablet_id() << " score=" << score; - _cold_data_compaction_thread_pool->submit_func([&, t = std::move(tablet)]() { - auto compaction = std::make_shared(t); - { - std::lock_guard lock(tablet_submitted_mtx); - tablet_submitted.insert(t->tablet_id()); - } - std::unique_lock cold_compaction_lock(t->get_cold_compaction_lock(), - std::try_to_lock); - if (!cold_compaction_lock.owns_lock()) { - LOG(WARNING) << "try cold_compaction_lock failed, tablet_id=" << t->tablet_id(); - } - auto st = compaction->compact(); - { - std::lock_guard lock(tablet_submitted_mtx); - tablet_submitted.erase(t->tablet_id()); - } - if (!st.ok()) { - LOG(WARNING) << "failed to do cold data compaction. tablet_id=" - << t->tablet_id() << " err=" << st; - } - }); + static_cast( + _cold_data_compaction_thread_pool->submit_func([&, t = std::move(tablet)]() { + auto compaction = std::make_shared(t); + { + std::lock_guard lock(tablet_submitted_mtx); + tablet_submitted.insert(t->tablet_id()); + } + std::unique_lock cold_compaction_lock(t->get_cold_compaction_lock(), + std::try_to_lock); + if (!cold_compaction_lock.owns_lock()) { + LOG(WARNING) << "try cold_compaction_lock failed, tablet_id=" + << t->tablet_id(); + } + auto st = compaction->compact(); + { + std::lock_guard lock(tablet_submitted_mtx); + tablet_submitted.erase(t->tablet_id()); + } + if (!st.ok()) { + LOG(WARNING) << "failed to do cold data compaction. tablet_id=" + << t->tablet_id() << " err=" << st; + } + })); } for (auto& [tablet, score] : tablet_to_follow) { LOG(INFO) << "submit to follow cooldown meta. tablet_id=" << tablet->tablet_id() << " score=" << score; - _cold_data_compaction_thread_pool->submit_func([&, t = std::move(tablet)]() { - { - std::lock_guard lock(tablet_submitted_mtx); - tablet_submitted.insert(t->tablet_id()); - } - auto st = t->cooldown(); - { - std::lock_guard lock(tablet_submitted_mtx); - tablet_submitted.erase(t->tablet_id()); - } - if (!st.ok()) { - LOG(WARNING) << "failed to cooldown. tablet_id=" << t->tablet_id() - << " err=" << st; - } - }); + static_cast( + _cold_data_compaction_thread_pool->submit_func([&, t = std::move(tablet)]() { + { + std::lock_guard lock(tablet_submitted_mtx); + tablet_submitted.insert(t->tablet_id()); + } + auto st = t->cooldown(); + { + std::lock_guard lock(tablet_submitted_mtx); + tablet_submitted.erase(t->tablet_id()); + } + if (!st.ok()) { + LOG(WARNING) << "failed to cooldown. tablet_id=" << t->tablet_id() + << " err=" << st; + } + })); } } } @@ -1215,9 +1218,9 @@ void StorageEngine::add_async_publish_task(int64_t partition_id, int64_t tablet_ PendingPublishInfoPB pending_publish_info_pb; pending_publish_info_pb.set_partition_id(partition_id); pending_publish_info_pb.set_transaction_id(transaction_id); - TabletMetaManager::save_pending_publish_info(tablet->data_dir(), tablet->tablet_id(), - publish_version, - pending_publish_info_pb.SerializeAsString()); + static_cast(TabletMetaManager::save_pending_publish_info( + tablet->data_dir(), tablet->tablet_id(), publish_version, + pending_publish_info_pb.SerializeAsString())); } LOG(INFO) << "add pending publish task, tablet_id: " << tablet_id << " version: " << publish_version << " txn_id:" << transaction_id @@ -1278,16 +1281,17 @@ void StorageEngine::_async_publish_callback() { auto async_publish_task = std::make_shared( tablet, partition_id, transaction_id, version); - StorageEngine::instance()->tablet_publish_txn_thread_pool()->submit_func( - [=]() { async_publish_task->handle(); }); + static_cast( + StorageEngine::instance()->tablet_publish_txn_thread_pool()->submit_func( + [=]() { async_publish_task->handle(); })); tablet_iter->second.erase(task_iter); need_removed_tasks.emplace_back(tablet, version); tablet_iter++; } } for (auto& [tablet, publish_version] : need_removed_tasks) { - TabletMetaManager::remove_pending_publish_info(tablet->data_dir(), tablet->tablet_id(), - publish_version); + static_cast(TabletMetaManager::remove_pending_publish_info( + tablet->data_dir(), tablet->tablet_id(), publish_version)); } } } diff --git a/be/src/olap/predicate_creator.h b/be/src/olap/predicate_creator.h index 95548c829c..6298f6f231 100644 --- a/be/src/olap/predicate_creator.h +++ b/be/src/olap/predicate_creator.h @@ -182,7 +182,7 @@ std::unique_ptr> get_creator(const FieldType& ty return std::make_unique>( [](const std::string& condition) { decimal12_t value = {0, 0}; - value.from_string(condition); + static_cast(value.from_string(condition)); return value; }); } diff --git a/be/src/olap/push_handler.cpp b/be/src/olap/push_handler.cpp index 63f9644306..fc13b1692a 100644 --- a/be/src/olap/push_handler.cpp +++ b/be/src/olap/push_handler.cpp @@ -86,7 +86,7 @@ Status PushHandler::process_streaming_ingestion(TabletSharedPtr tablet, const TP Status res = Status::OK(); _request = request; - DescriptorTbl::create(&_pool, _request.desc_tbl, &_desc_tbl); + static_cast(DescriptorTbl::create(&_pool, _request.desc_tbl, &_desc_tbl)); res = _do_streaming_ingestion(tablet, request, push_type, tablet_info_vec); @@ -95,7 +95,8 @@ Status PushHandler::process_streaming_ingestion(TabletSharedPtr tablet, const TP TTabletInfo tablet_info; tablet_info.tablet_id = tablet->tablet_id(); tablet_info.schema_hash = tablet->schema_hash(); - StorageEngine::instance()->tablet_manager()->report_tablet_info(&tablet_info); + static_cast( + StorageEngine::instance()->tablet_manager()->report_tablet_info(&tablet_info)); tablet_info_vec->push_back(tablet_info); } LOG(INFO) << "process realtime push successfully. " @@ -316,7 +317,7 @@ Status PushHandler::_convert_v2(TabletSharedPtr cur_tablet, RowsetSharedPtr* cur } reader->print_profile(); - reader->close(); + static_cast(reader->close()); } if (!rowset_writer->flush().ok()) { @@ -659,8 +660,8 @@ Status PushBrokerReader::_get_next_reader() { std::unordered_map> partition_columns; std::unordered_map missing_columns; - _cur_reader->get_columns(&_name_to_col_type, &_missing_cols); - _cur_reader->set_fill_columns(partition_columns, missing_columns); + static_cast(_cur_reader->get_columns(&_name_to_col_type, &_missing_cols)); + static_cast(_cur_reader->set_fill_columns(partition_columns, missing_columns)); break; } default: diff --git a/be/src/olap/reader.cpp b/be/src/olap/reader.cpp index 7bdfe69206..5f2d0d308b 100644 --- a/be/src/olap/reader.cpp +++ b/be/src/olap/reader.cpp @@ -532,7 +532,8 @@ Status TabletReader::_init_conditions_param(const ReaderParams& read_params) { auto gram_bf_size = tablet_index->get_gram_bf_size(); auto gram_size = tablet_index->get_gram_size(); - segment_v2::BloomFilter::create(segment_v2::NGRAM_BLOOM_FILTER, &ng_bf, gram_bf_size); + static_cast(segment_v2::BloomFilter::create(segment_v2::NGRAM_BLOOM_FILTER, + &ng_bf, gram_bf_size)); NgramTokenExtractor _token_extractor(gram_size); if (_token_extractor.string_like_to_bloom_filter(pattern.data(), pattern.length(), diff --git a/be/src/olap/rowset/beta_rowset.cpp b/be/src/olap/rowset/beta_rowset.cpp index 3a6e0a511d..2f526b8a61 100644 --- a/be/src/olap/rowset/beta_rowset.cpp +++ b/be/src/olap/rowset/beta_rowset.cpp @@ -180,7 +180,8 @@ Status BetaRowset::remove() { LOG(WARNING) << st.to_string(); success = false; } else { - segment_v2::InvertedIndexSearcherCache::instance()->erase(inverted_index_file); + static_cast(segment_v2::InvertedIndexSearcherCache::instance()->erase( + inverted_index_file)); } } } @@ -237,7 +238,7 @@ Status BetaRowset::link_files_to(const std::string& dir, RowsetId new_rowset_id, InvertedIndexDescriptor::get_index_file_name(dst_path, index_id); bool need_to_link = true; if (_schema->skip_write_index_on_load()) { - local_fs->exists(inverted_index_src_file_path, &need_to_link); + static_cast(local_fs->exists(inverted_index_src_file_path, &need_to_link)); if (!need_to_link) { LOG(INFO) << "skip create hard link to not existed file=" << inverted_index_src_file_path; diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp b/be/src/olap/rowset/beta_rowset_writer.cpp index 2019ea7c34..d36d9d90e7 100644 --- a/be/src/olap/rowset/beta_rowset_writer.cpp +++ b/be/src/olap/rowset/beta_rowset_writer.cpp @@ -77,11 +77,11 @@ BetaRowsetWriter::~BetaRowsetWriter() { * when the job is cancelled. Although it is meaningless to continue segcompaction when the job * is cancelled, the objects involved in the job should be preserved during segcompaction to * avoid crashs for memory issues. */ - wait_flying_segcompaction(); + static_cast(wait_flying_segcompaction()); // TODO(lingbin): Should wrapper exception logic, no need to know file ops directly. - if (!_already_built) { // abnormal exit, remove all files generated - _segment_creator.close(); // ensure all files are closed + if (!_already_built) { // abnormal exit, remove all files generated + static_cast(_segment_creator.close()); // ensure all files are closed auto fs = _rowset_meta->fs(); if (fs->type() != io::FileSystemType::LOCAL) { // Remote fs will delete them asynchronously return; @@ -123,7 +123,7 @@ Status BetaRowsetWriter::init(const RowsetWriterContext& rowset_writer_context) std::make_shared(); _context.segment_collector = std::make_shared>(this); _context.file_writer_creator = std::make_shared>(this); - _segment_creator.init(_context); + static_cast(_segment_creator.init(_context)); return Status::OK(); } @@ -335,8 +335,8 @@ Status BetaRowsetWriter::_rename_compacted_indices(int64_t begin, int64_t end, u ret, errno); } // Erase the origin index file cache - InvertedIndexSearcherCache::instance()->erase(src_idx_path); - InvertedIndexSearcherCache::instance()->erase(dst_idx_path); + static_cast(InvertedIndexSearcherCache::instance()->erase(src_idx_path)); + static_cast(InvertedIndexSearcherCache::instance()->erase(dst_idx_path)); } } return Status::OK(); @@ -413,7 +413,7 @@ Status BetaRowsetWriter::add_rowset(RowsetSharedPtr rowset) { _total_index_size += rowset->rowset_meta()->index_disk_size(); _num_segment += rowset->num_segments(); // append key_bounds to current rowset - rowset->get_segments_key_bounds(&_segments_encoded_key_bounds); + static_cast(rowset->get_segments_key_bounds(&_segments_encoded_key_bounds)); // TODO update zonemap if (rowset->rowset_meta()->has_delete_predicate()) { _rowset_meta->set_delete_predicate(rowset->rowset_meta()->delete_predicate()); @@ -515,7 +515,7 @@ RowsetSharedPtr BetaRowsetWriter::build() { } if (_segcompaction_worker.get_file_writer()) { - _segcompaction_worker.get_file_writer()->close(); + static_cast(_segcompaction_worker.get_file_writer()->close()); } } status = _check_segment_number_limit(); @@ -679,7 +679,7 @@ Status BetaRowsetWriter::_create_segment_writer_for_segcompaction( _context.data_dir, _context.max_rows_per_segment, writer_options, _context.mow_context)); if (_segcompaction_worker.get_file_writer() != nullptr) { - _segcompaction_worker.get_file_writer()->close(); + static_cast(_segcompaction_worker.get_file_writer()->close()); } _segcompaction_worker.get_file_writer().reset(file_writer.release()); diff --git a/be/src/olap/rowset/beta_rowset_writer_v2.cpp b/be/src/olap/rowset/beta_rowset_writer_v2.cpp index 3b601eb09b..6d03030880 100644 --- a/be/src/olap/rowset/beta_rowset_writer_v2.cpp +++ b/be/src/olap/rowset/beta_rowset_writer_v2.cpp @@ -72,7 +72,7 @@ Status BetaRowsetWriterV2::init(const RowsetWriterContext& rowset_writer_context _context = rowset_writer_context; _context.segment_collector = std::make_shared>(this); _context.file_writer_creator = std::make_shared>(this); - _segment_creator.init(_context); + static_cast(_segment_creator.init(_context)); return Status::OK(); } diff --git a/be/src/olap/rowset/rowset.h b/be/src/olap/rowset/rowset.h index 22815752f2..57f110733d 100644 --- a/be/src/olap/rowset/rowset.h +++ b/be/src/olap/rowset/rowset.h @@ -248,7 +248,7 @@ public: _rowset_state_machine.rowset_state() == ROWSET_UNLOADING) { // first do close, then change state do_close(); - _rowset_state_machine.on_release(); + static_cast(_rowset_state_machine.on_release()); } } if (_rowset_state_machine.rowset_state() == ROWSET_UNLOADED) { diff --git a/be/src/olap/rowset/rowset_meta_manager.cpp b/be/src/olap/rowset/rowset_meta_manager.cpp index 3428c77abd..0147cbf3d9 100644 --- a/be/src/olap/rowset/rowset_meta_manager.cpp +++ b/be/src/olap/rowset/rowset_meta_manager.cpp @@ -444,7 +444,7 @@ Status RowsetMetaManager::traverse_rowset_metas( const std::string& value) -> bool { std::vector parts; // key format: rst_uuid_rowset_id - split_string(key, '_', &parts); + static_cast(split_string(key, '_', &parts)); if (parts.size() != 3) { LOG(WARNING) << "invalid rowset key:" << key << ", splitted size:" << parts.size(); return true; @@ -452,7 +452,7 @@ Status RowsetMetaManager::traverse_rowset_metas( RowsetId rowset_id; rowset_id.init(parts[2]); std::vector uid_parts; - split_string(parts[1], '-', &uid_parts); + static_cast(split_string(parts[1], '-', &uid_parts)); TabletUid tablet_uid(uid_parts[0], uid_parts[1]); return func(tablet_uid, rowset_id, value); }; diff --git a/be/src/olap/rowset/segcompaction.cpp b/be/src/olap/rowset/segcompaction.cpp index b01f2b363a..84bfdbce4f 100644 --- a/be/src/olap/rowset/segcompaction.cpp +++ b/be/src/olap/rowset/segcompaction.cpp @@ -143,7 +143,7 @@ Status SegcompactionWorker::_delete_original_segments(uint32_t begin, uint32_t e fs->delete_file(idx_path), strings::Substitute("Failed to delete file=$0", idx_path)); // Erase the origin index file cache - InvertedIndexSearcherCache::instance()->erase(idx_path); + static_cast(InvertedIndexSearcherCache::instance()->erase(idx_path)); } } } @@ -229,7 +229,7 @@ Status SegcompactionWorker::_do_compact_segments(SegCompactionCandidatesSharedPt std::vector column_ids = column_groups[i]; writer->clear(); - writer->init(column_ids, is_key); + RETURN_IF_ERROR(writer->init(column_ids, is_key)); auto schema = std::make_shared(ctx.tablet_schema->columns(), column_ids); OlapReaderStatistics reader_stats; std::unique_ptr reader; @@ -246,11 +246,11 @@ Status SegcompactionWorker::_do_compact_segments(SegCompactionCandidatesSharedPt key_bounds)); total_index_size += index_size; if (is_key) { - row_sources_buf.flush(); + RETURN_IF_ERROR(row_sources_buf.flush()); key_merger_stats = merger_stats; key_reader_stats = reader_stats; } - row_sources_buf.seek_to_begin(); + RETURN_IF_ERROR(row_sources_buf.seek_to_begin()); } /* check row num after merge/aggregation */ @@ -265,7 +265,7 @@ Status SegcompactionWorker::_do_compact_segments(SegCompactionCandidatesSharedPt _writer->flush_segment_writer_for_segcompaction(&writer, total_index_size, key_bounds)); if (_file_writer != nullptr) { - _file_writer->close(); + RETURN_IF_ERROR(_file_writer->close()); } RETURN_IF_ERROR(_delete_original_segments(begin, end)); diff --git a/be/src/olap/rowset/segment_creator.cpp b/be/src/olap/rowset/segment_creator.cpp index 458e31992e..c5ae170399 100644 --- a/be/src/olap/rowset/segment_creator.cpp +++ b/be/src/olap/rowset/segment_creator.cpp @@ -179,7 +179,7 @@ int64_t SegmentFlusher::Writer::max_row_to_add(size_t row_avg_size_in_bytes) { } Status SegmentCreator::init(const RowsetWriterContext& rowset_writer_context) { - _segment_flusher.init(rowset_writer_context); + static_cast(_segment_flusher.init(rowset_writer_context)); return Status::OK(); } diff --git a/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.cpp b/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.cpp index dd663b0175..297762362b 100644 --- a/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.cpp +++ b/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.cpp @@ -63,7 +63,8 @@ Status BloomFilterIndexIterator::read_bloom_filter(rowid_t ordinal, DCHECK(num_to_read == num_read); // construct bloom filter StringRef value = column->get_data_at(0); - BloomFilter::create(_reader->_bloom_filter_index_meta->algorithm(), bf, value.size); + static_cast( + BloomFilter::create(_reader->_bloom_filter_index_meta->algorithm(), bf, value.size)); RETURN_IF_ERROR((*bf)->init(value.data, value.size, _reader->_bloom_filter_index_meta->hash_strategy())); return Status::OK(); diff --git a/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.cpp b/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.cpp index 28fb6fb2bb..3afde1340c 100644 --- a/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.cpp +++ b/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.cpp @@ -139,7 +139,7 @@ public: RETURN_IF_ERROR(bf_writer.init()); for (auto& bf : _bfs) { Slice data(bf->data(), bf->size()); - bf_writer.add(&data); + static_cast(bf_writer.add(&data)); } RETURN_IF_ERROR(bf_writer.finish(meta->mutable_bloom_filter())); return Status::OK(); @@ -220,7 +220,7 @@ Status PrimaryKeyBloomFilterIndexWriterImpl::finish(io::FileWriter* file_writer, RETURN_IF_ERROR(bf_writer.init()); for (auto& bf : _bfs) { Slice data(bf->data(), bf->size()); - bf_writer.add(&data); + static_cast(bf_writer.add(&data)); } RETURN_IF_ERROR(bf_writer.finish(meta->mutable_bloom_filter())); return Status::OK(); @@ -239,7 +239,7 @@ NGramBloomFilterIndexWriterImpl::NGramBloomFilterIndexWriterImpl( _bf_size(bf_size), _bf_buffer_size(0), _token_extractor(gram_size) { - BloomFilter::create(NGRAM_BLOOM_FILTER, &_bf, bf_size); + static_cast(BloomFilter::create(NGRAM_BLOOM_FILTER, &_bf, bf_size)); } void NGramBloomFilterIndexWriterImpl::add_values(const void* values, size_t count) { @@ -277,7 +277,7 @@ Status NGramBloomFilterIndexWriterImpl::finish(io::FileWriter* file_writer, RETURN_IF_ERROR(bf_writer.init()); for (auto& bf : _bfs) { Slice data(bf->data(), bf->size()); - bf_writer.add(&data); + static_cast(bf_writer.add(&data)); } RETURN_IF_ERROR(bf_writer.finish(meta->mutable_bloom_filter())); return Status::OK(); diff --git a/be/src/olap/rowset/segment_v2/column_reader.cpp b/be/src/olap/rowset/segment_v2/column_reader.cpp index e98b1124b0..82e1e14539 100644 --- a/be/src/olap/rowset/segment_v2/column_reader.cpp +++ b/be/src/olap/rowset/segment_v2/column_reader.cpp @@ -27,6 +27,7 @@ // IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep +#include "common/status.h" #include "io/fs/file_reader.h" #include "olap/block_column_predicate.h" #include "olap/column_predicate.h" @@ -341,8 +342,8 @@ void ColumnReader::_parse_zone_map(const ZoneMapPB& zone_map, WrapperField* min_ WrapperField* max_value_container) const { // min value and max value are valid if has_not_null is true if (zone_map.has_not_null()) { - min_value_container->from_string(zone_map.min()); - max_value_container->from_string(zone_map.max()); + static_cast(min_value_container->from_string(zone_map.min())); + static_cast(max_value_container->from_string(zone_map.max())); } // for compatible original Cond eval logic if (zone_map.has_null()) { @@ -360,8 +361,8 @@ void ColumnReader::_parse_zone_map_skip_null(const ZoneMapPB& zone_map, WrapperField* max_value_container) const { // min value and max value are valid if has_not_null is true if (zone_map.has_not_null()) { - min_value_container->from_string(zone_map.min()); - max_value_container->from_string(zone_map.max()); + static_cast(min_value_container->from_string(zone_map.min())); + static_cast(max_value_container->from_string(zone_map.max())); } if (!zone_map.has_not_null()) { @@ -974,7 +975,7 @@ Status FileColumnIterator::init(const ColumnIteratorOptions& opts) { // it has bad impact on primary key query. For example, select * from table where pk = 1, and // the table has 2000 columns. if (dict_encoding_type == ColumnReader::UNKNOWN_DICT_ENCODING && opts.is_predicate_column) { - seek_to_ordinal(_reader->num_rows() - 1); + static_cast(seek_to_ordinal(_reader->num_rows() - 1)); _is_all_dict_encoding = _page.is_dict_encoding; _reader->set_dict_encoding_type(_is_all_dict_encoding ? ColumnReader::ALL_DICT_ENCODING @@ -1037,7 +1038,7 @@ void FileColumnIterator::_seek_to_pos_in_page(ParsedPage* page, ordinal_t offset pos_in_data = offset_in_data + skips - skip_nulls; } - page->data_decoder->seek_to_position_in_page(pos_in_data); + static_cast(page->data_decoder->seek_to_position_in_page(pos_in_data)); page->offset_in_page = offset_in_page; } @@ -1157,7 +1158,8 @@ Status FileColumnIterator::read_by_rowids(const rowid_t* rowids, const size_t co } if (!is_null) { - _page.data_decoder->seek_to_position_in_page(origin_index + this_run); + static_cast( + _page.data_decoder->seek_to_position_in_page(origin_index + this_run)); } already_read += this_read_count; diff --git a/be/src/olap/rowset/segment_v2/column_reader.h b/be/src/olap/rowset/segment_v2/column_reader.h index 263432bcde..f287ba5b61 100644 --- a/be/src/olap/rowset/segment_v2/column_reader.h +++ b/be/src/olap/rowset/segment_v2/column_reader.h @@ -167,10 +167,10 @@ public: uint64_t num_rows() const { return _num_rows; } void set_dict_encoding_type(DictEncodingType type) { - _set_dict_encoding_type_once.call([&] { + static_cast(_set_dict_encoding_type_once.call([&] { _dict_encoding_type = type; return Status::OK(); - }); + })); } DictEncodingType get_dict_encoding_type() { return _dict_encoding_type; } diff --git a/be/src/olap/rowset/segment_v2/column_writer.cpp b/be/src/olap/rowset/segment_v2/column_writer.cpp index 7a446f1123..e0f21cb438 100644 --- a/be/src/olap/rowset/segment_v2/column_writer.cpp +++ b/be/src/olap/rowset/segment_v2/column_writer.cpp @@ -709,7 +709,7 @@ Status ScalarColumnWriter::finish_current_page() { data_page_footer->set_num_values(_next_rowid - _first_rowid); data_page_footer->set_nullmap_size(nullmap.slice().size); if (_new_page_callback != nullptr) { - _new_page_callback->put_extra_info_in_page(data_page_footer); + static_cast(_new_page_callback->put_extra_info_in_page(data_page_footer)); } // trying to compress page body OwnedSlice compressed_body; @@ -961,9 +961,9 @@ Status ArrayColumnWriter::append_data(const uint8_t** ptr, size_t num_rows) { // now only support nested type is scala if (writer != nullptr) { //NOTE: use array field name as index field, but item_writer size should be used when moving item_data_ptr - _inverted_index_builder->add_array_values( + static_cast(_inverted_index_builder->add_array_values( _item_writer->get_field()->size(), reinterpret_cast(data), - reinterpret_cast(nested_null_map), offsets_ptr, num_rows); + reinterpret_cast(nested_null_map), offsets_ptr, num_rows)); } } } diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compaction.cpp b/be/src/olap/rowset/segment_v2/inverted_index_compaction.cpp index 7f653a9359..ca9d1c8f9a 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_compaction.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index_compaction.cpp @@ -80,7 +80,7 @@ Status compact_column(int32_t index_id, int src_segment_num, int dest_segment_nu } // delete temporary index_writer_path - fs->delete_directory(index_writer_path.c_str()); + static_cast(fs->delete_directory(index_writer_path.c_str())); return Status::OK(); } } // namespace segment_v2 diff --git a/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp b/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp index 0969a7545a..244e00d71d 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp @@ -50,6 +50,7 @@ #include "CLucene/analysis/standard95/StandardAnalyzer.h" #include "common/config.h" #include "common/logging.h" +#include "common/status.h" #include "io/fs/file_system.h" #include "olap/inverted_index_parser.h" #include "olap/key_coder.h" @@ -282,8 +283,8 @@ Status FullTextIndexReader::query(OlapReaderStatistics* stats, RuntimeState* run } InvertedIndexCacheHandle inverted_index_cache_handle; - InvertedIndexSearcherCache::instance()->get_index_searcher( - _fs, index_dir.c_str(), index_file_name, &inverted_index_cache_handle, stats); + static_cast(InvertedIndexSearcherCache::instance()->get_index_searcher( + _fs, index_dir.c_str(), index_file_name, &inverted_index_cache_handle, stats)); auto index_searcher = inverted_index_cache_handle.get_index_searcher(); std::unique_ptr query; @@ -471,7 +472,8 @@ void FullTextIndexReader::check_null_bitmap(const IndexSearcherPtr& index_search // to avoid open directory additionally for null_bitmap if (!null_bitmap_already_read) { InvertedIndexQueryCacheHandle null_bitmap_cache_handle; - read_null_bitmap(&null_bitmap_cache_handle, index_searcher->getReader()->directory()); + static_cast(read_null_bitmap(&null_bitmap_cache_handle, + index_searcher->getReader()->directory())); null_bitmap_already_read = true; } } @@ -565,14 +567,15 @@ Status StringTypeInvertedIndexReader::query(OlapReaderStatistics* stats, roaring::Roaring result; InvertedIndexCacheHandle inverted_index_cache_handle; - InvertedIndexSearcherCache::instance()->get_index_searcher( - _fs, index_dir.c_str(), index_file_name, &inverted_index_cache_handle, stats); + static_cast(InvertedIndexSearcherCache::instance()->get_index_searcher( + _fs, index_dir.c_str(), index_file_name, &inverted_index_cache_handle, stats)); auto index_searcher = inverted_index_cache_handle.get_index_searcher(); // try to reuse index_searcher's directory to read null_bitmap to cache // to avoid open directory additionally for null_bitmap InvertedIndexQueryCacheHandle null_bitmap_cache_handle; - read_null_bitmap(&null_bitmap_cache_handle, index_searcher->getReader()->directory()); + static_cast( + read_null_bitmap(&null_bitmap_cache_handle, index_searcher->getReader()->directory())); try { if (query_type == InvertedIndexQueryType::MATCH_ANY_QUERY || diff --git a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp index c466378411..a9f7daf4b4 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp @@ -112,7 +112,8 @@ public: // open index searcher into cache auto index_file_name = InvertedIndexDescriptor::get_index_file_name( _segment_file_name, _index_meta->index_id()); - InvertedIndexSearcherCache::instance()->insert(_fs, _directory, index_file_name); + static_cast(InvertedIndexSearcherCache::instance()->insert(_fs, _directory, + index_file_name)); } } } diff --git a/be/src/olap/rowset/segment_v2/page_decoder.h b/be/src/olap/rowset/segment_v2/page_decoder.h index c059ac4b83..19dfee3abf 100644 --- a/be/src/olap/rowset/segment_v2/page_decoder.h +++ b/be/src/olap/rowset/segment_v2/page_decoder.h @@ -67,7 +67,7 @@ public: virtual size_t seek_forward(size_t n) { size_t step = std::min(n, count() - current_index()); DCHECK_GE(step, 0); - seek_to_position_in_page(current_index() + step); + static_cast(seek_to_position_in_page(current_index() + step)); return step; } diff --git a/be/src/olap/rowset/segment_v2/plain_page.h b/be/src/olap/rowset/segment_v2/plain_page.h index ca2029245a..d1a62dc331 100644 --- a/be/src/olap/rowset/segment_v2/plain_page.h +++ b/be/src/olap/rowset/segment_v2/plain_page.h @@ -125,7 +125,7 @@ public: _parsed = true; - seek_to_position_in_page(0); + static_cast(seek_to_position_in_page(0)); return Status::OK(); } diff --git a/be/src/olap/rowset/segment_v2/rle_page.h b/be/src/olap/rowset/segment_v2/rle_page.h index 7f98b6e76f..102b6d297e 100644 --- a/be/src/olap/rowset/segment_v2/rle_page.h +++ b/be/src/olap/rowset/segment_v2/rle_page.h @@ -180,7 +180,7 @@ public: _rle_decoder = RleDecoder((uint8_t*)_data.data + RLE_PAGE_HEADER_SIZE, _data.size - RLE_PAGE_HEADER_SIZE, _bit_width); - seek_to_position_in_page(0); + static_cast(seek_to_position_in_page(0)); return Status::OK(); } diff --git a/be/src/olap/rowset/segment_v2/segment_writer.cpp b/be/src/olap/rowset/segment_v2/segment_writer.cpp index 988b39f02c..9508557d0e 100644 --- a/be/src/olap/rowset/segment_v2/segment_writer.cpp +++ b/be/src/olap/rowset/segment_v2/segment_writer.cpp @@ -30,6 +30,7 @@ #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" // LOG +#include "common/status.h" #include "gutil/port.h" #include "io/fs/file_writer.h" #include "olap/data_dir.h" @@ -602,8 +603,8 @@ Status SegmentWriter::fill_missing_columns(vectorized::MutableColumns& mutable_f auto default_value = _tablet_schema->column(cids_missing[i]).default_value(); vectorized::ReadBuffer rb(const_cast(default_value.c_str()), default_value.size()); - old_value_block.get_by_position(i).type->from_string( - rb, mutable_default_value_columns[i].get()); + static_cast(old_value_block.get_by_position(i).type->from_string( + rb, mutable_default_value_columns[i].get())); } } } diff --git a/be/src/olap/rowset_builder.cpp b/be/src/olap/rowset_builder.cpp index 1de133d396..82486898c3 100644 --- a/be/src/olap/rowset_builder.cpp +++ b/be/src/olap/rowset_builder.cpp @@ -137,8 +137,8 @@ Status RowsetBuilder::init() { _tablet->exceed_version_limit(config::max_tablet_version_num - 100) && !MemInfo::is_exceed_soft_mem_limit(GB_EXCHANGE_BYTE)) { //trigger compaction - StorageEngine::instance()->submit_compaction_task( - _tablet, CompactionType::CUMULATIVE_COMPACTION, true); + static_cast(StorageEngine::instance()->submit_compaction_task( + _tablet, CompactionType::CUMULATIVE_COMPACTION, true)); if (_tablet->version_count() > config::max_tablet_version_num) { return Status::Error( "failed to init rowset builder. version count: {}, exceed limit: {}, tablet: " diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp index 33a9f6fee8..abc17fb0bc 100644 --- a/be/src/olap/schema_change.cpp +++ b/be/src/olap/schema_change.cpp @@ -171,7 +171,7 @@ public: if (i == rows - 1 || finalized_block.rows() == ALTER_TABLE_BATCH_SIZE) { *merged_rows -= finalized_block.rows(); - rowset_writer->add_block(&finalized_block); + static_cast(rowset_writer->add_block(&finalized_block)); finalized_block.clear_column_data(); } } @@ -203,7 +203,7 @@ public: column->insert_from(*row_ref.get_column(idx), row_ref.position); } } - rowset_writer->add_block(&finalized_block); + static_cast(rowset_writer->add_block(&finalized_block)); finalized_block.clear_column_data(); } } @@ -482,7 +482,7 @@ Status VSchemaChangeDirectly::_inner_process(RowsetReaderSharedPtr rowset_reader vectorized::Block::create_unique(new_tablet->tablet_schema()->create_block()); auto ref_block = vectorized::Block::create_unique(base_tablet_schema->create_block()); - rowset_reader->next_block(ref_block.get()); + static_cast(rowset_reader->next_block(ref_block.get())); if (ref_block->rows() == 0) { break; } @@ -552,7 +552,7 @@ Status VSchemaChangeWithSorting::_inner_process(RowsetReaderSharedPtr rowset_rea do { auto ref_block = vectorized::Block::create_unique(base_tablet_schema->create_block()); - rowset_reader->next_block(ref_block.get()); + static_cast(rowset_reader->next_block(ref_block.get())); if (ref_block->rows() == 0) { break; } @@ -798,7 +798,7 @@ Status SchemaChangeHandler::_do_process_alter_tablet_v2(const TAlterTabletReqV2& } } std::vector empty_vec; - new_tablet->modify_rowsets(empty_vec, rowsets_to_delete); + static_cast(new_tablet->modify_rowsets(empty_vec, rowsets_to_delete)); // inherit cumulative_layer_point from base_tablet // check if new_tablet.ce_point > base_tablet.ce_point? new_tablet->set_cumulative_layer_point(-1); @@ -815,7 +815,7 @@ Status SchemaChangeHandler::_do_process_alter_tablet_v2(const TAlterTabletReqV2& } // acquire data sources correspond to history versions - base_tablet->capture_rs_readers(versions_to_be_changed, &rs_splits); + static_cast(base_tablet->capture_rs_readers(versions_to_be_changed, &rs_splits)); if (rs_splits.empty()) { res = Status::Error( "fail to acquire all data sources. version_num={}, data_source_num={}", @@ -864,7 +864,8 @@ Status SchemaChangeHandler::_do_process_alter_tablet_v2(const TAlterTabletReqV2& } SchemaChangeParams sc_params; - DescriptorTbl::create(&sc_params.pool, request.desc_tbl, &sc_params.desc_tbl); + static_cast( + DescriptorTbl::create(&sc_params.pool, request.desc_tbl, &sc_params.desc_tbl)); sc_params.base_tablet = base_tablet; sc_params.new_tablet = new_tablet; sc_params.ref_rowset_readers.reserve(rs_splits.size()); @@ -1347,8 +1348,8 @@ Status SchemaChangeHandler::_init_column_mapping(ColumnMapping* column_mapping, if (column_schema.is_nullable() && value.length() == 0) { column_mapping->default_value->set_null(); } else { - column_mapping->default_value->from_string(value, column_schema.precision(), - column_schema.frac()); + static_cast(column_mapping->default_value->from_string( + value, column_schema.precision(), column_schema.frac())); } return Status::OK(); diff --git a/be/src/olap/single_replica_compaction.cpp b/be/src/olap/single_replica_compaction.cpp index 5bb605cb00..7ace227962 100644 --- a/be/src/olap/single_replica_compaction.cpp +++ b/be/src/olap/single_replica_compaction.cpp @@ -605,7 +605,7 @@ Status SingleReplicaCompaction::_finish_clone(const string& clone_dir, for (auto& file : linked_success_files) { paths.emplace_back(file); } - io::global_local_filesystem()->batch_delete(paths); + static_cast(io::global_local_filesystem()->batch_delete(paths)); } } // clear clone dir diff --git a/be/src/olap/snapshot_manager.cpp b/be/src/olap/snapshot_manager.cpp index 7495d09e43..a2b7276918 100644 --- a/be/src/olap/snapshot_manager.cpp +++ b/be/src/olap/snapshot_manager.cpp @@ -289,7 +289,7 @@ Status SnapshotManager::_rename_rowset_id(const RowsetMetaPB& rs_meta_pb, } RETURN_IF_ERROR(new_rowset->load(false)); new_rowset->rowset_meta()->to_rowset_pb(new_rs_meta_pb); - org_rowset->remove(); + RETURN_IF_ERROR(org_rowset->remove()); return Status::OK(); } diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp index 97241b2638..f17a6de841 100644 --- a/be/src/olap/storage_engine.cpp +++ b/be/src/olap/storage_engine.cpp @@ -47,6 +47,7 @@ #include "common/config.h" #include "common/logging.h" +#include "common/status.h" #include "gutil/strings/substitute.h" #include "io/fs/local_file_system.h" #include "olap/base_compaction.h" @@ -328,7 +329,7 @@ Status StorageEngine::get_all_data_dir_info(std::vector* data_dir_i std::lock_guard l(_store_lock); for (auto& it : _store_map) { if (need_update) { - it.second->update_capacity(); + static_cast(it.second->update_capacity()); } path_map.emplace(it.first, it.second->get_dir_info()); } @@ -424,7 +425,7 @@ Status StorageEngine::_check_all_root_path_cluster_id() { // write cluster id into cluster_id_path if get effective cluster id success if (_effective_cluster_id != -1 && !_is_all_cluster_id_exist) { - set_cluster_id(_effective_cluster_id); + static_cast(set_cluster_id(_effective_cluster_id)); } return Status::OK(); @@ -692,8 +693,8 @@ void StorageEngine::clear_transaction_task(const TTransactionId transaction_id, << ", tablet_uid=" << tablet_info.first.tablet_uid; continue; } - StorageEngine::instance()->txn_manager()->delete_txn(partition_id, tablet, - transaction_id); + static_cast(StorageEngine::instance()->txn_manager()->delete_txn( + partition_id, tablet, transaction_id)); } } LOG(INFO) << "finish to clear transaction task. transaction_id=" << transaction_id; @@ -766,7 +767,7 @@ Status StorageEngine::start_trash_sweep(double* usage, bool ignore_guard) { } // clear expire incremental rowset, move deleted tablet to trash - _tablet_manager->start_trash_sweep(); + static_cast(_tablet_manager->start_trash_sweep()); // clean rubbish transactions _clean_unused_txns(); @@ -848,10 +849,11 @@ void StorageEngine::_clean_unused_rowset_metas() { }; auto data_dirs = get_stores(); for (auto data_dir : data_dirs) { - RowsetMetaManager::traverse_rowset_metas(data_dir->get_meta(), clean_rowset_func); + static_cast( + RowsetMetaManager::traverse_rowset_metas(data_dir->get_meta(), clean_rowset_func)); for (auto& rowset_meta : invalid_rowset_metas) { - RowsetMetaManager::remove(data_dir->get_meta(), rowset_meta->tablet_uid(), - rowset_meta->rowset_id()); + static_cast(RowsetMetaManager::remove( + data_dir->get_meta(), rowset_meta->tablet_uid(), rowset_meta->rowset_id())); } LOG(INFO) << "remove " << invalid_rowset_metas.size() << " invalid rowset meta from dir: " << data_dir->path(); @@ -882,9 +884,10 @@ void StorageEngine::_clean_unused_binlog_metas() { }; auto data_dirs = get_stores(); for (auto data_dir : data_dirs) { - RowsetMetaManager::traverse_binlog_metas(data_dir->get_meta(), unused_binlog_collector); + static_cast(RowsetMetaManager::traverse_binlog_metas(data_dir->get_meta(), + unused_binlog_collector)); for (const auto& suffix : unused_binlog_key_suffixes) { - RowsetMetaManager::remove_binlog(data_dir->get_meta(), suffix); + static_cast(RowsetMetaManager::remove_binlog(data_dir->get_meta(), suffix)); } LOG(INFO) << "remove " << unused_binlog_key_suffixes.size() << " invalid binlog meta from dir: " << data_dir->path(); @@ -907,9 +910,11 @@ void StorageEngine::_clean_unused_delete_bitmap() { }; auto data_dirs = get_stores(); for (auto data_dir : data_dirs) { - TabletMetaManager::traverse_delete_bitmap(data_dir->get_meta(), clean_delete_bitmap_func); + static_cast(TabletMetaManager::traverse_delete_bitmap(data_dir->get_meta(), + clean_delete_bitmap_func)); for (auto id : removed_tablets) { - TabletMetaManager::remove_old_version_delete_bitmap(data_dir, id, INT64_MAX); + static_cast( + TabletMetaManager::remove_old_version_delete_bitmap(data_dir, id, INT64_MAX)); } LOG(INFO) << "removed invalid delete bitmap from dir: " << data_dir->path() << ", deleted tablets size: " << removed_tablets.size(); @@ -930,10 +935,11 @@ void StorageEngine::_clean_unused_pending_publish_info() { }; auto data_dirs = get_stores(); for (auto data_dir : data_dirs) { - TabletMetaManager::traverse_pending_publish(data_dir->get_meta(), - clean_pending_publish_info_func); + static_cast(TabletMetaManager::traverse_pending_publish( + data_dir->get_meta(), clean_pending_publish_info_func)); for (auto& [tablet_id, publish_version] : removed_infos) { - TabletMetaManager::remove_pending_publish_info(data_dir, tablet_id, publish_version); + static_cast(TabletMetaManager::remove_pending_publish_info(data_dir, tablet_id, + publish_version)); } LOG(INFO) << "removed invalid pending publish info from dir: " << data_dir->path() << ", deleted pending publish info size: " << removed_infos.size(); @@ -1385,7 +1391,7 @@ bool StorageEngine::add_broken_path(std::string path) { std::lock_guard lock(_broken_paths_mutex); auto success = _broken_paths.emplace(path).second; if (success) { - _persist_broken_paths(); + static_cast(_persist_broken_paths()); } return success; } @@ -1394,7 +1400,7 @@ bool StorageEngine::remove_broken_path(std::string path) { std::lock_guard lock(_broken_paths_mutex); auto count = _broken_paths.erase(path); if (count > 0) { - _persist_broken_paths(); + static_cast(_persist_broken_paths()); } return count > 0; } diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index 3c91880c3f..064aa97392 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -190,11 +190,11 @@ WriteCooldownMetaExecutors::WriteCooldownMetaExecutors(size_t executor_nums) : _executor_nums(executor_nums) { for (size_t i = 0; i < _executor_nums; i++) { std::unique_ptr pool; - ThreadPoolBuilder("WriteCooldownMetaExecutor") - .set_min_threads(1) - .set_max_threads(1) - .set_max_queue_size(std::numeric_limits::max()) - .build(&pool); + static_cast(ThreadPoolBuilder("WriteCooldownMetaExecutor") + .set_min_threads(1) + .set_max_threads(1) + .set_max_queue_size(std::numeric_limits::max()) + .build(&pool)); _executors.emplace_back(std::move(pool)); } } @@ -450,7 +450,7 @@ Status Tablet::add_rowset(RowsetSharedPtr rowset) { } } std::vector empty_vec; - modify_rowsets(empty_vec, rowsets_to_delete); + static_cast(modify_rowsets(empty_vec, rowsets_to_delete)); ++_newly_created_rowset_num; return Status::OK(); } @@ -1172,12 +1172,12 @@ void Tablet::delete_all_files() { // Release resources like memory and disk space. std::shared_lock rdlock(_meta_lock); for (auto it : _rs_version_map) { - it.second->remove(); + static_cast(it.second->remove()); } _rs_version_map.clear(); for (auto it : _stale_rs_version_map) { - it.second->remove(); + static_cast(it.second->remove()); } _stale_rs_version_map.clear(); } @@ -1517,7 +1517,8 @@ bool Tablet::do_tablet_meta_checkpoint() { } if (RowsetMetaManager::check_rowset_meta(_data_dir->get_meta(), tablet_uid(), rs_meta->rowset_id())) { - RowsetMetaManager::remove(_data_dir->get_meta(), tablet_uid(), rs_meta->rowset_id()); + static_cast(RowsetMetaManager::remove(_data_dir->get_meta(), tablet_uid(), + rs_meta->rowset_id())); VLOG_NOTICE << "remove rowset id from meta store because it is already persistent with " << "tablet meta, rowset_id=" << rs_meta->rowset_id(); } @@ -1532,7 +1533,8 @@ bool Tablet::do_tablet_meta_checkpoint() { } if (RowsetMetaManager::check_rowset_meta(_data_dir->get_meta(), tablet_uid(), rs_meta->rowset_id())) { - RowsetMetaManager::remove(_data_dir->get_meta(), tablet_uid(), rs_meta->rowset_id()); + static_cast(RowsetMetaManager::remove(_data_dir->get_meta(), tablet_uid(), + rs_meta->rowset_id())); VLOG_NOTICE << "remove rowset id from meta store because it is already persistent with " << "tablet meta, rowset_id=" << rs_meta->rowset_id(); } @@ -1540,8 +1542,8 @@ bool Tablet::do_tablet_meta_checkpoint() { } if (keys_type() == UNIQUE_KEYS && enable_unique_key_merge_on_write()) { - TabletMetaManager::remove_old_version_delete_bitmap(_data_dir, tablet_id(), - max_version_unlocked().second); + static_cast(TabletMetaManager::remove_old_version_delete_bitmap( + _data_dir, tablet_id(), max_version_unlocked().second)); } _newly_created_rowset_num = 0; @@ -2115,8 +2117,8 @@ Status Tablet::_cooldown_data() { new_rowset_meta->set_creation_time(time(nullptr)); UniqueId cooldown_meta_id = UniqueId::gen_uid(); RowsetSharedPtr new_rowset; - RowsetFactory::create_rowset(_schema, remote_tablet_path(tablet_id()), new_rowset_meta, - &new_rowset); + static_cast(RowsetFactory::create_rowset(_schema, remote_tablet_path(tablet_id()), + new_rowset_meta, &new_rowset)); { std::unique_lock meta_wlock(_meta_lock); @@ -2152,7 +2154,7 @@ Status Tablet::_read_cooldown_meta(const std::shared_ptr& size_t bytes_read; auto buf = std::unique_ptr(new uint8_t[file_size]); RETURN_IF_ERROR(tablet_meta_reader->read_at(0, {buf.get(), file_size}, &bytes_read)); - tablet_meta_reader->close(); + RETURN_IF_ERROR(tablet_meta_reader->close()); if (!tablet_meta_pb->ParseFromArray(buf.get(), file_size)) { return Status::InternalError("malformed tablet meta, path={}/{}", fs->root_path().native(), remote_meta_path); @@ -2321,7 +2323,7 @@ Status Tablet::_follow_cooldowned_data() { auto rs_meta = std::make_shared(); rs_meta->init_from_pb(*rs_pb_it); RowsetSharedPtr rs; - RowsetFactory::create_rowset(_schema, _tablet_path, rs_meta, &rs); + static_cast(RowsetFactory::create_rowset(_schema, _tablet_path, rs_meta, &rs)); to_add.push_back(std::move(rs)); } // Note: We CANNOT call `modify_rowsets` here because `modify_rowsets` cannot process version graph correctly. @@ -2667,7 +2669,7 @@ Status Tablet::_get_segment_column_iterator( .stats = stats, .io_ctx = io::IOContext {.reader_type = ReaderType::READER_QUERY}, }; - (*column_iterator)->init(opt); + static_cast((*column_iterator)->init(opt)); return Status::OK(); } @@ -2903,7 +2905,7 @@ Status Tablet::calc_segment_delete_bitmap(RowsetSharedPtr rowset, vectorized::Block ordered_block = block.clone_empty(); uint32_t pos = 0; - seg->load_pk_index_and_bf(); // We need index blocks to iterate + static_cast(seg->load_pk_index_and_bf()); // We need index blocks to iterate auto pk_idx = seg->get_primary_key_index(); int total = pk_idx->num_rows(); uint32_t row_id = 0; @@ -3216,7 +3218,7 @@ void Tablet::_rowset_ids_difference(const RowsetIdUnorderedSet& cur, Status Tablet::update_delete_bitmap_without_lock(const RowsetSharedPtr& rowset) { int64_t cur_version = rowset->end_version(); std::vector segments; - _load_rowset_segments(rowset, &segments); + static_cast(_load_rowset_segments(rowset, &segments)); // If this rowset does not have a segment, there is no need for an update. if (segments.empty()) { @@ -3308,7 +3310,7 @@ Status Tablet::update_delete_bitmap(const RowsetSharedPtr& rowset, int64_t cur_version = rowset->start_version(); std::vector segments; - _load_rowset_segments(rowset, &segments); + static_cast(_load_rowset_segments(rowset, &segments)); { std::shared_lock meta_rlock(_meta_lock); @@ -3425,7 +3427,7 @@ Status Tablet::check_rowid_conversion( return Status::OK(); } std::vector dst_segments; - _load_rowset_segments(dst_rowset, &dst_segments); + static_cast(_load_rowset_segments(dst_rowset, &dst_segments)); std::unordered_map, HashOfRowsetId> input_rowsets_segment; @@ -3434,7 +3436,7 @@ Status Tablet::check_rowid_conversion( std::vector& segments = input_rowsets_segment[src_rowset->rowset_id()]; if (segments.empty()) { - _load_rowset_segments(src_rowset, &segments); + static_cast(_load_rowset_segments(src_rowset, &segments)); } for (auto& [src, dst] : locations) { std::string src_key; @@ -3655,7 +3657,7 @@ void Tablet::gc_binlogs(int64_t version) { } } if (!remove_binlog_files_failed) { - meta->remove(META_COLUMN_FAMILY_INDEX, wait_for_deleted_binlog_keys); + static_cast(meta->remove(META_COLUMN_FAMILY_INDEX, wait_for_deleted_binlog_keys)); } } diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp index d1cf3c30d9..37232b472d 100644 --- a/be/src/olap/tablet_manager.cpp +++ b/be/src/olap/tablet_manager.cpp @@ -181,7 +181,7 @@ Status TabletManager::_add_tablet_unlocked(TTabletId tablet_id, const TabletShar res = _add_tablet_to_map_unlocked(tablet_id, tablet, update_meta, keep_files, true /*drop_old*/, profile); } else { - tablet->set_tablet_state(TABLET_SHUTDOWN); + static_cast(tablet->set_tablet_state(TABLET_SHUTDOWN)); tablet->save_meta(); COUNTER_UPDATE(ADD_CHILD_TIMER(profile, "SaveMeta", "AddTablet"), static_cast(watch.reset())); @@ -402,7 +402,7 @@ TabletSharedPtr TabletManager::_internal_create_tablet_unlocked( // if this is a new alter tablet, has to set its state to not ready // because schema change handler depends on it to check whether history data // convert finished - tablet->set_tablet_state(TabletState::TABLET_NOTREADY); + static_cast(tablet->set_tablet_state(TabletState::TABLET_NOTREADY)); } // Add tablet to StorageEngine will make it visible to user // Will persist tablet meta @@ -439,7 +439,7 @@ TabletSharedPtr TabletManager::_internal_create_tablet_unlocked( } } else { tablet->delete_all_files(); - TabletMetaManager::remove(data_dir, new_tablet_id, new_schema_hash); + static_cast(TabletMetaManager::remove(data_dir, new_tablet_id, new_schema_hash)); COUNTER_UPDATE(ADD_CHILD_TIMER(profile, "RemoveTabletFiles", parent_timer_name), static_cast(watch.reset())); } @@ -572,7 +572,7 @@ Status TabletManager::_drop_tablet_unlocked(TTabletId tablet_id, TReplicaId repl // If update meta directly here, other thread may override the meta // and the tablet will be loaded at restart time. // To avoid this exception, we first set the state of the tablet to `SHUTDOWN`. - to_drop_tablet->set_tablet_state(TABLET_SHUTDOWN); + static_cast(to_drop_tablet->set_tablet_state(TABLET_SHUTDOWN)); // We must record unused remote rowsets path info to OlapMeta before tablet state is marked as TABLET_SHUTDOWN in OlapMeta, // otherwise if BE shutdown after saving tablet state, these remote rowsets path info will lost. if (is_drop_table_or_partition) { @@ -980,7 +980,7 @@ Status TabletManager::load_tablet_from_dir(DataDir* store, TTabletId tablet_id, // should change tablet uid when tablet object changed tablet_meta->set_tablet_uid(std::move(tablet_uid)); std::string meta_binary; - tablet_meta->serialize(&meta_binary); + static_cast(tablet_meta->serialize(&meta_binary)); RETURN_NOT_OK_STATUS_WITH_WARN( load_tablet_from_meta(store, tablet_id, schema_hash, meta_binary, true, force, restore, true), @@ -1099,7 +1099,7 @@ Status TabletManager::start_trash_sweep() { if (exists) { // take snapshot of tablet meta auto meta_file_path = fmt::format("{}/{}.hdr", tablet_path, (*it)->tablet_id()); - (*it)->tablet_meta()->save(meta_file_path); + static_cast((*it)->tablet_meta()->save(meta_file_path)); LOG(INFO) << "start to move tablet to trash. " << tablet_path; Status rm_st = (*it)->data_dir()->move_to_trash(tablet_path); if (!rm_st.ok()) { @@ -1109,8 +1109,8 @@ Status TabletManager::start_trash_sweep() { } } // remove tablet meta - TabletMetaManager::remove((*it)->data_dir(), (*it)->tablet_id(), - (*it)->schema_hash()); + static_cast(TabletMetaManager::remove((*it)->data_dir(), (*it)->tablet_id(), + (*it)->schema_hash())); LOG(INFO) << "successfully move tablet to trash. " << "tablet_id=" << (*it)->tablet_id() << ", schema_hash=" << (*it)->schema_hash() @@ -1476,7 +1476,7 @@ std::set TabletManager::check_all_tablet_segment(bool repair) { LOG(WARNING) << "Bad tablet has be removed. tablet_id=" << tablet_id; } else { const auto& tablet = it->second; - tablet->set_tablet_state(TABLET_SHUTDOWN); + static_cast(tablet->set_tablet_state(TABLET_SHUTDOWN)); tablet->save_meta(); { std::lock_guard shutdown_tablets_wrlock( diff --git a/be/src/olap/tablet_meta_manager.cpp b/be/src/olap/tablet_meta_manager.cpp index 20e5747e2f..ca14df587a 100644 --- a/be/src/olap/tablet_meta_manager.cpp +++ b/be/src/olap/tablet_meta_manager.cpp @@ -29,6 +29,7 @@ #include #include "common/logging.h" +#include "common/status.h" #include "gutil/endian.h" #include "json2pb/json_to_pb.h" #include "json2pb/pb_to_json.h" @@ -91,7 +92,7 @@ Status TabletMetaManager::save(DataDir* store, TTabletId tablet_id, TSchemaHash TabletMetaSharedPtr tablet_meta, const string& header_prefix) { std::string key = fmt::format("{}{}_{}", header_prefix, tablet_id, schema_hash); std::string value; - tablet_meta->serialize(&value); + static_cast(tablet_meta->serialize(&value)); OlapMeta* meta = store->get_meta(); VLOG_NOTICE << "save tablet meta" << ", key:" << key << ", meta length:" << value.length(); @@ -126,7 +127,7 @@ Status TabletMetaManager::traverse_headers( std::vector parts; // old format key format: "hdr_" + tablet_id + "_" + schema_hash 0.11 // new format key format: "tabletmeta_" + tablet_id + "_" + schema_hash 0.10 - split_string(key, '_', &parts); + static_cast(split_string(key, '_', &parts)); if (parts.size() != 3) { LOG(WARNING) << "invalid tablet_meta key:" << key << ", split size:" << parts.size(); return true; @@ -186,7 +187,7 @@ Status TabletMetaManager::traverse_pending_publish( auto traverse_header_func = [&func](const std::string& key, const std::string& value) -> bool { std::vector parts; // key format: "ppi_" + tablet_id + "_" + publish_version - split_string(key, '_', &parts); + static_cast(split_string(key, '_', &parts)); if (parts.size() != 3) { LOG(WARNING) << "invalid pending publish info key:" << key << ", split size:" << parts.size(); diff --git a/be/src/olap/task/engine_clone_task.cpp b/be/src/olap/task/engine_clone_task.cpp index 4eb43864be..0d19e78cf7 100644 --- a/be/src/olap/task/engine_clone_task.cpp +++ b/be/src/olap/task/engine_clone_task.cpp @@ -151,7 +151,7 @@ Status EngineCloneTask::_do_clone() { if (missed_versions.empty()) { LOG(INFO) << "missed version size = 0, skip clone and return success. tablet_id=" << _clone_req.tablet_id << " replica_id=" << _clone_req.replica_id; - _set_tablet_info(is_new_tablet); + static_cast(_set_tablet_info(is_new_tablet)); return Status::OK(); } @@ -215,7 +215,7 @@ Status EngineCloneTask::_do_clone() { // clone success, delete .hdr file because tablet meta is stored in rocksdb string header_path = TabletMeta::construct_header_file_path(tablet_dir, _clone_req.tablet_id); - io::global_local_filesystem()->delete_file(header_path); + static_cast(io::global_local_filesystem()->delete_file(header_path)); } return _set_tablet_info(is_new_tablet); } @@ -587,7 +587,7 @@ Status EngineCloneTask::_finish_clone(Tablet* tablet, const std::string& clone_d for (auto& file : linked_success_files) { paths.emplace_back(file); } - io::global_local_filesystem()->batch_delete(paths); + static_cast(io::global_local_filesystem()->batch_delete(paths)); } }}; /// Traverse all downloaded clone files in CLONE dir. diff --git a/be/src/olap/task/engine_storage_migration_task.cpp b/be/src/olap/task/engine_storage_migration_task.cpp index f76c3ee208..0c0dc68d32 100644 --- a/be/src/olap/task/engine_storage_migration_task.cpp +++ b/be/src/olap/task/engine_storage_migration_task.cpp @@ -289,7 +289,7 @@ Status EngineStorageMigrationTask::_migrate() { if (!res.ok()) { // we should remove the dir directly for avoid disk full of junk data, and it's safe to remove - io::global_local_filesystem()->delete_directory(full_path); + static_cast(io::global_local_filesystem()->delete_directory(full_path)); } return res; } diff --git a/be/src/olap/task/index_builder.cpp b/be/src/olap/task/index_builder.cpp index 9c33ceafb2..5f0c1be76e 100644 --- a/be/src/olap/task/index_builder.cpp +++ b/be/src/olap/task/index_builder.cpp @@ -131,7 +131,7 @@ Status IndexBuilder::update_inverted_index_info() { rowset_meta->set_segments_overlap(input_rowset_meta->segments_overlap()); rowset_meta->set_rowset_state(input_rowset_meta->rowset_state()); std::vector key_bounds; - input_rowset->get_segments_key_bounds(&key_bounds); + static_cast(input_rowset->get_segments_key_bounds(&key_bounds)); rowset_meta->set_segments_key_bounds(key_bounds); auto output_rowset = output_rs_writer->manual_build(rowset_meta); if (input_rowset_meta->has_delete_predicate()) { @@ -238,7 +238,7 @@ Status IndexBuilder::handle_single_rowset(RowsetMetaSharedPtr output_rowset_meta for (auto& writer_sign : inverted_index_writer_signs) { try { if (_inverted_index_builders[writer_sign]) { - _inverted_index_builders[writer_sign]->finish(); + static_cast(_inverted_index_builders[writer_sign]->finish()); } } catch (const std::exception& e) { return Status::Error( diff --git a/be/src/olap/txn_manager.cpp b/be/src/olap/txn_manager.cpp index 0a3a0d27a8..2bdd7e5b26 100644 --- a/be/src/olap/txn_manager.cpp +++ b/be/src/olap/txn_manager.cpp @@ -356,7 +356,7 @@ Status TxnManager::publish_txn(OlapMeta* meta, TPartitionId partition_id, // update delete_bitmap if (tablet_txn_info.unique_key_merge_on_write) { std::unique_ptr rowset_writer; - tablet->create_transient_rowset_writer(rowset, &rowset_writer); + static_cast(tablet->create_transient_rowset_writer(rowset, &rowset_writer)); int64_t t2 = MonotonicMicros(); RETURN_IF_ERROR(tablet->update_delete_bitmap(rowset, tablet_txn_info.rowset_ids, @@ -498,7 +498,8 @@ Status TxnManager::delete_txn(OlapMeta* meta, TPartitionId partition_id, load_info.rowset->rowset_id().to_string(), load_info.rowset->version().to_string()); } else { - RowsetMetaManager::remove(meta, tablet_uid, load_info.rowset->rowset_id()); + static_cast( + RowsetMetaManager::remove(meta, tablet_uid, load_info.rowset->rowset_id())); #ifndef BE_TEST StorageEngine::instance()->add_unused_rowset(load_info.rowset); #endif @@ -560,7 +561,8 @@ void TxnManager::force_rollback_tablet_related_txns(OlapMeta* meta, TTabletId ta LOG(INFO) << " delete transaction from engine " << ", tablet: " << tablet_info.to_string() << ", rowset id: " << load_info.rowset->rowset_id(); - RowsetMetaManager::remove(meta, tablet_uid, load_info.rowset->rowset_id()); + static_cast(RowsetMetaManager::remove(meta, tablet_uid, + load_info.rowset->rowset_id())); } LOG(INFO) << "remove tablet related txn." << " partition_id: " << it->first.first diff --git a/be/src/olap/version_graph.cpp b/be/src/olap/version_graph.cpp index 0374bbf582..abdf82d895 100644 --- a/be/src/olap/version_graph.cpp +++ b/be/src/olap/version_graph.cpp @@ -366,7 +366,7 @@ PathVersionListSharedPtr TimestampedVersionTracker::fetch_and_delete_path_by_id( _stale_version_path_map.erase(path_id); for (auto& version : ptr->timestamped_versions()) { - _version_graph.delete_version_from_graph(version->version()); + static_cast(_version_graph.delete_version_from_graph(version->version())); } return ptr; } diff --git a/be/src/olap/version_graph.h b/be/src/olap/version_graph.h index 25ca25cc5a..56d07a5287 100644 --- a/be/src/olap/version_graph.h +++ b/be/src/olap/version_graph.h @@ -154,7 +154,7 @@ public: void add_version(const Version& version); void delete_version(const Version& version) { - _version_graph.delete_version_from_graph(version); + static_cast(_version_graph.delete_version_from_graph(version)); } /// Add a version path with stale_rs_metas, this versions in version path diff --git a/be/src/olap/wal_manager.cpp b/be/src/olap/wal_manager.cpp index 8379c9e0d8..72f92b1fab 100644 --- a/be/src/olap/wal_manager.cpp +++ b/be/src/olap/wal_manager.cpp @@ -65,7 +65,8 @@ Status WalManager::init() { RETURN_IF_ERROR(scan_wals(wal_dir)); } return Thread::create( - "WalMgr", "replay_wal", [this]() { this->replay(); }, &_replay_thread); + "WalMgr", "replay_wal", [this]() { static_cast(this->replay()); }, + &_replay_thread); } Status WalManager::add_wal_path(int64_t db_id, int64_t table_id, int64_t wal_id, diff --git a/be/src/pipeline/exec/aggregation_sink_operator.cpp b/be/src/pipeline/exec/aggregation_sink_operator.cpp index 426c8e99b8..251904b024 100644 --- a/be/src/pipeline/exec/aggregation_sink_operator.cpp +++ b/be/src/pipeline/exec/aggregation_sink_operator.cpp @@ -170,7 +170,8 @@ Status AggSinkLocalState::open(RuntimeState* state) { // this could cause unable to get JVM if (Base::_shared_state->probe_expr_ctxs.empty()) { // _create_agg_status may acquire a lot of memory, may allocate failed when memory is very few - RETURN_IF_CATCH_EXCEPTION(Base::_dependency->create_agg_status(_agg_data->without_key)); + RETURN_IF_CATCH_EXCEPTION( + static_cast(Base::_dependency->create_agg_status(_agg_data->without_key))); } return Status::OK(); } @@ -524,12 +525,12 @@ void AggSinkLocalState::_emplace_into_hash_table( key_holder_persist_key(key_holder); auto mapped = Base::_shared_state->aggregate_data_container->append_data( key_holder.key); - Base::_dependency->create_agg_status(mapped); + static_cast(Base::_dependency->create_agg_status(mapped)); ctor(key, mapped); } else { auto mapped = Base::_shared_state->aggregate_data_container->append_data(key); - Base::_dependency->create_agg_status(mapped); + static_cast(Base::_dependency->create_agg_status(mapped)); ctor(key, mapped); } }; @@ -540,7 +541,7 @@ void AggSinkLocalState::_emplace_into_hash_table( ._total_size_of_aggregate_states, Base::_parent->template cast() ._align_aggregate_states); - Base::_dependency->create_agg_status(mapped); + static_cast(Base::_dependency->create_agg_status(mapped)); }; if constexpr (HashTableTraits::is_phmap) { @@ -912,7 +913,7 @@ Status AggSinkOperatorX::sink(doris::RuntimeState* state, } if (source_state == SourceState::FINISHED) { if (local_state._shared_state->spill_context.has_data) { - local_state.try_spill_disk(true); + static_cast(local_state.try_spill_disk(true)); RETURN_IF_ERROR(local_state._shared_state->spill_context.prepare_for_reading()); } local_state._dependency->set_ready_for_read(); diff --git a/be/src/pipeline/exec/aggregation_sink_operator.h b/be/src/pipeline/exec/aggregation_sink_operator.h index bae9e1a8ec..7b2b684bde 100644 --- a/be/src/pipeline/exec/aggregation_sink_operator.h +++ b/be/src/pipeline/exec/aggregation_sink_operator.h @@ -205,7 +205,7 @@ protected: Base::_shared_state->spill_context.runtime_profile)); Defer defer {[&]() { // redundant call is ok - writer->close(); + static_cast(writer->close()); }}; Base::_shared_state->spill_context.stream_ids.emplace_back(writer->get_id()); @@ -234,7 +234,7 @@ protected: if (blocks_rows[i] == 0) { /// Here write one empty block to ensure there are enough blocks in the file, /// blocks' count should be equal with partition_count. - writer->write(block_to_write); + static_cast(writer->write(block_to_write)); continue; } diff --git a/be/src/pipeline/exec/aggregation_source_operator.cpp b/be/src/pipeline/exec/aggregation_source_operator.cpp index 0c8095f916..1114931f62 100644 --- a/be/src/pipeline/exec/aggregation_source_operator.cpp +++ b/be/src/pipeline/exec/aggregation_source_operator.cpp @@ -84,12 +84,12 @@ void AggLocalState::_close_with_serialized_key() { auto& data = agg_method.data; data.for_each_mapped([&](auto& mapped) { if (mapped) { - _dependency->destroy_agg_status(mapped); + static_cast(_dependency->destroy_agg_status(mapped)); mapped = nullptr; } }); if (data.has_null_key_data()) { - _dependency->destroy_agg_status(data.get_null_key_data()); + static_cast(_dependency->destroy_agg_status(data.get_null_key_data())); } }, _agg_data->method_variant); @@ -101,7 +101,7 @@ void AggLocalState::_close_without_key() { //but finally call close to destory agg data, if agg data has bitmapValue //will be core dump, it's not initialized if (_agg_data_created_without_key) { - _dependency->destroy_agg_status(_agg_data->without_key); + static_cast(_dependency->destroy_agg_status(_agg_data->without_key)); _agg_data_created_without_key = false; } _dependency->release_tracker(); diff --git a/be/src/pipeline/exec/analytic_sink_operator.cpp b/be/src/pipeline/exec/analytic_sink_operator.cpp index 32cc5361f7..2b35e1b6a2 100644 --- a/be/src/pipeline/exec/analytic_sink_operator.cpp +++ b/be/src/pipeline/exec/analytic_sink_operator.cpp @@ -103,7 +103,7 @@ Status AnalyticSinkOperatorX::init(const TPlanNode& tnode, RuntimeState* state) Status AnalyticSinkOperatorX::prepare(RuntimeState* state) { for (const auto& ctx : _agg_expr_ctxs) { - vectorized::VExpr::prepare(ctx, state, _child_x->row_desc()); + static_cast(vectorized::VExpr::prepare(ctx, state, _child_x->row_desc())); } if (!_partition_by_eq_expr_ctxs.empty() || !_order_by_eq_expr_ctxs.empty()) { vector tuple_ids; diff --git a/be/src/pipeline/exec/analytic_source_operator.cpp b/be/src/pipeline/exec/analytic_source_operator.cpp index 7f772ab33d..401bf6596d 100644 --- a/be/src/pipeline/exec/analytic_source_operator.cpp +++ b/be/src/pipeline/exec/analytic_source_operator.cpp @@ -115,7 +115,7 @@ Status AnalyticLocalState::init(RuntimeState* state, LocalStateInfo& info) { std::bind(&AnalyticLocalState::_execute_for_win_func, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4); - RETURN_IF_CATCH_EXCEPTION(_create_agg_status()); + RETURN_IF_CATCH_EXCEPTION(static_cast(_create_agg_status())); return Status::OK(); } @@ -220,7 +220,7 @@ Status AnalyticLocalState::_get_next_for_rows(size_t current_block_rows) { range_end = _shared_state->current_row_position + 1; //going on calculate,add up data, no need to reset state } else { - _reset_agg_status(); + static_cast(_reset_agg_status()); if (!_parent->cast() ._window.__isset .window_start) { //[preceding, offset] --unbound: [preceding, following] @@ -298,7 +298,7 @@ bool AnalyticLocalState::init_next_partition(vectorized::BlockRowPos found_parti _partition_by_start = _shared_state->partition_by_end; _shared_state->partition_by_end = found_partition_end; _shared_state->current_row_position = _partition_by_start.pos; - _reset_agg_status(); + static_cast(_reset_agg_status()); return true; } return false; @@ -412,10 +412,10 @@ Status AnalyticSourceOperatorX::get_block(RuntimeState* state, vectorized::Block } local_state._next_partition = local_state.init_next_partition(local_state._shared_state->found_partition_end); - local_state.init_result_columns(); + static_cast(local_state.init_result_columns()); size_t current_block_rows = local_state._shared_state->input_blocks[local_state._output_block_index].rows(); - local_state._executor.get_next(current_block_rows); + static_cast(local_state._executor.get_next(current_block_rows)); if (local_state._window_end_position == current_block_rows) { break; } @@ -442,7 +442,7 @@ Status AnalyticLocalState::close(RuntimeState* state) { agg_function->close(state); } - _destroy_agg_status(); + static_cast(_destroy_agg_status()); release_mem(); return PipelineXLocalState::close(state); } diff --git a/be/src/pipeline/exec/datagen_operator.cpp b/be/src/pipeline/exec/datagen_operator.cpp index 43049eab5b..fd5b9a716b 100644 --- a/be/src/pipeline/exec/datagen_operator.cpp +++ b/be/src/pipeline/exec/datagen_operator.cpp @@ -40,7 +40,7 @@ Status DataGenOperator::open(RuntimeState* state) { Status DataGenOperator::close(RuntimeState* state) { RETURN_IF_ERROR(SourceOperator::close(state)); - _node->close(state); + static_cast(_node->close(state)); return Status::OK(); } @@ -120,7 +120,7 @@ Status DataGenLocalState::close(RuntimeState* state) { if (_closed) { return Status::OK(); } - _table_func->close(state); + static_cast(_table_func->close(state)); return PipelineXLocalState<>::close(state); } diff --git a/be/src/pipeline/exec/empty_source_operator.h b/be/src/pipeline/exec/empty_source_operator.h index acd2c8cdfc..d76d368925 100644 --- a/be/src/pipeline/exec/empty_source_operator.h +++ b/be/src/pipeline/exec/empty_source_operator.h @@ -74,7 +74,7 @@ public: Status sink(RuntimeState*, vectorized::Block*, SourceState) override { return Status::OK(); } Status close(RuntimeState* state) override { - _exec_node->close(state); + static_cast(_exec_node->close(state)); return Status::OK(); } diff --git a/be/src/pipeline/exec/exchange_sink_buffer.cpp b/be/src/pipeline/exec/exchange_sink_buffer.cpp index 85e37ee4a9..f055151698 100644 --- a/be/src/pipeline/exec/exchange_sink_buffer.cpp +++ b/be/src/pipeline/exec/exchange_sink_buffer.cpp @@ -253,7 +253,7 @@ Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) { } else if (eos) { _ended(id); } else { - _send_rpc(id); + static_cast(_send_rpc(id)); } }); { @@ -309,7 +309,7 @@ Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) { } else if (eos) { _ended(id); } else { - _send_rpc(id); + static_cast(_send_rpc(id)); } }); { diff --git a/be/src/pipeline/exec/exchange_sink_operator.cpp b/be/src/pipeline/exec/exchange_sink_operator.cpp index 5d339a7318..8532049793 100644 --- a/be/src/pipeline/exec/exchange_sink_operator.cpp +++ b/be/src/pipeline/exec/exchange_sink_operator.cpp @@ -279,7 +279,7 @@ void ExchangeSinkOperatorX::_handle_eof_channel(RuntimeState* state, ChannelPtrT Status st) { channel->set_receiver_eof(st); // Chanel will not send RPC to the downstream when eof, so close chanel by OK status. - channel->close(state, Status::OK()); + static_cast(channel->close(state, Status::OK())); } Status ExchangeSinkOperatorX::sink(RuntimeState* state, vectorized::Block* block, @@ -325,8 +325,9 @@ Status ExchangeSinkOperatorX::sink(RuntimeState* state, vectorized::Block* block if (serialized) { auto cur_block = local_state._serializer.get_block()->to_block(); if (!cur_block.empty()) { - local_state._serializer.serialize_block( - &cur_block, block_holder->get_block(), local_state.channels.size()); + static_cast(local_state._serializer.serialize_block( + &cur_block, block_holder->get_block(), + local_state.channels.size())); } else { block_holder->get_block()->Clear(); } diff --git a/be/src/pipeline/exec/mysql_scan_operator.cpp b/be/src/pipeline/exec/mysql_scan_operator.cpp index 80afa8ef5e..d032a60639 100644 --- a/be/src/pipeline/exec/mysql_scan_operator.cpp +++ b/be/src/pipeline/exec/mysql_scan_operator.cpp @@ -30,7 +30,7 @@ Status MysqlScanOperator::open(RuntimeState* state) { Status MysqlScanOperator::close(RuntimeState* state) { RETURN_IF_ERROR(SourceOperator::close(state)); - _node->close(state); + static_cast(_node->close(state)); return Status::OK(); } diff --git a/be/src/pipeline/exec/result_file_sink_operator.cpp b/be/src/pipeline/exec/result_file_sink_operator.cpp index 2e375d6908..4369c6b5d8 100644 --- a/be/src/pipeline/exec/result_file_sink_operator.cpp +++ b/be/src/pipeline/exec/result_file_sink_operator.cpp @@ -182,11 +182,11 @@ Status ResultFileSinkLocalState::close(RuntimeState* state, Status exec_status) // close sender, this is normal path end if (_sender) { _sender->update_num_written_rows(_writer == nullptr ? 0 : _writer->get_written_rows()); - _sender->close(final_status); + static_cast(_sender->close(final_status)); } - state->exec_env()->result_mgr()->cancel_at_time( + static_cast(state->exec_env()->result_mgr()->cancel_at_time( time(nullptr) + config::result_buffer_cancelled_interval_time, - state->fragment_instance_id()); + state->fragment_instance_id())); } else { if (final_status.ok()) { bool all_receiver_eof = true; @@ -257,7 +257,7 @@ void ResultFileSinkLocalState::_handle_eof_channel(RuntimeState* state, ChannelP Status st) { channel->set_receiver_eof(st); // Chanel will not send RPC to the downstream when eof, so close chanel by OK status. - channel->close(state, Status::OK()); + static_cast(channel->close(state, Status::OK())); } Status ResultFileSinkOperatorX::sink(RuntimeState* state, vectorized::Block* in_block, diff --git a/be/src/pipeline/exec/result_sink_operator.cpp b/be/src/pipeline/exec/result_sink_operator.cpp index bba54559fe..b9c83a99bc 100644 --- a/be/src/pipeline/exec/result_sink_operator.cpp +++ b/be/src/pipeline/exec/result_sink_operator.cpp @@ -197,11 +197,11 @@ Status ResultSinkLocalState::close(RuntimeState* state, Status exec_status) { _sender->update_num_written_rows(_writer->get_written_rows()); } _sender->update_max_peak_memory_bytes(); - _sender->close(final_status); + static_cast(_sender->close(final_status)); } - state->exec_env()->result_mgr()->cancel_at_time( + static_cast(state->exec_env()->result_mgr()->cancel_at_time( time(nullptr) + config::result_buffer_cancelled_interval_time, - state->fragment_instance_id()); + state->fragment_instance_id())); RETURN_IF_ERROR(PipelineXSinkLocalState<>::close(state, exec_status)); return final_status; } diff --git a/be/src/pipeline/exec/scan_operator.cpp b/be/src/pipeline/exec/scan_operator.cpp index bd304d87b5..3ac6d3d900 100644 --- a/be/src/pipeline/exec/scan_operator.cpp +++ b/be/src/pipeline/exec/scan_operator.cpp @@ -370,8 +370,9 @@ Status ScanLocalState::_normalize_predicate( if (pdt == vectorized::VScanNode::PushDownType::UNACCEPTABLE && TExprNodeType::COMPOUND_PRED == cur_expr->node_type()) { - _normalize_compound_predicate(cur_expr, context, &pdt, _is_runtime_filter_predicate, - in_predicate_checker, eq_predicate_checker); + static_cast(_normalize_compound_predicate( + cur_expr, context, &pdt, _is_runtime_filter_predicate, in_predicate_checker, + eq_predicate_checker)); output_expr = conjunct_expr_root; // remaining in conjunct tree return Status::OK(); } @@ -1008,8 +1009,8 @@ Status ScanLocalState::_normalize_compound_predicate( value_range.mark_runtime_filter_predicate( _is_runtime_filter_predicate); }}; - _normalize_binary_in_compound_predicate(child_expr, expr_ctx, slot, - value_range, pdt); + static_cast(_normalize_binary_in_compound_predicate( + child_expr, expr_ctx, slot, value_range, pdt)); }, active_range); @@ -1030,17 +1031,17 @@ Status ScanLocalState::_normalize_compound_predicate( value_range.mark_runtime_filter_predicate( _is_runtime_filter_predicate); }}; - _normalize_match_in_compound_predicate(child_expr, expr_ctx, slot, - value_range, pdt); + static_cast(_normalize_match_in_compound_predicate( + child_expr, expr_ctx, slot, value_range, pdt)); }, active_range); _compound_value_ranges.emplace_back(active_range); } } else if (TExprNodeType::COMPOUND_PRED == child_expr->node_type()) { - _normalize_compound_predicate(child_expr, expr_ctx, pdt, - _is_runtime_filter_predicate, in_predicate_checker, - eq_predicate_checker); + static_cast(_normalize_compound_predicate( + child_expr, expr_ctx, pdt, _is_runtime_filter_predicate, + in_predicate_checker, eq_predicate_checker)); } } } diff --git a/be/src/pipeline/exec/schema_scan_operator.cpp b/be/src/pipeline/exec/schema_scan_operator.cpp index 1daf8a53c6..4c98c42272 100644 --- a/be/src/pipeline/exec/schema_scan_operator.cpp +++ b/be/src/pipeline/exec/schema_scan_operator.cpp @@ -40,7 +40,7 @@ Status SchemaScanOperator::open(RuntimeState* state) { Status SchemaScanOperator::close(RuntimeState* state) { RETURN_IF_ERROR(SourceOperator::close(state)); - _node->close(state); + static_cast(_node->close(state)); return Status::OK(); } diff --git a/be/src/pipeline/exec/table_function_operator.cpp b/be/src/pipeline/exec/table_function_operator.cpp index 7ce7ac3410..911fdf65ee 100644 --- a/be/src/pipeline/exec/table_function_operator.cpp +++ b/be/src/pipeline/exec/table_function_operator.cpp @@ -116,7 +116,7 @@ int TableFunctionLocalState::_find_last_fn_eos_idx() const { bool TableFunctionLocalState::_roll_table_functions(int last_eos_idx) { int i = last_eos_idx - 1; for (; i >= 0; --i) { - _fns[i]->forward(); + static_cast(_fns[i]->forward()); if (!_fns[i]->eos()) { break; } @@ -128,7 +128,7 @@ bool TableFunctionLocalState::_roll_table_functions(int last_eos_idx) { } for (int j = i + 1; j < _parent->cast()._fn_num; ++j) { - _fns[j]->reset(); + static_cast(_fns[j]->reset()); } return true; @@ -197,7 +197,7 @@ Status TableFunctionLocalState::get_expanded_block(RuntimeState* state, _fns[i]->get_value(columns[i + p._child_slots.size()]); } _current_row_insert_times++; - _fns[p._fn_num - 1]->forward(); + static_cast(_fns[p._fn_num - 1]->forward()); } } } diff --git a/be/src/pipeline/exec/union_source_operator.cpp b/be/src/pipeline/exec/union_source_operator.cpp index f12678002a..67a8ac6d4a 100644 --- a/be/src/pipeline/exec/union_source_operator.cpp +++ b/be/src/pipeline/exec/union_source_operator.cpp @@ -60,13 +60,13 @@ Status UnionSourceOperator::pull_data(RuntimeState* state, vectorized::Block* bl // here we precess const expr firstly if (_need_read_for_const_expr) { if (_node->has_more_const(state)) { - _node->get_next_const(state, block); + static_cast(_node->get_next_const(state, block)); } _need_read_for_const_expr = _node->has_more_const(state); } else { std::unique_ptr output_block; int child_idx = 0; - _data_queue->get_block_from_queue(&output_block, &child_idx); + static_cast(_data_queue->get_block_from_queue(&output_block, &child_idx)); if (!output_block) { return Status::OK(); } @@ -136,13 +136,14 @@ Status UnionSourceOperatorX::get_block(RuntimeState* state, vectorized::Block* b SCOPED_TIMER(local_state.profile()->total_time_counter()); if (local_state._need_read_for_const_expr) { if (has_more_const(state)) { - get_next_const(state, block); + static_cast(get_next_const(state, block)); } local_state._need_read_for_const_expr = has_more_const(state); } else { std::unique_ptr output_block = vectorized::Block::create_unique(); int child_idx = 0; - local_state._shared_state->data_queue->get_block_from_queue(&output_block, &child_idx); + static_cast(local_state._shared_state->data_queue->get_block_from_queue(&output_block, + &child_idx)); if (!output_block) { return Status::OK(); } diff --git a/be/src/pipeline/exec/union_source_operator.h b/be/src/pipeline/exec/union_source_operator.h index acd8419575..a22a0e8c0a 100644 --- a/be/src/pipeline/exec/union_source_operator.h +++ b/be/src/pipeline/exec/union_source_operator.h @@ -121,7 +121,7 @@ public: } Status prepare(RuntimeState* state) override { - Base::prepare(state); + static_cast(Base::prepare(state)); // Prepare const expr lists. for (const vectorized::VExprContextSPtrs& exprs : _const_expr_lists) { RETURN_IF_ERROR(vectorized::VExpr::prepare(exprs, state, _row_descriptor)); @@ -129,7 +129,7 @@ public: return Status::OK(); } Status open(RuntimeState* state) override { - Base::open(state); + static_cast(Base::open(state)); // open const expr lists. for (const auto& exprs : _const_expr_lists) { RETURN_IF_ERROR(vectorized::VExpr::open(exprs, state)); diff --git a/be/src/pipeline/pipeline.cpp b/be/src/pipeline/pipeline.cpp index ca5273f583..8ec5549bbb 100644 --- a/be/src/pipeline/pipeline.cpp +++ b/be/src/pipeline/pipeline.cpp @@ -37,7 +37,7 @@ Status Pipeline::build_operators() { for (auto& operator_t : _operator_builders) { auto o = operator_t->build_operator(); if (pre) { - o->set_child(pre); + static_cast(o->set_child(pre)); } _operators.emplace_back(o); pre = std::move(o); diff --git a/be/src/pipeline/pipeline_fragment_context.cpp b/be/src/pipeline/pipeline_fragment_context.cpp index 7d4b091cda..bf0c1b80df 100644 --- a/be/src/pipeline/pipeline_fragment_context.cpp +++ b/be/src/pipeline/pipeline_fragment_context.cpp @@ -229,7 +229,7 @@ Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& re // TODO should be combine with plan_fragment_executor.prepare funciton SCOPED_ATTACH_TASK(_runtime_state.get()); - _runtime_state->runtime_filter_mgr()->init(); + static_cast(_runtime_state->runtime_filter_mgr()->init()); _runtime_state->set_be_number(local_params.backend_num); if (request.__isset.backend_id) { @@ -298,7 +298,7 @@ Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& re ScanNode* scan_node = static_cast(node); auto scan_ranges = find_with_default(local_params.per_node_scan_ranges, scan_node->id(), no_scan_ranges); - scan_node->set_scan_ranges(scan_ranges); + static_cast(scan_node->set_scan_ranges(scan_ranges)); VLOG_CRITICAL << "scan_node_Id=" << scan_node->id() << " size=" << scan_ranges.get().size(); } @@ -340,12 +340,12 @@ Status PipelineFragmentContext::_build_pipeline_tasks( // if sink auto sink = pipeline->sink()->build_operator(); // TODO pipeline 1 need to add new interface for exec node and operator - sink->init(request.fragment.output_sink); + static_cast(sink->init(request.fragment.output_sink)); RETURN_IF_ERROR(pipeline->build_operators()); auto task = std::make_unique(pipeline, _total_tasks++, _runtime_state.get(), sink, this, pipeline->pipeline_profile()); - sink->set_child(task->get_root()); + static_cast(sink->set_child(task->get_root())); _tasks.emplace_back(std::move(task)); _runtime_profile->add_child(pipeline->pipeline_profile(), true, nullptr); } @@ -605,7 +605,7 @@ Status PipelineFragmentContext::_build_pipelines(ExecNode* node, PipelinePtr cur } else { OperatorBuilderPtr builder = std::make_shared( node->child(1)->id(), node->child(1)->row_desc(), node->child(1)); - new_pipe->add_operator(builder); + static_cast(new_pipe->add_operator(builder)); } OperatorBuilderPtr join_sink = std::make_shared(node->id(), join_node); @@ -715,9 +715,10 @@ Status PipelineFragmentContext::submit() { void PipelineFragmentContext::close_sink() { if (_sink) { if (_prepared) { - _sink->close(_runtime_state.get(), Status::RuntimeError("prepare failed")); + static_cast( + _sink->close(_runtime_state.get(), Status::RuntimeError("prepare failed"))); } else { - _sink->close(_runtime_state.get(), Status::OK()); + static_cast(_sink->close(_runtime_state.get(), Status::OK())); } } } @@ -725,10 +726,11 @@ void PipelineFragmentContext::close_sink() { void PipelineFragmentContext::close_if_prepare_failed() { if (_tasks.empty()) { if (_root_plan) { - _root_plan->close(_runtime_state.get()); + static_cast(_root_plan->close(_runtime_state.get())); } if (_sink) { - _sink->close(_runtime_state.get(), Status::RuntimeError("prepare failed")); + static_cast( + _sink->close(_runtime_state.get(), Status::RuntimeError("prepare failed"))); } } for (auto& task : _tasks) { @@ -808,12 +810,12 @@ Status PipelineFragmentContext::_create_sink(int sender_id, const TDataSink& thr std::make_shared( next_operator_builder_id(), i, multi_cast_data_streamer, thrift_sink.multi_cast_stream_sink.sinks[i]); - new_pipeline->add_operator(source_op); + static_cast(new_pipeline->add_operator(source_op)); // 3. create and set sink operator of data stream sender for new pipeline OperatorBuilderPtr sink_op_builder = std::make_shared( next_operator_builder_id(), _multi_cast_stream_sink_senders[i].get(), i); - new_pipeline->set_sink(sink_op_builder); + static_cast(new_pipeline->set_sink(sink_op_builder)); // 4. init and prepare the data_stream_sender of diff exchange TDataSink t; @@ -832,7 +834,7 @@ Status PipelineFragmentContext::_create_sink(int sender_id, const TDataSink& thr void PipelineFragmentContext::_close_action() { _runtime_profile->total_time_counter()->update(_fragment_watcher.elapsed_time()); - send_report(true); + static_cast(send_report(true)); // all submitted tasks done _exec_env->fragment_mgr()->remove_pipeline_context(shared_from_this()); } diff --git a/be/src/pipeline/pipeline_x/dependency.cpp b/be/src/pipeline/pipeline_x/dependency.cpp index 4ccc42a376..743fc12ee1 100644 --- a/be/src/pipeline/pipeline_x/dependency.cpp +++ b/be/src/pipeline/pipeline_x/dependency.cpp @@ -79,7 +79,7 @@ Status AggDependency::reset_hash_table() { hash_table.for_each_mapped([&](auto& mapped) { if (mapped) { - destroy_agg_status(mapped); + static_cast(destroy_agg_status(mapped)); mapped = nullptr; } }); diff --git a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp index 9369b26ba7..4dedbce44f 100644 --- a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp +++ b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp @@ -213,11 +213,11 @@ Status PipelineXFragmentContext::prepare(const doris::TPipelineFragmentParams& r request, root_pipeline->output_row_desc(), _runtime_state.get(), *desc_tbl, root_pipeline->id())); RETURN_IF_ERROR(_sink->init(request.fragment.output_sink)); - root_pipeline->set_sink(_sink); + static_cast(root_pipeline->set_sink(_sink)); // 4. Initialize global states in pipelines. for (PipelinePtr& pipeline : _pipelines) { - pipeline->sink_x()->set_child(pipeline->operator_xs().back()); + static_cast(pipeline->sink_x()->set_child(pipeline->operator_xs().back())); RETURN_IF_ERROR(pipeline->prepare(_runtime_state.get())); } @@ -324,7 +324,7 @@ Status PipelineXFragmentContext::_create_data_sink(ObjectPool* pool, const TData // 1. create and set the source operator of multi_cast_data_stream_source for new pipeline source_op.reset(new MultiCastDataStreamerSourceOperatorX( i, pool, thrift_sink.multi_cast_stream_sink.sinks[i], row_desc, source_id)); - new_pipeline->add_operator(source_op); + static_cast(new_pipeline->add_operator(source_op)); // 2. create and set sink operator of data stream sender for new pipeline @@ -332,7 +332,7 @@ Status PipelineXFragmentContext::_create_data_sink(ObjectPool* pool, const TData sink_op.reset(new ExchangeSinkOperatorX( state, row_desc, thrift_sink.multi_cast_stream_sink.sinks[i], thrift_sink.multi_cast_stream_sink.destinations[i], false)); - new_pipeline->set_sink(sink_op); + static_cast(new_pipeline->set_sink(sink_op)); // 3. set dependency dag _dag[new_pipeline->id()].push_back(cur_pipeline_id); @@ -364,7 +364,7 @@ Status PipelineXFragmentContext::_build_pipeline_tasks( _runtime_states[i]->set_query_mem_tracker(_query_ctx->query_mem_tracker); _runtime_states[i]->set_tracer(_runtime_state->get_tracer()); - _runtime_states[i]->runtime_filter_mgr()->init(); + static_cast(_runtime_states[i]->runtime_filter_mgr()->init()); _runtime_states[i]->set_be_number(local_params.backend_num); if (request.__isset.backend_id) { @@ -795,15 +795,16 @@ Status PipelineXFragmentContext::submit() { } void PipelineXFragmentContext::close_sink() { - FOR_EACH_RUNTIME_STATE( - _sink->close(runtime_state.get(), - _prepared ? Status::RuntimeError("prepare failed") : Status::OK());); + FOR_EACH_RUNTIME_STATE(static_cast(_sink->close( + runtime_state.get(), + _prepared ? Status::RuntimeError("prepare failed") : Status::OK()));); } void PipelineXFragmentContext::close_if_prepare_failed() { if (_tasks.empty()) { - FOR_EACH_RUNTIME_STATE(_root_op->close(runtime_state.get()); _sink->close( - runtime_state.get(), Status::RuntimeError("prepare failed"));) + FOR_EACH_RUNTIME_STATE( + static_cast(_root_op->close(runtime_state.get())); static_cast( + _sink->close(runtime_state.get(), Status::RuntimeError("prepare failed")));) } for (auto& task : _tasks) { for (auto& t : task) { @@ -816,7 +817,7 @@ void PipelineXFragmentContext::close_if_prepare_failed() { void PipelineXFragmentContext::_close_action() { _runtime_profile->total_time_counter()->update(_fragment_watcher.elapsed_time()); - send_report(true); + static_cast(send_report(true)); // all submitted tasks done _exec_env->fragment_mgr()->remove_pipeline_context(shared_from_this()); } diff --git a/be/src/pipeline/task_scheduler.cpp b/be/src/pipeline/task_scheduler.cpp index 30079126c2..0a8ca74257 100644 --- a/be/src/pipeline/task_scheduler.cpp +++ b/be/src/pipeline/task_scheduler.cpp @@ -185,7 +185,7 @@ void BlockedTaskScheduler::_make_task_run(std::list& local_tasks, auto task = *task_itr; task->set_state(t_state); local_tasks.erase(task_itr++); - _task_queue->push_back(task); + static_cast(_task_queue->push_back(task)); } TaskScheduler::~TaskScheduler() { @@ -195,12 +195,12 @@ TaskScheduler::~TaskScheduler() { Status TaskScheduler::start() { int cores = _task_queue->cores(); // Must be mutil number of cpu cores - ThreadPoolBuilder(_name) - .set_min_threads(cores) - .set_max_threads(cores) - .set_max_queue_size(0) - .set_cgroup_cpu_ctl(_cgroup_cpu_ctl) - .build(&_fix_thread_pool); + static_cast(ThreadPoolBuilder(_name) + .set_min_threads(cores) + .set_max_threads(cores) + .set_max_queue_size(0) + .set_cgroup_cpu_ctl(_cgroup_cpu_ctl) + .build(&_fix_thread_pool)); _markers.reserve(cores); for (size_t i = 0; i < cores; ++i) { _markers.push_back(std::make_unique>(true)); @@ -308,10 +308,10 @@ void TaskScheduler::_do_work(size_t index) { case PipelineTaskState::BLOCKED_FOR_SINK: case PipelineTaskState::BLOCKED_FOR_RF: case PipelineTaskState::BLOCKED_FOR_DEPENDENCY: - _blocked_task_scheduler->add_blocked_task(task); + static_cast(_blocked_task_scheduler->add_blocked_task(task)); break; case PipelineTaskState::RUNNABLE: - _task_queue->push_back(task, index); + static_cast(_task_queue->push_back(task, index)); break; default: DCHECK(false) << "error state after run task, " << get_state_name(pipeline_state); @@ -325,13 +325,13 @@ void TaskScheduler::_try_close_task(PipelineTask* task, PipelineTaskState state, auto status = task->try_close(exec_status); if (!status.ok() && state != PipelineTaskState::CANCELED) { // Call `close` if `try_close` failed to make sure allocated resources are released - task->close(exec_status); + static_cast(task->close(exec_status)); task->query_context()->cancel(true, status.to_string(), Status::Cancelled(status.to_string())); state = PipelineTaskState::CANCELED; } else if (task->is_pending_finish()) { task->set_state(PipelineTaskState::PENDING_FINISH); - _blocked_task_scheduler->add_blocked_task(task); + static_cast(_blocked_task_scheduler->add_blocked_task(task)); return; } else { status = task->close(exec_status); diff --git a/be/src/runtime/block_spill_manager.cpp b/be/src/runtime/block_spill_manager.cpp index f8ee203702..72fa8082d6 100644 --- a/be/src/runtime/block_spill_manager.cpp +++ b/be/src/runtime/block_spill_manager.cpp @@ -91,7 +91,7 @@ void BlockSpillManager::gc(int64_t max_file_count) { continue; } if (files.empty()) { - io::global_local_filesystem()->delete_directory(abs_dir); + static_cast(io::global_local_filesystem()->delete_directory(abs_dir)); if (count++ == max_file_count) { return; } @@ -99,7 +99,7 @@ void BlockSpillManager::gc(int64_t max_file_count) { } for (const auto& file : files) { auto abs_file_path = fmt::format("{}/{}", abs_dir, file.file_name); - io::global_local_filesystem()->delete_file(abs_file_path); + static_cast(io::global_local_filesystem()->delete_file(abs_file_path)); if (count++ == max_file_count) { return; } diff --git a/be/src/runtime/buffer_control_block.cpp b/be/src/runtime/buffer_control_block.cpp index adbaf7fbb0..5e8efda14f 100644 --- a/be/src/runtime/buffer_control_block.cpp +++ b/be/src/runtime/buffer_control_block.cpp @@ -101,7 +101,7 @@ BufferControlBlock::BufferControlBlock(const TUniqueId& id, int buffer_size) _packet_num(0) {} BufferControlBlock::~BufferControlBlock() { - cancel(); + static_cast(cancel()); } Status BufferControlBlock::init() { diff --git a/be/src/runtime/exec_env_init.cpp b/be/src/runtime/exec_env_init.cpp index 59c2b96d53..7ab8efc839 100644 --- a/be/src/runtime/exec_env_init.cpp +++ b/be/src/runtime/exec_env_init.cpp @@ -148,7 +148,7 @@ Status ExecEnv::_init(const std::vector& store_paths, init_doris_metrics(store_paths); _store_paths = store_paths; _user_function_cache = new UserFunctionCache(); - _user_function_cache->init(doris::config::user_function_dir); + static_cast(_user_function_cache->init(doris::config::user_function_dir)); _external_scan_context_mgr = new ExternalScanContextMgr(this); _vstream_mgr = new doris::vectorized::VDataStreamMgr(); _result_mgr = new ResultBufferMgr(); @@ -160,33 +160,33 @@ Status ExecEnv::_init(const std::vector& store_paths, TimezoneUtils::load_timezone_names(); TimezoneUtils::load_timezones_to_cache(); - ThreadPoolBuilder("SendBatchThreadPool") - .set_min_threads(config::send_batch_thread_pool_thread_num) - .set_max_threads(config::send_batch_thread_pool_thread_num) - .set_max_queue_size(config::send_batch_thread_pool_queue_size) - .build(&_send_batch_thread_pool); + static_cast(ThreadPoolBuilder("SendBatchThreadPool") + .set_min_threads(config::send_batch_thread_pool_thread_num) + .set_max_threads(config::send_batch_thread_pool_thread_num) + .set_max_queue_size(config::send_batch_thread_pool_queue_size) + .build(&_send_batch_thread_pool)); init_download_cache_required_components(); - ThreadPoolBuilder("BufferedReaderPrefetchThreadPool") - .set_min_threads(16) - .set_max_threads(64) - .build(&_buffered_reader_prefetch_thread_pool); + static_cast(ThreadPoolBuilder("BufferedReaderPrefetchThreadPool") + .set_min_threads(16) + .set_max_threads(64) + .build(&_buffered_reader_prefetch_thread_pool)); // min num equal to fragment pool's min num // max num is useless because it will start as many as requested in the past // queue size is useless because the max thread num is very large - ThreadPoolBuilder("SendReportThreadPool") - .set_min_threads(config::fragment_pool_thread_num_min) - .set_max_threads(std::numeric_limits::max()) - .set_max_queue_size(config::fragment_pool_queue_size) - .build(&_send_report_thread_pool); + static_cast(ThreadPoolBuilder("SendReportThreadPool") + .set_min_threads(config::fragment_pool_thread_num_min) + .set_max_threads(std::numeric_limits::max()) + .set_max_queue_size(config::fragment_pool_queue_size) + .build(&_send_report_thread_pool)); - ThreadPoolBuilder("JoinNodeThreadPool") - .set_min_threads(config::fragment_pool_thread_num_min) - .set_max_threads(std::numeric_limits::max()) - .set_max_queue_size(config::fragment_pool_queue_size) - .build(&_join_node_thread_pool); + static_cast(ThreadPoolBuilder("JoinNodeThreadPool") + .set_min_threads(config::fragment_pool_thread_num_min) + .set_max_threads(std::numeric_limits::max()) + .set_max_queue_size(config::fragment_pool_queue_size) + .build(&_join_node_thread_pool)); init_file_cache_factory(); RETURN_IF_ERROR(init_pipeline_task_scheduler()); _task_group_manager = new taskgroup::TaskGroupManager(); @@ -216,21 +216,21 @@ Status ExecEnv::_init(const std::vector& store_paths, _backend_client_cache->init_metrics("backend"); _frontend_client_cache->init_metrics("frontend"); _broker_client_cache->init_metrics("broker"); - _result_mgr->init(); + static_cast(_result_mgr->init()); Status status = _load_path_mgr->init(); if (!status.ok()) { LOG(ERROR) << "Load path mgr init failed. " << status; return status; } _broker_mgr->init(); - _small_file_mgr->init(); + static_cast(_small_file_mgr->init()); status = _scanner_scheduler->init(this); if (!status.ok()) { LOG(ERROR) << "Scanner scheduler init failed. " << status; return status; } - _init_mem_env(); + static_cast(_init_mem_env()); RETURN_IF_ERROR(_memtable_memory_limiter->init(MemInfo::mem_limit())); RETURN_IF_ERROR(_load_channel_mgr->init(MemInfo::mem_limit())); @@ -316,10 +316,10 @@ void ExecEnv::init_file_cache_factory() { } std::unique_ptr file_cache_init_pool; - doris::ThreadPoolBuilder("FileCacheInitThreadPool") - .set_min_threads(cache_paths.size()) - .set_max_threads(cache_paths.size()) - .build(&file_cache_init_pool); + static_cast(doris::ThreadPoolBuilder("FileCacheInitThreadPool") + .set_min_threads(cache_paths.size()) + .set_max_threads(cache_paths.size()) + .build(&file_cache_init_pool)); std::list cache_status; for (auto& cache_path : cache_paths) { @@ -488,11 +488,11 @@ void ExecEnv::init_download_cache_buf() { } void ExecEnv::init_download_cache_required_components() { - ThreadPoolBuilder("DownloadCacheThreadPool") - .set_min_threads(1) - .set_max_threads(config::download_cache_thread_pool_thread_num) - .set_max_queue_size(config::download_cache_thread_pool_queue_size) - .build(&_download_cache_thread_pool); + static_cast(ThreadPoolBuilder("DownloadCacheThreadPool") + .set_min_threads(1) + .set_max_threads(config::download_cache_thread_pool_thread_num) + .set_max_queue_size(config::download_cache_thread_pool_queue_size) + .build(&_download_cache_thread_pool)); set_serial_download_cache_thread_token(); init_download_cache_buf(); } diff --git a/be/src/runtime/external_scan_context_mgr.cpp b/be/src/runtime/external_scan_context_mgr.cpp index 6c51cfccbe..c8d9304951 100644 --- a/be/src/runtime/external_scan_context_mgr.cpp +++ b/be/src/runtime/external_scan_context_mgr.cpp @@ -96,7 +96,7 @@ Status ExternalScanContextMgr::clear_scan_context(const std::string& context_id) context = iter->second; if (context == nullptr) { _active_contexts.erase(context_id); - Status::OK(); + return Status::OK(); } iter = _active_contexts.erase(iter); } @@ -106,7 +106,7 @@ Status ExternalScanContextMgr::clear_scan_context(const std::string& context_id) _exec_env->fragment_mgr()->cancel_instance(context->fragment_instance_id, PPlanFragmentCancelReason::INTERNAL_ERROR); // clear the fragment instance's related result queue - _exec_env->result_queue_mgr()->cancel(context->fragment_instance_id); + static_cast(_exec_env->result_queue_mgr()->cancel(context->fragment_instance_id)); LOG(INFO) << "close scan context: context id [ " << context_id << " ]"; } return Status::OK(); @@ -146,7 +146,8 @@ void ExternalScanContextMgr::gc_expired_context() { // must cancel the fragment instance, otherwise return thrift transport TTransportException _exec_env->fragment_mgr()->cancel_instance(expired_context->fragment_instance_id, PPlanFragmentCancelReason::INTERNAL_ERROR); - _exec_env->result_queue_mgr()->cancel(expired_context->fragment_instance_id); + static_cast( + _exec_env->result_queue_mgr()->cancel(expired_context->fragment_instance_id)); } } #endif diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp index 9a916daf4e..4bc94b38d1 100644 --- a/be/src/runtime/fragment_mgr.cpp +++ b/be/src/runtime/fragment_mgr.cpp @@ -203,9 +203,9 @@ void FragmentMgr::coordinator_callback(const ReportStatusRequest& req) { if (!coord_status.ok()) { std::stringstream ss; UniqueId uid(req.query_id.hi, req.query_id.lo); - req.update_fn(Status::InternalError( + static_cast(req.update_fn(Status::InternalError( "query_id: {}, couldn't get a client for {}, reason is {}", uid.to_string(), - PrintThriftNetworkAddress(req.coord_addr), coord_status.to_string())); + PrintThriftNetworkAddress(req.coord_addr), coord_status.to_string()))); return; } @@ -398,7 +398,7 @@ void FragmentMgr::coordinator_callback(const ReportStatusRequest& req) { if (!rpc_status.ok()) { // we need to cancel the execution of this fragment - req.update_fn(rpc_status); + static_cast(req.update_fn(rpc_status)); req.cancel_fn(PPlanFragmentCancelReason::INTERNAL_ERROR, "report rpc fail"); return; } @@ -413,7 +413,7 @@ void FragmentMgr::coordinator_callback(const ReportStatusRequest& req) { if (!rpc_status.ok()) { // we need to cancel the execution of this fragment - req.update_fn(rpc_status); + static_cast(req.update_fn(rpc_status)); req.cancel_fn(PPlanFragmentCancelReason::INTERNAL_ERROR, "rpc fail 2"); } } @@ -738,7 +738,8 @@ Status FragmentMgr::exec_plan_fragment(const TExecPlanFragmentParams& params, g_fragmentmgr_prepare_latency << (duration_ns / 1000); std::shared_ptr handler; // TODO need check the status, but when I add return_if_error the P0 will not pass - _runtimefilter_controller.add_entity(params, &handler, fragment_executor->runtime_state()); + static_cast(_runtimefilter_controller.add_entity(params, &handler, + fragment_executor->runtime_state())); fragment_executor->set_merge_controller_handler(handler); { std::lock_guard lock(_lock); @@ -809,8 +810,9 @@ Status FragmentMgr::exec_plan_fragment(const TPipelineFragmentParams& params, for (size_t i = 0; i < params.local_params.size(); i++) { std::shared_ptr handler; - _runtimefilter_controller.add_entity(params, params.local_params[i], &handler, - context->get_runtime_state(UniqueId())); + static_cast( + _runtimefilter_controller.add_entity(params, params.local_params[i], &handler, + context->get_runtime_state(UniqueId()))); context->set_merge_controller_handler(handler); const TUniqueId& fragment_instance_id = params.local_params[i].fragment_instance_id; { @@ -880,15 +882,15 @@ Status FragmentMgr::exec_plan_fragment(const TPipelineFragmentParams& params, auto prepare_st = context->prepare(params, i); if (!prepare_st.ok()) { context->close_if_prepare_failed(); - context->update_status(prepare_st); + static_cast(context->update_status(prepare_st)); return prepare_st; } } g_fragmentmgr_prepare_latency << (duration_ns / 1000); std::shared_ptr handler; - _runtimefilter_controller.add_entity(params, local_params, &handler, - context->get_runtime_state(UniqueId())); + static_cast(_runtimefilter_controller.add_entity( + params, local_params, &handler, context->get_runtime_state(UniqueId()))); context->set_merge_controller_handler(handler); { @@ -908,14 +910,14 @@ Status FragmentMgr::exec_plan_fragment(const TPipelineFragmentParams& params, std::condition_variable cv; for (size_t i = 0; i < target_size; i++) { - _thread_pool->submit_func([&, i]() { + static_cast(_thread_pool->submit_func([&, i]() { prepare_status[i] = pre_and_submit(i); std::unique_lock lock(m); prepare_done++; if (prepare_done == target_size) { cv.notify_one(); } - }); + })); } std::unique_lock lock(m); diff --git a/be/src/runtime/group_commit_mgr.cpp b/be/src/runtime/group_commit_mgr.cpp index f039cf34e8..14283a1fa2 100644 --- a/be/src/runtime/group_commit_mgr.cpp +++ b/be/src/runtime/group_commit_mgr.cpp @@ -248,7 +248,8 @@ Status GroupCommitTable::_create_group_commit_load( params.__set_import_label(label); st = _exec_plan_fragment(_db_id, table_id, label, txn_id, is_pipeline, params, pipeline_params); if (!st.ok()) { - _finish_group_commit_load(_db_id, table_id, label, txn_id, instance_id, st, true, nullptr); + static_cast(_finish_group_commit_load(_db_id, table_id, label, txn_id, instance_id, + st, true, nullptr)); } return st; } @@ -354,8 +355,9 @@ Status GroupCommitTable::_exec_plan_fragment(int64_t db_id, int64_t table_id, const TExecPlanFragmentParams& params, const TPipelineFragmentParams& pipeline_params) { auto finish_cb = [db_id, table_id, label, txn_id, this](RuntimeState* state, Status* status) { - _finish_group_commit_load(db_id, table_id, label, txn_id, state->fragment_instance_id(), - *status, false, state); + static_cast(_finish_group_commit_load(db_id, table_id, label, txn_id, + state->fragment_instance_id(), *status, false, + state)); }; if (is_pipeline) { return _exec_env->fragment_mgr()->exec_plan_fragment(pipeline_params, finish_cb); @@ -377,10 +379,10 @@ Status GroupCommitTable::get_load_block_queue(const TUniqueId& instance_id, } GroupCommitMgr::GroupCommitMgr(ExecEnv* exec_env) : _exec_env(exec_env) { - ThreadPoolBuilder("InsertIntoGroupCommitThreadPool") - .set_min_threads(config::group_commit_insert_threads) - .set_max_threads(config::group_commit_insert_threads) - .build(&_insert_into_thread_pool); + static_cast(ThreadPoolBuilder("InsertIntoGroupCommitThreadPool") + .set_min_threads(config::group_commit_insert_threads) + .set_max_threads(config::group_commit_insert_threads) + .build(&_insert_into_thread_pool)); } GroupCommitMgr::~GroupCommitMgr() { @@ -422,15 +424,15 @@ Status GroupCommitMgr::group_commit_insert(int64_t table_id, const TPlan& plan, } _exec_env->new_load_stream_mgr()->remove(load_id); }); - _insert_into_thread_pool->submit_func( - std::bind(&GroupCommitMgr::_append_row, this, pipe, request)); + static_cast(_insert_into_thread_pool->submit_func( + std::bind(&GroupCommitMgr::_append_row, this, pipe, request))); // 2. FileScanNode consumes data from the pipe. std::unique_ptr runtime_state = RuntimeState::create_unique(); TQueryOptions query_options; query_options.query_type = TQueryType::LOAD; TQueryGlobals query_globals; - runtime_state->init(load_id, query_options, query_globals, _exec_env); + static_cast(runtime_state->init(load_id, query_options, query_globals, _exec_env)); runtime_state->set_query_mem_tracker(std::make_shared( MemTrackerLimiter::Type::LOAD, fmt::format("Load#Id={}", print_id(load_id)), -1)); DescriptorTbl* desc_tbl = nullptr; @@ -438,8 +440,9 @@ Status GroupCommitMgr::group_commit_insert(int64_t table_id, const TPlan& plan, runtime_state->set_desc_tbl(desc_tbl); auto file_scan_node = vectorized::NewFileScanNode(runtime_state->obj_pool(), plan_node, *desc_tbl); - std::unique_ptr> close_scan_node_func( - (int*)0x01, [&](int*) { file_scan_node.close(runtime_state.get()); }); + std::unique_ptr> close_scan_node_func((int*)0x01, [&](int*) { + static_cast(file_scan_node.close(runtime_state.get())); + }); // TFileFormatType::FORMAT_PROTO, TFileType::FILE_STREAM, set _range.load_id RETURN_IF_ERROR(file_scan_node.init(plan_node, runtime_state.get())); RETURN_IF_ERROR(file_scan_node.prepare(runtime_state.get())); @@ -507,7 +510,7 @@ Status GroupCommitMgr::_append_row(std::shared_ptr pipe, // TODO append may error when pipe is cancelled RETURN_IF_ERROR(pipe->append(std::move(row))); } - pipe->finish(); + static_cast(pipe->finish()); return Status::OK(); } @@ -541,7 +544,7 @@ Status GroupCommitMgr::_group_commit_stream_load(std::shared_ptrinit(load_id, query_options, query_globals, _exec_env); + static_cast(runtime_state->init(load_id, query_options, query_globals, _exec_env)); runtime_state->set_query_mem_tracker(std::make_shared( MemTrackerLimiter::Type::LOAD, fmt::format("Load#Id={}", ctx->id.to_string()), -1)); DescriptorTbl* desc_tbl = nullptr; @@ -557,8 +560,8 @@ Status GroupCommitMgr::_group_commit_stream_load(std::shared_ptrremove_load_id(load_id); } - file_scan_node.close(runtime_state.get()); - sink.close(runtime_state.get(), status); + static_cast(file_scan_node.close(runtime_state.get())); + static_cast(sink.close(runtime_state.get(), status)); }); RETURN_IF_ERROR(file_scan_node.init(plan_node, runtime_state.get())); RETURN_IF_ERROR(file_scan_node.prepare(runtime_state.get())); diff --git a/be/src/runtime/jsonb_value.h b/be/src/runtime/jsonb_value.h index 915094c330..1c52199938 100644 --- a/be/src/runtime/jsonb_value.h +++ b/be/src/runtime/jsonb_value.h @@ -43,9 +43,13 @@ struct JsonBinaryValue { JsonbParser parser; JsonBinaryValue() : ptr(nullptr), len(0) {} - JsonBinaryValue(char* ptr, int len) { from_json_string(const_cast(ptr), len); } - JsonBinaryValue(const std::string& s) { from_json_string(s.c_str(), s.length()); } - JsonBinaryValue(const char* ptr, int len) { from_json_string(ptr, len); } + JsonBinaryValue(char* ptr, int len) { + static_cast(from_json_string(const_cast(ptr), len)); + } + JsonBinaryValue(const std::string& s) { + static_cast(from_json_string(s.c_str(), s.length())); + } + JsonBinaryValue(const char* ptr, int len) { static_cast(from_json_string(ptr, len)); } const char* value() { return ptr; } diff --git a/be/src/runtime/load_channel.cpp b/be/src/runtime/load_channel.cpp index bee2f906bc..7c6549d692 100644 --- a/be/src/runtime/load_channel.cpp +++ b/be/src/runtime/load_channel.cpp @@ -196,7 +196,7 @@ bool LoadChannel::is_finished() { Status LoadChannel::cancel() { std::lock_guard l(_lock); for (auto& it : _tablets_channels) { - it.second->cancel(); + static_cast(it.second->cancel()); } return Status::OK(); } diff --git a/be/src/runtime/load_channel_mgr.cpp b/be/src/runtime/load_channel_mgr.cpp index 1aaf8772b8..88f007e179 100644 --- a/be/src/runtime/load_channel_mgr.cpp +++ b/be/src/runtime/load_channel_mgr.cpp @@ -168,7 +168,7 @@ Status LoadChannelMgr::add_batch(const PTabletWriterAddBlockRequest& request, // this case will be handled in load channel's add batch method. Status st = channel->add_batch(request, response); if (UNLIKELY(!st.ok())) { - channel->cancel(); + static_cast(channel->cancel()); return st; } @@ -204,7 +204,7 @@ Status LoadChannelMgr::cancel(const PTabletWriterCancelRequest& params) { } if (cancelled_channel != nullptr) { - cancelled_channel->cancel(); + static_cast(cancelled_channel->cancel()); LOG(INFO) << "load channel has been cancelled: " << load_id; } @@ -217,7 +217,7 @@ Status LoadChannelMgr::_start_bg_worker() { [this]() { while (!_stop_background_threads_latch.wait_for( std::chrono::seconds(START_BG_INTERVAL))) { - _start_load_channels_clean(); + static_cast(_start_load_channels_clean()); } }, &_load_channels_clean_thread)); @@ -252,7 +252,7 @@ Status LoadChannelMgr::_start_load_channels_clean() { // otherwise some object may be invalid before trying to visit it. // eg: MemTracker in load channel for (auto& channel : need_delete_channels) { - channel->cancel(); + static_cast(channel->cancel()); LOG(INFO) << "load channel has been safely deleted: " << channel->load_id() << ", timeout(s): " << channel->timeout(); } diff --git a/be/src/runtime/load_stream_mgr.cpp b/be/src/runtime/load_stream_mgr.cpp index 70d354eee9..5c50466290 100644 --- a/be/src/runtime/load_stream_mgr.cpp +++ b/be/src/runtime/load_stream_mgr.cpp @@ -35,10 +35,10 @@ namespace doris { LoadStreamMgr::LoadStreamMgr(uint32_t segment_file_writer_thread_num, FifoThreadPool* heavy_work_pool, FifoThreadPool* light_work_pool) : _heavy_work_pool(heavy_work_pool), _light_work_pool(light_work_pool) { - ThreadPoolBuilder("SegmentFileWriterThreadPool") - .set_min_threads(segment_file_writer_thread_num) - .set_max_threads(segment_file_writer_thread_num) - .build(&_file_writer_thread_pool); + static_cast(ThreadPoolBuilder("SegmentFileWriterThreadPool") + .set_min_threads(segment_file_writer_thread_num) + .set_max_threads(segment_file_writer_thread_num) + .build(&_file_writer_thread_pool)); } LoadStreamMgr::~LoadStreamMgr() { diff --git a/be/src/runtime/load_stream_writer.cpp b/be/src/runtime/load_stream_writer.cpp index 39b9144db1..326524215e 100644 --- a/be/src/runtime/load_stream_writer.cpp +++ b/be/src/runtime/load_stream_writer.cpp @@ -124,8 +124,7 @@ Status LoadStreamWriter::close_segment(uint32_t segid) { } Status LoadStreamWriter::add_segment(uint32_t segid, SegmentStatistics& stat) { - _rowset_writer->add_segment(segid, stat); - return Status::OK(); + return _rowset_writer->add_segment(segid, stat); } Status LoadStreamWriter::close() { @@ -152,10 +151,10 @@ Status LoadStreamWriter::close() { } } - _rowset_builder.build_rowset(); - _rowset_builder.submit_calc_delete_bitmap_task(); - _rowset_builder.wait_calc_delete_bitmap(); - _rowset_builder.commit_txn(); + static_cast(_rowset_builder.build_rowset()); + static_cast(_rowset_builder.submit_calc_delete_bitmap_task()); + static_cast(_rowset_builder.wait_calc_delete_bitmap()); + static_cast(_rowset_builder.commit_txn()); return Status::OK(); } diff --git a/be/src/runtime/plan_fragment_executor.cpp b/be/src/runtime/plan_fragment_executor.cpp index 4cec558fc5..ae3ad1c2d9 100644 --- a/be/src/runtime/plan_fragment_executor.cpp +++ b/be/src/runtime/plan_fragment_executor.cpp @@ -142,7 +142,7 @@ Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request) { _runtime_state->set_tracer(std::move(tracer)); SCOPED_ATTACH_TASK(_runtime_state.get()); - _runtime_state->runtime_filter_mgr()->init(); + static_cast(_runtime_state->runtime_filter_mgr()->init()); _runtime_state->set_be_number(request.backend_num); if (request.__isset.backend_id) { _runtime_state->set_backend_id(request.backend_id); @@ -209,7 +209,7 @@ Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request) { ScanNode* scan_node = static_cast(scan_nodes[i]); auto scan_ranges = find_with_default(params.per_node_scan_ranges, scan_node->id(), no_scan_ranges); - scan_node->set_scan_ranges(scan_ranges); + static_cast(scan_node->set_scan_ranges(scan_ranges)); VLOG_CRITICAL << "scan_node_Id=" << scan_node->id() << " size=" << scan_ranges.get().size(); } @@ -269,10 +269,10 @@ Status PlanFragmentExecutor::open() { // at end, otherwise the coordinator hangs in case we finish w/ an error if (_is_report_success && config::status_report_interval > 0) { std::unique_lock l(_report_thread_lock); - _exec_env->send_report_thread_pool()->submit_func([this] { + static_cast(_exec_env->send_report_thread_pool()->submit_func([this] { Defer defer {[&]() { this->_report_thread_promise.set_value(true); }}; this->report_profile(); - }); + })); // make sure the thread started up, otherwise report_profile() might get into a race // with stop_report_thread() _report_thread_started_cv.wait(l); @@ -298,7 +298,7 @@ Status PlanFragmentExecutor::open() { std::lock_guard l(_status_lock); _status = status; if (status.is()) { - _runtime_state->set_mem_limit_exceeded(status.to_string()); + static_cast(_runtime_state->set_mem_limit_exceeded(status.to_string())); } if (_runtime_state->query_type() == TQueryType::EXTERNAL) { TUniqueId fragment_instance_id = _runtime_state->fragment_instance_id(); @@ -644,7 +644,7 @@ void PlanFragmentExecutor::close() { if (_runtime_state != nullptr) { // _runtime_state init failed if (_plan != nullptr) { - _plan->close(_runtime_state.get()); + static_cast(_plan->close(_runtime_state.get())); } if (_sink != nullptr) { @@ -654,9 +654,10 @@ void PlanFragmentExecutor::close() { std::lock_guard l(_status_lock); status = _status; } - _sink->close(runtime_state(), status); + static_cast(_sink->close(runtime_state(), status)); } else { - _sink->close(runtime_state(), Status::InternalError("prepare failed")); + static_cast( + _sink->close(runtime_state(), Status::InternalError("prepare failed"))); } } diff --git a/be/src/runtime/result_buffer_mgr.cpp b/be/src/runtime/result_buffer_mgr.cpp index c4d0f148ed..9dbe228bcd 100644 --- a/be/src/runtime/result_buffer_mgr.cpp +++ b/be/src/runtime/result_buffer_mgr.cpp @@ -92,7 +92,7 @@ Status ResultBufferMgr::create_sender(const TUniqueId& query_id, int buffer_size // details see issue https://github.com/apache/doris/issues/16203 // add extra 5s for avoid corner case int64_t max_timeout = time(nullptr) + exec_timout + 5; - cancel_at_time(max_timeout, query_id); + static_cast(cancel_at_time(max_timeout, query_id)); } *sender = control_block; return Status::OK(); @@ -156,7 +156,7 @@ Status ResultBufferMgr::cancel(const TUniqueId& query_id) { BufferMap::iterator iter = _buffer_map.find(query_id); if (_buffer_map.end() != iter) { - iter->second->cancel(); + static_cast(iter->second->cancel()); _buffer_map.erase(iter); } } @@ -209,7 +209,7 @@ void ResultBufferMgr::cancel_thread() { // cancel query for (int i = 0; i < query_to_cancel.size(); ++i) { - cancel(query_to_cancel[i]); + static_cast(cancel(query_to_cancel[i])); } } while (!_stop_background_threads_latch.wait_for(std::chrono::seconds(1))); diff --git a/be/src/runtime/routine_load/data_consumer_group.cpp b/be/src/runtime/routine_load/data_consumer_group.cpp index d27c86fdf0..ed0f170656 100644 --- a/be/src/runtime/routine_load/data_consumer_group.cpp +++ b/be/src/runtime/routine_load/data_consumer_group.cpp @@ -142,7 +142,7 @@ Status KafkaDataConsumerGroup::start_all(std::shared_ptr ctx) _queue.shutdown(); // cancel all consumers for (auto& consumer : _consumers) { - consumer->cancel(ctx); + static_cast(consumer->cancel(ctx)); } // waiting all threads finished @@ -152,7 +152,7 @@ Status KafkaDataConsumerGroup::start_all(std::shared_ptr ctx) kafka_pipe->cancel(result_st.to_string()); return result_st; } - kafka_pipe->finish(); + static_cast(kafka_pipe->finish()); ctx->kafka_info->cmt_offset = std::move(cmt_offset); ctx->receive_bytes = ctx->max_batch_size - left_bytes; return Status::OK(); diff --git a/be/src/runtime/routine_load/data_consumer_pool.cpp b/be/src/runtime/routine_load/data_consumer_pool.cpp index 48d16e9c21..683afd8fcf 100644 --- a/be/src/runtime/routine_load/data_consumer_pool.cpp +++ b/be/src/runtime/routine_load/data_consumer_pool.cpp @@ -48,7 +48,7 @@ Status DataConsumerPool::get_consumer(std::shared_ptr ctx, while (iter != std::end(_pool)) { if ((*iter)->match(ctx)) { VLOG_NOTICE << "get an available data consumer from pool: " << (*iter)->id(); - (*iter)->reset(); + static_cast((*iter)->reset()); *ret = *iter; iter = _pool.erase(iter); return Status::OK(); @@ -113,7 +113,7 @@ void DataConsumerPool::return_consumer(std::shared_ptr consumer) { return; } - consumer->reset(); + static_cast(consumer->reset()); _pool.push_back(consumer); VLOG_NOTICE << "return the data consumer: " << consumer->id() << ", current pool size: " << _pool.size(); diff --git a/be/src/runtime/routine_load/routine_load_task_executor.cpp b/be/src/runtime/routine_load/routine_load_task_executor.cpp index e5c48f78d9..5c6bdaad03 100644 --- a/be/src/runtime/routine_load/routine_load_task_executor.cpp +++ b/be/src/runtime/routine_load/routine_load_task_executor.cpp @@ -72,7 +72,7 @@ RoutineLoadTaskExecutor::RoutineLoadTaskExecutor(ExecEnv* exec_env) return _task_map.size(); }); - _data_consumer_pool.start_bg_worker(); + static_cast(_data_consumer_pool.start_bg_worker()); } RoutineLoadTaskExecutor::~RoutineLoadTaskExecutor() { @@ -342,7 +342,7 @@ void RoutineLoadTaskExecutor::exec_task(std::shared_ptr ctx, if (ctx->is_multi_table) { // plan the rest of unplanned data auto multi_table_pipe = std::static_pointer_cast(ctx->body_sink); - multi_table_pipe->request_and_exec_plans(); + static_cast(multi_table_pipe->request_and_exec_plans()); // need memory order multi_table_pipe->set_consume_finished(); } diff --git a/be/src/runtime/runtime_filter_mgr.cpp b/be/src/runtime/runtime_filter_mgr.cpp index ec4e3ff788..2e8782ba8a 100644 --- a/be/src/runtime/runtime_filter_mgr.cpp +++ b/be/src/runtime/runtime_filter_mgr.cpp @@ -31,6 +31,7 @@ #include #include "common/logging.h" +#include "common/status.h" #include "exprs/bloom_filter_func.h" #include "exprs/runtime_filter.h" #include "runtime/exec_env.h" @@ -218,7 +219,8 @@ Status RuntimeFilterMergeControllerEntity::_init_with_desc( auto filter_id = runtime_filter_desc->filter_id; // LOG(INFO) << "entity filter id:" << filter_id; - cntVal->filter->init_with_desc(&cntVal->runtime_filter_desc, query_options, -1, false); + static_cast( + cntVal->filter->init_with_desc(&cntVal->runtime_filter_desc, query_options, -1, false)); _filter_map.emplace(filter_id, CntlValwithLock {cntVal, std::make_unique()}); return Status::OK(); } @@ -240,7 +242,7 @@ Status RuntimeFilterMergeControllerEntity::_init_with_desc( auto filter_id = runtime_filter_desc->filter_id; // LOG(INFO) << "entity filter id:" << filter_id; - cntVal->filter->init_with_desc(&cntVal->runtime_filter_desc, query_options); + static_cast(cntVal->filter->init_with_desc(&cntVal->runtime_filter_desc, query_options)); _filter_map.emplace(filter_id, CntlValwithLock {cntVal, std::make_unique()}); return Status::OK(); } @@ -561,7 +563,7 @@ Status RuntimeFilterMergeController::remove_entity(UniqueId query_id) { // auto called while call ~std::shared_ptr void runtime_filter_merge_entity_close(RuntimeFilterMergeController* controller, RuntimeFilterMergeControllerEntity* entity) { - controller->remove_entity(entity->query_id()); + static_cast(controller->remove_entity(entity->query_id())); delete entity; } diff --git a/be/src/runtime/runtime_state.cpp b/be/src/runtime/runtime_state.cpp index ec18e83eab..e43b8777c8 100644 --- a/be/src/runtime/runtime_state.cpp +++ b/be/src/runtime/runtime_state.cpp @@ -348,8 +348,8 @@ Status RuntimeState::check_query_state(const std::string& msg) { const int64_t MAX_ERROR_NUM = 50; Status RuntimeState::create_error_log_file() { - _exec_env->load_path_mgr()->get_load_error_file_name( - _db_name, _import_label, _fragment_instance_id, &_error_log_file_path); + static_cast(_exec_env->load_path_mgr()->get_load_error_file_name( + _db_name, _import_label, _fragment_instance_id, &_error_log_file_path)); std::string error_log_absolute_path = _exec_env->load_path_mgr()->get_load_error_absolute_path(_error_log_file_path); _error_log_file = new std::ofstream(error_log_absolute_path, std::ifstream::out); diff --git a/be/src/runtime/stream_load/stream_load_executor.cpp b/be/src/runtime/stream_load/stream_load_executor.cpp index 0b5c52e821..b85d72b3b2 100644 --- a/be/src/runtime/stream_load/stream_load_executor.cpp +++ b/be/src/runtime/stream_load/stream_load_executor.cpp @@ -140,7 +140,7 @@ Status StreamLoadExecutor::execute_plan_fragment(std::shared_ptrstatus = *status; this->rollback_txn(ctx.get()); } else { - this->commit_txn(ctx.get()); + static_cast(this->commit_txn(ctx.get())); } } }); @@ -213,7 +213,7 @@ Status StreamLoadExecutor::execute_plan_fragment(std::shared_ptrstatus = *status; this->rollback_txn(ctx.get()); } else { - this->commit_txn(ctx.get()); + static_cast(this->commit_txn(ctx.get())); } } }); diff --git a/be/src/runtime/tablets_channel.cpp b/be/src/runtime/tablets_channel.cpp index 0ef01d3654..91294135a0 100644 --- a/be/src/runtime/tablets_channel.cpp +++ b/be/src/runtime/tablets_channel.cpp @@ -134,7 +134,7 @@ Status TabletsChannel::incremental_open(const PTabletWriterOpenRequest& params) } } if (index_slots == nullptr) { - Status::InternalError("unknown index id, key={}", _key.to_string()); + return Status::InternalError("unknown index id, key={}", _key.to_string()); } // update tablets std::vector tablet_ids; @@ -257,7 +257,7 @@ Status TabletsChannel::close( // 2. wait all writer finished flush. for (auto writer : need_wait_writers) { - writer->wait_flush(); + static_cast(writer->wait_flush()); } // 3. build rowset @@ -399,7 +399,7 @@ Status TabletsChannel::_open_all_writers(const PTabletWriterOpenRequest& request } } if (index_slots == nullptr) { - Status::InternalError("unknown index id, key={}", _key.to_string()); + return Status::InternalError("unknown index id, key={}", _key.to_string()); } #ifdef DEBUG @@ -460,7 +460,7 @@ Status TabletsChannel::cancel() { return _close_status; } for (auto& it : _tablet_writers) { - it.second->cancel(); + static_cast(it.second->cancel()); } _state = kFinished; if (_write_single_replica) { @@ -539,7 +539,7 @@ Status TabletsChannel::add_batch(const PTabletWriterAddBlockRequest& request, PTabletError* error = tablet_errors->Add(); error->set_tablet_id(tablet_id); error->set_msg(err_msg); - tablet_writer_it->second->cancel_with_status(st); + static_cast(tablet_writer_it->second->cancel_with_status(st)); _add_broken_tablet(tablet_id); // continue write to other tablet. // the error will return back to sender. diff --git a/be/src/service/arrow_flight/flight_sql_service.cpp b/be/src/service/arrow_flight/flight_sql_service.cpp index 719f7a466c..60b665c62f 100644 --- a/be/src/service/arrow_flight/flight_sql_service.cpp +++ b/be/src/service/arrow_flight/flight_sql_service.cpp @@ -88,7 +88,7 @@ arrow::Result> FlightSqlServer::create() { } FlightSqlServer::~FlightSqlServer() { - join(); + static_cast(join()); } arrow::Result> FlightSqlServer::DoGetStatement( diff --git a/be/src/service/backend_service.cpp b/be/src/service/backend_service.cpp index 98f8d554bd..69c9e6608e 100644 --- a/be/src/service/backend_service.cpp +++ b/be/src/service/backend_service.cpp @@ -223,7 +223,8 @@ int64_t BackendService::get_trash_used_capacity() { int64_t result = 0; std::vector data_dir_infos; - StorageEngine::instance()->get_all_data_dir_info(&data_dir_infos, false /*do not update */); + static_cast(StorageEngine::instance()->get_all_data_dir_info(&data_dir_infos, + false /*do not update */)); // uses excute sql `show trash`, then update backend trash capacity too. StorageEngine::instance()->notify_listener(TaskWorkerPool::TaskWorkerType::REPORT_DISK_STATE); @@ -237,7 +238,8 @@ int64_t BackendService::get_trash_used_capacity() { void BackendService::get_disk_trash_used_capacity(std::vector& diskTrashInfos) { std::vector data_dir_infos; - StorageEngine::instance()->get_all_data_dir_info(&data_dir_infos, false /*do not update */); + static_cast(StorageEngine::instance()->get_all_data_dir_info(&data_dir_infos, + false /*do not update */)); // uses excute sql `show trash on `, then update backend trash capacity too. StorageEngine::instance()->notify_listener(TaskWorkerPool::TaskWorkerType::REPORT_DISK_STATE); @@ -273,7 +275,7 @@ void BackendService::open_scanner(TScanOpenResult& result_, const TScanOpenParam TStatus t_status; TUniqueId fragment_instance_id = generate_uuid(); std::shared_ptr p_context; - _exec_env->external_scan_context_mgr()->create_scan_context(&p_context); + static_cast(_exec_env->external_scan_context_mgr()->create_scan_context(&p_context)); p_context->fragment_instance_id = fragment_instance_id; p_context->offset = 0; p_context->last_access_time = time(nullptr); @@ -381,8 +383,9 @@ void BackendService::get_stream_load_record(TStreamLoadRecordResult& result, } void BackendService::clean_trash() { - StorageEngine::instance()->start_trash_sweep(nullptr, true); - StorageEngine::instance()->notify_listener(TaskWorkerPool::TaskWorkerType::REPORT_DISK_STATE); + static_cast(StorageEngine::instance()->start_trash_sweep(nullptr, true)); + static_cast(StorageEngine::instance()->notify_listener( + TaskWorkerPool::TaskWorkerType::REPORT_DISK_STATE)); } void BackendService::check_storage_format(TCheckStorageFormatResult& result) { @@ -688,11 +691,11 @@ void BackendService::ingest_binlog(TIngestBinlogResult& result, } } - local_tablet->commit_phase_update_delete_bitmap(rowset, pre_rowset_ids, delete_bitmap, - segments, txn_id, - calc_delete_bitmap_token.get(), nullptr); - calc_delete_bitmap_token->wait(); - calc_delete_bitmap_token->get_delete_bitmap(delete_bitmap); + static_cast(local_tablet->commit_phase_update_delete_bitmap( + rowset, pre_rowset_ids, delete_bitmap, segments, txn_id, + calc_delete_bitmap_token.get(), nullptr)); + static_cast(calc_delete_bitmap_token->wait()); + static_cast(calc_delete_bitmap_token->get_delete_bitmap(delete_bitmap)); } // Step 6.3: commit txn diff --git a/be/src/service/http_service.cpp b/be/src/service/http_service.cpp index fd9f348506..41578d976d 100644 --- a/be/src/service/http_service.cpp +++ b/be/src/service/http_service.cpp @@ -22,6 +22,7 @@ #include #include "common/config.h" +#include "common/status.h" #include "http/action/check_rpc_channel_action.h" #include "http/action/check_tablet_segment_action.h" #include "http/action/checksum_action.h" @@ -150,10 +151,10 @@ Status HttpService::start() { tablet_migration_action); // register pprof actions - PprofActions::setup(_env, _ev_http_server.get(), _pool); + static_cast(PprofActions::setup(_env, _ev_http_server.get(), _pool)); // register jeprof actions - JeprofileActions::setup(_env, _ev_http_server.get(), _pool); + static_cast(JeprofileActions::setup(_env, _ev_http_server.get(), _pool)); // register metrics { diff --git a/be/src/service/internal_service.cpp b/be/src/service/internal_service.cpp index 28181fb90f..4e770cd9b8 100644 --- a/be/src/service/internal_service.cpp +++ b/be/src/service/internal_service.cpp @@ -664,7 +664,8 @@ void PInternalServiceImpl::fetch_table_schema(google::protobuf::RpcController* c std::vector file_slots; reader = vectorized::AvroJNIReader::create_unique(profile.get(), params, range, file_slots); - ((vectorized::AvroJNIReader*)(reader.get()))->init_fetch_table_schema_reader(); + static_cast( + ((vectorized::AvroJNIReader*)(reader.get()))->init_fetch_table_schema_reader()); break; } default: @@ -1065,7 +1066,7 @@ void PInternalServiceImpl::commit(google::protobuf::RpcController* controller, response->mutable_status()->set_status_code(1); response->mutable_status()->add_error_msgs("could not find stream load context"); } else { - stream_load_ctx->pipe->finish(); + static_cast(stream_load_ctx->pipe->finish()); response->mutable_status()->set_status_code(0); } }); @@ -1703,7 +1704,7 @@ Status PInternalServiceImpl::_multi_get(const PMultiGetRequest& request, .stats = &stats, .io_ctx = io::IOContext {.reader_type = ReaderType::READER_QUERY}, }; - column_iterator->init(opt); + static_cast(column_iterator->init(opt)); std::vector single_row_loc { static_cast(row_loc.ordinal_id())}; RETURN_IF_ERROR(column_iterator->read_by_rowids(single_row_loc.data(), 1, column)); diff --git a/be/src/util/arrow/row_batch.cpp b/be/src/util/arrow/row_batch.cpp index b60034696a..d78c9ebf1f 100644 --- a/be/src/util/arrow/row_batch.cpp +++ b/be/src/util/arrow/row_batch.cpp @@ -95,7 +95,7 @@ Status convert_to_arrow_type(const TypeDescriptor& type, std::shared_ptr item_type; - convert_to_arrow_type(type.children[0], &item_type); + static_cast(convert_to_arrow_type(type.children[0], &item_type)); *result = std::make_shared(item_type); break; } @@ -103,8 +103,8 @@ Status convert_to_arrow_type(const TypeDescriptor& type, std::shared_ptr key_type; std::shared_ptr val_type; - convert_to_arrow_type(type.children[0], &key_type); - convert_to_arrow_type(type.children[1], &val_type); + static_cast(convert_to_arrow_type(type.children[0], &key_type)); + static_cast(convert_to_arrow_type(type.children[1], &val_type)); *result = std::make_shared(key_type, val_type); break; } @@ -113,7 +113,7 @@ Status convert_to_arrow_type(const TypeDescriptor& type, std::shared_ptr> fields; for (size_t i = 0; i < type.children.size(); i++) { std::shared_ptr field_type; - convert_to_arrow_type(type.children[i], &field_type); + static_cast(convert_to_arrow_type(type.children[i], &field_type)); fields.push_back(std::make_shared(type.field_names[i], field_type, type.contains_nulls[i])); } diff --git a/be/src/util/pprof_utils.cpp b/be/src/util/pprof_utils.cpp index 18f62fb1de..c7f35ea299 100644 --- a/be/src/util/pprof_utils.cpp +++ b/be/src/util/pprof_utils.cpp @@ -117,7 +117,7 @@ Status PprofUtils::get_readable_profile(const std::string& file_or_content, bool bool rc = util.exec_cmd(final_cmd, &cmd_output, false); // delete raw file - io::global_local_filesystem()->delete_file(file_or_content); + static_cast(io::global_local_filesystem()->delete_file(file_or_content)); if (!rc) { return Status::InternalError("Failed to execute command: {}", cmd_output); @@ -160,7 +160,7 @@ Status PprofUtils::generate_flamegraph(int32_t sample_seconds, std::string cmd_output; bool rc = util.exec_cmd(cmd.str(), &cmd_output); if (!rc) { - io::global_local_filesystem()->delete_file(tmp_file.str()); + static_cast(io::global_local_filesystem()->delete_file(tmp_file.str())); return Status::InternalError("Failed to execute perf command: {}", cmd_output); } @@ -176,8 +176,8 @@ Status PprofUtils::generate_flamegraph(int32_t sample_seconds, << " | " << flamegraph_pl << " > " << graph_file.str(); rc = util.exec_cmd(gen_cmd.str(), &res_content); if (!rc) { - io::global_local_filesystem()->delete_file(tmp_file.str()); - io::global_local_filesystem()->delete_file(graph_file.str()); + static_cast(io::global_local_filesystem()->delete_file(tmp_file.str())); + static_cast(io::global_local_filesystem()->delete_file(graph_file.str())); return Status::InternalError("Failed to execute perf script command: {}", res_content); } *svg_file_or_content = graph_file.str(); @@ -187,7 +187,7 @@ Status PprofUtils::generate_flamegraph(int32_t sample_seconds, << " | " << flamegraph_pl; rc = util.exec_cmd(gen_cmd.str(), &res_content, false); if (!rc) { - io::global_local_filesystem()->delete_file(tmp_file.str()); + static_cast(io::global_local_filesystem()->delete_file(tmp_file.str())); return Status::InternalError("Failed to execute perf script command: {}", res_content); } *svg_file_or_content = res_content; diff --git a/be/src/util/thread.cpp b/be/src/util/thread.cpp index c0f3fd2919..cf7bd63a87 100644 --- a/be/src/util/thread.cpp +++ b/be/src/util/thread.cpp @@ -337,7 +337,7 @@ void Thread::set_thread_nice_value() { #endif void Thread::join() { - ThreadJoiner(this).join(); + static_cast(ThreadJoiner(this).join()); } int64_t Thread::tid() const { diff --git a/be/src/util/threadpool.cpp b/be/src/util/threadpool.cpp index 5eddabaa68..15fb36181d 100644 --- a/be/src/util/threadpool.cpp +++ b/be/src/util/threadpool.cpp @@ -477,7 +477,7 @@ void ThreadPool::dispatch_thread() { _num_threads_pending_start--; if (_cgroup_cpu_ctl != nullptr) { - _cgroup_cpu_ctl->add_thread_to_cgroup(); + static_cast(_cgroup_cpu_ctl->add_thread_to_cgroup()); } // Owned by this worker thread and added/removed from _idle_threads as needed. diff --git a/be/src/util/thrift_rpc_helper.cpp b/be/src/util/thrift_rpc_helper.cpp index bc0861d7ff..0f9d3fae5c 100644 --- a/be/src/util/thrift_rpc_helper.cpp +++ b/be/src/util/thrift_rpc_helper.cpp @@ -92,7 +92,7 @@ Status ThriftRpcHelper::rpc(const std::string& ip, const int32_t port, std::this_thread::sleep_for( std::chrono::milliseconds(config::thrift_client_retry_interval_ms * 2)); // just reopen to disable this connection - client.reopen(timeout_ms); + static_cast(client.reopen(timeout_ms)); return Status::RpcError("failed to call frontend service, reason: {}", e.what()); } return Status::OK(); diff --git a/be/src/util/work_thread_pool.hpp b/be/src/util/work_thread_pool.hpp index bf0555db1c..bc8fa8eed6 100644 --- a/be/src/util/work_thread_pool.hpp +++ b/be/src/util/work_thread_pool.hpp @@ -107,7 +107,7 @@ public: // Blocks until all threads are finished. shutdown does not need to have been called, // since it may be called on a separate thread. - virtual void join() { _threads.join_all(); } + virtual void join() { static_cast(_threads.join_all()); } virtual uint32_t get_queue_size() const { return _work_queue.get_size(); } virtual uint32_t get_active_threads() const { return _active_threads; } 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 af0ae185a1..816576046f 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h +++ b/be/src/vec/aggregate_functions/aggregate_function_java_udaf.h @@ -519,7 +519,7 @@ public: SAFE_CREATE(RETURN_IF_STATUS_ERROR(status, this->data(place).init_udaf(_fn, _local_location)), { - this->data(place).destroy(); + static_cast(this->data(place).destroy()); this->data(place).~Data(); }); _first_created = false; @@ -530,7 +530,7 @@ public: // To avoid multiple times JNI call, Here will destroy all data at once void destroy(AggregateDataPtr __restrict place) const noexcept override { if (place == _exec_place) { - this->data(_exec_place).destroy(); + static_cast(this->data(_exec_place).destroy()); this->data(_exec_place).~Data(); _first_created = true; } diff --git a/be/src/vec/aggregate_functions/aggregate_function_rpc.h b/be/src/vec/aggregate_functions/aggregate_function_rpc.h index 4b75c64d82..4c0fe441f7 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_rpc.h +++ b/be/src/vec/aggregate_functions/aggregate_function_rpc.h @@ -75,7 +75,7 @@ public: bool has_error() { return _error == true; } Status merge(AggregateRpcUdafData& rhs) { - send_buffer_to_rpc_server(); + static_cast(send_buffer_to_rpc_server()); if (has_last_result()) { PFunctionCallRequest request; PFunctionCallResponse response; @@ -192,10 +192,10 @@ public: Status buffer_add(const IColumn** columns, int start, int end, const DataTypes& argument_types) { PFunctionCallRequest request; - gen_request_data(request, columns, start, end, argument_types); + static_cast(gen_request_data(request, columns, start, end, argument_types)); _buffer_request.push_back(request); if (_buffer_request.size() >= max_buffered_rows) { - send_buffer_to_rpc_server(); + static_cast(send_buffer_to_rpc_server()); } return Status::OK(); } @@ -226,7 +226,7 @@ public: PFunctionCallResponse response; brpc::Controller cntl; request.set_function_name(_update_fn); - gen_request_data(request, columns, start, end, argument_types); + static_cast(gen_request_data(request, columns, start, end, argument_types)); if (has_last_result()) { request.mutable_context()->mutable_function_context()->mutable_args_data()->CopyFrom( _res.result()); @@ -238,7 +238,7 @@ public: } void serialize(BufferWritable& buf) { - send_buffer_to_rpc_server(); + static_cast(send_buffer_to_rpc_server()); std::string serialize_data = error_default_str; if (!has_error()) { serialize_data = _res.SerializeAsString(); @@ -249,7 +249,7 @@ public: } void deserialize(BufferReadable& buf) { - send_buffer_to_rpc_server(); + static_cast(send_buffer_to_rpc_server()); std::string serialize_data; read_binary(serialize_data, buf); if (error_default_str != serialize_data) { @@ -278,14 +278,14 @@ public: to.insert_default(); return Status::OK(); } - send_buffer_to_rpc_server(); + static_cast(send_buffer_to_rpc_server()); PFunctionCallRequest request; PFunctionCallResponse response; brpc::Controller cntl; request.set_function_name(_finalize_fn); request.mutable_context()->mutable_function_context()->mutable_args_data()->CopyFrom( _res.result()); - send_rpc_request(cntl, request, response); + static_cast(send_rpc_request(cntl, request, response)); if (has_error()) { to.insert_default(); return Status::OK(); @@ -328,7 +328,7 @@ public: } PFunctionCallResponse get_result() { - send_buffer_to_rpc_server(); + static_cast(send_buffer_to_rpc_server()); return _res; } }; @@ -359,19 +359,20 @@ public: void add(AggregateDataPtr __restrict place, const IColumn** columns, size_t row_num, Arena*) const override { - this->data(place).buffer_add(columns, row_num, row_num + 1, argument_types); + static_cast( + this->data(place).buffer_add(columns, row_num, row_num + 1, argument_types)); } void add_batch_single_place(size_t batch_size, AggregateDataPtr place, const IColumn** columns, Arena* arena) const override { - this->data(place).add(columns, 0, batch_size, argument_types); + static_cast(this->data(place).add(columns, 0, batch_size, argument_types)); } void reset(AggregateDataPtr place) const override {} void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, Arena*) const override { - this->data(place).merge(this->data(const_cast(rhs))); + static_cast(this->data(place).merge(this->data(const_cast(rhs)))); } void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { @@ -384,7 +385,7 @@ public: } void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { - this->data(const_cast(place)).get(to, _return_type); + static_cast(this->data(const_cast(place)).get(to, _return_type)); } private: diff --git a/be/src/vec/aggregate_functions/aggregate_function_sort.h b/be/src/vec/aggregate_functions/aggregate_function_sort.h index 39d7fd184f..9026060c82 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sort.h +++ b/be/src/vec/aggregate_functions/aggregate_function_sort.h @@ -75,8 +75,9 @@ struct AggregateFunctionSortData { PBlock pblock; size_t uncompressed_bytes = 0; size_t compressed_bytes = 0; - block.serialize(state->be_exec_version(), &pblock, &uncompressed_bytes, &compressed_bytes, - segment_v2::CompressionTypePB::SNAPPY); + static_cast(block.serialize(state->be_exec_version(), &pblock, &uncompressed_bytes, + &compressed_bytes, + segment_v2::CompressionTypePB::SNAPPY)); write_string_binary(pblock.SerializeAsString(), buf); } diff --git a/be/src/vec/columns/column_map.cpp b/be/src/vec/columns/column_map.cpp index 58a253c52c..321f55677c 100644 --- a/be/src/vec/columns/column_map.cpp +++ b/be/src/vec/columns/column_map.cpp @@ -28,6 +28,7 @@ #include #include +#include "common/status.h" #include "vec/common/arena.h" #include "vec/common/typeid_cast.h" #include "vec/common/unaligned.h" @@ -432,8 +433,10 @@ Status ColumnMap::filter_by_selector(const uint16_t* sel, size_t sel_size, IColu } if (nested_sel_size > 0) { - keys_column->filter_by_selector(nested_sel.get(), nested_sel_size, &to->get_keys()); - values_column->filter_by_selector(nested_sel.get(), nested_sel_size, &to->get_values()); + static_cast(keys_column->filter_by_selector(nested_sel.get(), nested_sel_size, + &to->get_keys())); + static_cast(values_column->filter_by_selector(nested_sel.get(), nested_sel_size, + &to->get_values())); } return Status::OK(); } diff --git a/be/src/vec/columns/column_object.cpp b/be/src/vec/columns/column_object.cpp index 050939f8fa..b3dec81155 100644 --- a/be/src/vec/columns/column_object.cpp +++ b/be/src/vec/columns/column_object.cpp @@ -446,11 +446,12 @@ void ColumnObject::Subcolumn::finalize() { part->get_indices_of_non_default_rows(offsets_data, 0, part_size); if (offsets->size() == part_size) { ColumnPtr ptr; - schema_util::cast_column({part, from_type, ""}, to_type, &ptr); + static_cast(schema_util::cast_column({part, from_type, ""}, to_type, &ptr)); part = ptr; } else { auto values = part->index(*offsets, offsets->size()); - schema_util::cast_column({values, from_type, ""}, to_type, &values); + static_cast( + schema_util::cast_column({values, from_type, ""}, to_type, &values)); part = values->create_with_offsets(offsets_data, to_type->get_default(), part_size, /*shift=*/0); } diff --git a/be/src/vec/columns/column_struct.cpp b/be/src/vec/columns/column_struct.cpp index 78c438a5e1..0bcc1ff276 100644 --- a/be/src/vec/columns/column_struct.cpp +++ b/be/src/vec/columns/column_struct.cpp @@ -267,7 +267,7 @@ Status ColumnStruct::filter_by_selector(const uint16_t* sel, size_t sel_size, IC const size_t tuple_size = columns.size(); DCHECK_EQ(to->tuple_size(), tuple_size); for (size_t i = 0; i < tuple_size; ++i) { - columns[i]->filter_by_selector(sel, sel_size, &to->get_column(i)); + static_cast(columns[i]->filter_by_selector(sel, sel_size, &to->get_column(i))); } return Status::OK(); } diff --git a/be/src/vec/common/sort/sorter.cpp b/be/src/vec/common/sort/sorter.cpp index ae8868ff2a..2db1499b99 100644 --- a/be/src/vec/common/sort/sorter.cpp +++ b/be/src/vec/common/sort/sorter.cpp @@ -357,7 +357,7 @@ Status FullSorter::_do_sort() { // if one block totally greater the heap top of _block_priority_queue // we can throw the block data directly. if (_state->num_rows() < _offset + _limit) { - _state->add_sorted_block(desc_block); + static_cast(_state->add_sorted_block(desc_block)); // if it's spilled, sorted_block is not added into sorted block vector, // so it's should not be added to _block_priority_queue, since // sorted_block will be destroyed when _do_sort is finished @@ -370,7 +370,7 @@ Status FullSorter::_do_sort() { std::make_unique(desc_block, _sort_description); MergeSortBlockCursor block_cursor(tmp_cursor_impl.get()); if (!block_cursor.totally_greater(_block_priority_queue.top())) { - _state->add_sorted_block(desc_block); + static_cast(_state->add_sorted_block(desc_block)); if (!_state->is_spilled()) { _block_priority_queue.emplace(_pool->add(new MergeSortCursorImpl( _state->last_sorted_block(), _sort_description))); @@ -379,7 +379,7 @@ Status FullSorter::_do_sort() { } } else { // dispose normal sort logic - _state->add_sorted_block(desc_block); + static_cast(_state->add_sorted_block(desc_block)); } if (_state->is_spilled()) { std::priority_queue tmp; diff --git a/be/src/vec/common/sort/topn_sorter.cpp b/be/src/vec/common/sort/topn_sorter.cpp index 8a44528daf..e24c0d5e9d 100644 --- a/be/src/vec/common/sort/topn_sorter.cpp +++ b/be/src/vec/common/sort/topn_sorter.cpp @@ -72,7 +72,7 @@ Status TopNSorter::_do_sort(Block* block) { // if one block totally greater the heap top of _block_priority_queue // we can throw the block data directly. if (_state->num_rows() < _offset + _limit) { - _state->add_sorted_block(sorted_block); + static_cast(_state->add_sorted_block(sorted_block)); // if it's spilled, sorted_block is not added into sorted block vector, // so it's should not be added to _block_priority_queue, since // sorted_block will be destroyed when _do_sort is finished @@ -86,14 +86,14 @@ Status TopNSorter::_do_sort(Block* block) { std::make_unique(sorted_block, _sort_description); MergeSortBlockCursor block_cursor(tmp_cursor_impl.get()); if (!block_cursor.totally_greater(_block_priority_queue.top())) { - _state->add_sorted_block(sorted_block); + static_cast(_state->add_sorted_block(sorted_block)); if (!_state->is_spilled()) { _block_priority_queue.emplace(_pool->add(new MergeSortCursorImpl( _state->last_sorted_block(), _sort_description))); } } } else { - _state->add_sorted_block(sorted_block); + static_cast(_state->add_sorted_block(sorted_block)); } } } else { diff --git a/be/src/vec/core/block_spill_reader.cpp b/be/src/vec/core/block_spill_reader.cpp index 57bea75a00..34a157e952 100644 --- a/be/src/vec/core/block_spill_reader.cpp +++ b/be/src/vec/core/block_spill_reader.cpp @@ -154,7 +154,7 @@ Status BlockSpillReader::close() { ExecEnv::GetInstance()->block_spill_mgr()->remove(stream_id_); file_reader_.reset(); if (delete_after_read_) { - io::global_local_filesystem()->delete_file(file_path_); + static_cast(io::global_local_filesystem()->delete_file(file_path_)); } return Status::OK(); } diff --git a/be/src/vec/core/block_spill_reader.h b/be/src/vec/core/block_spill_reader.h index c87c13b56c..498a041160 100644 --- a/be/src/vec/core/block_spill_reader.h +++ b/be/src/vec/core/block_spill_reader.h @@ -44,7 +44,7 @@ public: _init_profile(); } - ~BlockSpillReader() { close(); } + ~BlockSpillReader() { static_cast(close()); } Status open(); diff --git a/be/src/vec/core/block_spill_writer.h b/be/src/vec/core/block_spill_writer.h index 1d41888e77..f4d8a6bda9 100644 --- a/be/src/vec/core/block_spill_writer.h +++ b/be/src/vec/core/block_spill_writer.h @@ -47,7 +47,7 @@ public: _init_profile(); } - ~BlockSpillWriter() { close(); } + ~BlockSpillWriter() { static_cast(close()); } Status open(); diff --git a/be/src/vec/data_types/serde/data_type_array_serde.cpp b/be/src/vec/data_types/serde/data_type_array_serde.cpp index 25b628e20a..21b9b14c21 100644 --- a/be/src/vec/data_types/serde/data_type_array_serde.cpp +++ b/be/src/vec/data_types/serde/data_type_array_serde.cpp @@ -338,8 +338,9 @@ Status DataTypeArraySerDe::write_column_to_orc(const IColumn& column, const Null size_t next_offset = offsets[row_id]; if (cur_batch->notNull[row_id] == 1) { - nested_serde->write_column_to_orc(nested_column, nullptr, cur_batch->elements.get(), - offset, next_offset, buffer_list); + static_cast(nested_serde->write_column_to_orc(nested_column, nullptr, + cur_batch->elements.get(), offset, + next_offset, buffer_list)); } cur_batch->offsets[row_id + 1] = next_offset; diff --git a/be/src/vec/data_types/serde/data_type_map_serde.cpp b/be/src/vec/data_types/serde/data_type_map_serde.cpp index f46962f597..dceec0ccac 100644 --- a/be/src/vec/data_types/serde/data_type_map_serde.cpp +++ b/be/src/vec/data_types/serde/data_type_map_serde.cpp @@ -487,11 +487,12 @@ Status DataTypeMapSerDe::write_column_to_orc(const IColumn& column, const NullMa size_t next_offset = offsets[row_id]; if (cur_batch->notNull[row_id] == 1) { - key_serde->write_column_to_orc(nested_keys_column, nullptr, cur_batch->keys.get(), - offset, next_offset, buffer_list); - value_serde->write_column_to_orc(nested_values_column, nullptr, - cur_batch->elements.get(), offset, next_offset, - buffer_list); + static_cast(key_serde->write_column_to_orc(nested_keys_column, nullptr, + cur_batch->keys.get(), offset, + next_offset, buffer_list)); + static_cast(value_serde->write_column_to_orc(nested_values_column, nullptr, + cur_batch->elements.get(), offset, + next_offset, buffer_list)); } cur_batch->offsets[row_id + 1] = next_offset; diff --git a/be/src/vec/data_types/serde/data_type_nullable_serde.cpp b/be/src/vec/data_types/serde/data_type_nullable_serde.cpp index cc3a97d154..e5c6e5c45d 100644 --- a/be/src/vec/data_types/serde/data_type_nullable_serde.cpp +++ b/be/src/vec/data_types/serde/data_type_nullable_serde.cpp @@ -321,9 +321,9 @@ Status DataTypeNullableSerDe::write_column_to_orc(const IColumn& column, const N // because orc_null_map begins at start and only has (end - start) elements memcpy(orc_col_batch->notNull.data() + start, orc_null_map.data(), end - start); - nested_serde->write_column_to_orc(column_nullable.get_nested_column(), - &column_nullable.get_null_map_data(), orc_col_batch, start, - end, buffer_list); + static_cast(nested_serde->write_column_to_orc(column_nullable.get_nested_column(), + &column_nullable.get_null_map_data(), + orc_col_batch, start, end, buffer_list)); return Status::OK(); } diff --git a/be/src/vec/data_types/serde/data_type_struct_serde.cpp b/be/src/vec/data_types/serde/data_type_struct_serde.cpp index 5803d536a2..9f8078f4b3 100644 --- a/be/src/vec/data_types/serde/data_type_struct_serde.cpp +++ b/be/src/vec/data_types/serde/data_type_struct_serde.cpp @@ -351,9 +351,9 @@ Status DataTypeStructSerDe::write_column_to_orc(const IColumn& column, const Nul for (size_t row_id = start; row_id < end; row_id++) { if (cur_batch->notNull[row_id] == 1) { for (int i = 0; i < struct_col.tuple_size(); ++i) { - elemSerDeSPtrs[i]->write_column_to_orc(struct_col.get_column(i), nullptr, - cur_batch->fields[i], row_id, row_id + 1, - buffer_list); + static_cast(elemSerDeSPtrs[i]->write_column_to_orc( + struct_col.get_column(i), nullptr, cur_batch->fields[i], row_id, row_id + 1, + buffer_list)); } } else { // This else is necessary diff --git a/be/src/vec/exec/format/avro/avro_jni_reader.cpp b/be/src/vec/exec/format/avro/avro_jni_reader.cpp index 5a347a0e59..16a6e7bc6b 100644 --- a/be/src/vec/exec/format/avro/avro_jni_reader.cpp +++ b/be/src/vec/exec/format/avro/avro_jni_reader.cpp @@ -95,7 +95,7 @@ Status AvroJNIReader::init_fetch_table_reader( required_param.insert(_params.properties.begin(), _params.properties.end()); break; default: - Status::InternalError("unsupported file reader type: {}", std::to_string(type)); + return Status::InternalError("unsupported file reader type: {}", std::to_string(type)); } required_param.insert(_params.properties.begin(), _params.properties.end()); _jni_connector = std::make_unique("org/apache/doris/avro/AvroJNIScanner", diff --git a/be/src/vec/exec/format/csv/csv_reader.cpp b/be/src/vec/exec/format/csv/csv_reader.cpp index 7f7ce0a7d0..bdfc685a3a 100644 --- a/be/src/vec/exec/format/csv/csv_reader.cpp +++ b/be/src/vec/exec/format/csv/csv_reader.cpp @@ -480,7 +480,6 @@ Status CsvReader::get_next_block(Block* block, size_t* read_rows, bool* eof) { RETURN_IF_ERROR(_validate_line(Slice(ptr, size), &success)); ++rows; } - for (auto& col : block->mutate_columns()) { col->resize(rows); } @@ -669,10 +668,10 @@ Status CsvReader::_fill_dest_columns(const Slice& line, Block* block, // So we use deserialize_nullable_string and stringSerDe to reduce virtual function calls. switch (_text_serde_type) { case TTextSerdeType::JSON_TEXT_SERDE: - deserialize_nullable_string(*col_ptr, slice); + static_cast(deserialize_nullable_string(*col_ptr, slice)); break; case TTextSerdeType::HIVE_TEXT_SERDE: - deserialize_nullable_string(*col_ptr, slice); + static_cast(deserialize_nullable_string(*col_ptr, slice)); break; default: break; @@ -680,10 +679,12 @@ Status CsvReader::_fill_dest_columns(const Slice& line, Block* block, } else { switch (_text_serde_type) { case TTextSerdeType::JSON_TEXT_SERDE: - _serdes[i]->deserialize_one_cell_from_json(*col_ptr, slice, _options); + static_cast( + _serdes[i]->deserialize_one_cell_from_json(*col_ptr, slice, _options)); break; case TTextSerdeType::HIVE_TEXT_SERDE: - _serdes[i]->deserialize_one_cell_from_hive_text(*col_ptr, slice, _options); + static_cast( + _serdes[i]->deserialize_one_cell_from_hive_text(*col_ptr, slice, _options)); break; default: break; @@ -957,7 +958,7 @@ void CsvReader::close() { } if (_file_reader) { - _file_reader->close(); + static_cast(_file_reader->close()); } } diff --git a/be/src/vec/exec/format/orc/vorc_reader.cpp b/be/src/vec/exec/format/orc/vorc_reader.cpp index 06f41a2edc..c1228c9d45 100644 --- a/be/src/vec/exec/format/orc/vorc_reader.cpp +++ b/be/src/vec/exec/format/orc/vorc_reader.cpp @@ -786,7 +786,7 @@ Status OrcReader::set_fill_columns( _batch = _row_reader->createRowBatch(_batch_size); auto& selected_type = _row_reader->getSelectedType(); int idx = 0; - _init_select_types(selected_type, idx); + static_cast(_init_select_types(selected_type, idx)); _remaining_rows = _row_reader->getNumberOfRows(); @@ -826,7 +826,7 @@ Status OrcReader::_init_select_types(const orc::Type& type, int idx) { const orc::Type* sub_type = type.getSubtype(i); _col_orc_type.push_back(sub_type); if (_is_acid && sub_type->getKind() == orc::TypeKind::STRUCT) { - _init_select_types(*sub_type, idx); + static_cast(_init_select_types(*sub_type, idx)); } } return Status::OK(); @@ -1509,7 +1509,7 @@ Status OrcReader::get_next_block(Block* block, size_t* read_rows, bool* eof) { _fill_missing_columns(block, _batch->numElements, _lazy_read_ctx.missing_columns)); if (block->rows() == 0) { - _convert_dict_cols_to_string_cols(block, nullptr); + static_cast(_convert_dict_cols_to_string_cols(block, nullptr)); *eof = true; return Status::OK(); } @@ -1545,11 +1545,11 @@ Status OrcReader::get_next_block(Block* block, size_t* read_rows, bool* eof) { std::move(*block->get_by_position(col).column).assume_mutable()->clear(); } Block::erase_useless_column(block, column_to_keep); - _convert_dict_cols_to_string_cols(block, &batch_vec); + static_cast(_convert_dict_cols_to_string_cols(block, &batch_vec)); return Status::OK(); } if (!_not_single_slot_filter_conjuncts.empty()) { - _convert_dict_cols_to_string_cols(block, &batch_vec); + static_cast(_convert_dict_cols_to_string_cols(block, &batch_vec)); std::vector merged_filters; merged_filters.push_back(&result_filter); RETURN_IF_CATCH_EXCEPTION( @@ -1560,7 +1560,7 @@ Status OrcReader::get_next_block(Block* block, size_t* read_rows, bool* eof) { RETURN_IF_CATCH_EXCEPTION( Block::filter_block_internal(block, columns_to_filter, result_filter)); Block::erase_useless_column(block, column_to_keep); - _convert_dict_cols_to_string_cols(block, &batch_vec); + static_cast(_convert_dict_cols_to_string_cols(block, &batch_vec)); } } else { if (_delete_rows_filter_ptr) { @@ -1568,7 +1568,7 @@ Status OrcReader::get_next_block(Block* block, size_t* read_rows, bool* eof) { (*_delete_rows_filter_ptr))); } Block::erase_useless_column(block, column_to_keep); - _convert_dict_cols_to_string_cols(block, &batch_vec); + static_cast(_convert_dict_cols_to_string_cols(block, &batch_vec)); } } return Status::OK(); @@ -1710,9 +1710,9 @@ Status OrcReader::filter(orc::ColumnVectorBatch& data, uint16_t* sel, uint16_t s } data.numElements = new_size; if (data.numElements > 0) { - _convert_dict_cols_to_string_cols(block, &batch_vec); + static_cast(_convert_dict_cols_to_string_cols(block, &batch_vec)); } else { - _convert_dict_cols_to_string_cols(block, nullptr); + static_cast(_convert_dict_cols_to_string_cols(block, nullptr)); } return Status::OK(); } @@ -1936,7 +1936,7 @@ Status OrcReader::on_string_dicts_loaded( } // 4. Rewrite conjuncts. - _rewrite_dict_conjuncts(dict_codes, slot_id, dict_column->is_nullable()); + static_cast(_rewrite_dict_conjuncts(dict_codes, slot_id, dict_column->is_nullable())); ++it; } return Status::OK(); diff --git a/be/src/vec/exec/format/orc/vorc_reader.h b/be/src/vec/exec/format/orc/vorc_reader.h index 133c92e7d1..6152c8da8c 100644 --- a/be/src/vec/exec/format/orc/vorc_reader.h +++ b/be/src/vec/exec/format/orc/vorc_reader.h @@ -215,7 +215,7 @@ private: ~ORCFilterImpl() override = default; void filter(orc::ColumnVectorBatch& data, uint16_t* sel, uint16_t size, void* arg) const override { - orcReader->filter(data, sel, size, arg); + static_cast(orcReader->filter(data, sel, size, arg)); } private: @@ -230,13 +230,14 @@ private: virtual void fillDictFilterColumnNames( std::unique_ptr current_strip_information, std::list& column_names) const override { - _orc_reader->fill_dict_filter_column_names(std::move(current_strip_information), - column_names); + static_cast(_orc_reader->fill_dict_filter_column_names( + std::move(current_strip_information), column_names)); } virtual void onStringDictsLoaded( std::unordered_map& column_name_to_dict_map, bool* is_stripe_filtered) const override { - _orc_reader->on_string_dicts_loaded(column_name_to_dict_map, is_stripe_filtered); + static_cast(_orc_reader->on_string_dicts_loaded(column_name_to_dict_map, + is_stripe_filtered)); } private: diff --git a/be/src/vec/exec/format/parquet/vparquet_column_reader.cpp b/be/src/vec/exec/format/parquet/vparquet_column_reader.cpp index b06c56e86d..4143a5e079 100644 --- a/be/src/vec/exec/format/parquet/vparquet_column_reader.cpp +++ b/be/src/vec/exec/format/parquet/vparquet_column_reader.cpp @@ -414,7 +414,7 @@ Status ScalarColumnReader::_read_nested_column(ColumnPtr& doris_column, DataType } RETURN_IF_ERROR(_chunk_reader->decode_values(data_column, type, select_vector, is_dict_filter)); if (ancestor_nulls != 0) { - _chunk_reader->skip_values(ancestor_nulls, false); + static_cast(_chunk_reader->skip_values(ancestor_nulls, false)); } if (!align_rows) { @@ -705,17 +705,18 @@ Status StructColumnReader::read_column_data(ColumnPtr& doris_column, DataTypePtr size_t field_rows = 0; bool field_eof = false; if (i == 0) { - _child_readers[i]->read_column_data(doris_field, doris_type, select_vector, batch_size, - &field_rows, &field_eof, is_dict_filter); + static_cast(_child_readers[i]->read_column_data( + doris_field, doris_type, select_vector, batch_size, &field_rows, &field_eof, + is_dict_filter)); *read_rows = field_rows; *eof = field_eof; } else { while (field_rows < *read_rows && !field_eof) { size_t loop_rows = 0; select_vector.reset(); - _child_readers[i]->read_column_data(doris_field, doris_type, select_vector, - *read_rows - field_rows, &loop_rows, &field_eof, - is_dict_filter); + static_cast(_child_readers[i]->read_column_data( + doris_field, doris_type, select_vector, *read_rows - field_rows, &loop_rows, + &field_eof, is_dict_filter)); field_rows += loop_rows; } DCHECK_EQ(*read_rows, field_rows); diff --git a/be/src/vec/exec/format/parquet/vparquet_file_metadata.cpp b/be/src/vec/exec/format/parquet/vparquet_file_metadata.cpp index 95960f489e..7a164c306c 100644 --- a/be/src/vec/exec/format/parquet/vparquet_file_metadata.cpp +++ b/be/src/vec/exec/format/parquet/vparquet_file_metadata.cpp @@ -30,7 +30,7 @@ FileMetaData::FileMetaData(tparquet::FileMetaData& metadata) : _metadata(metadat Status FileMetaData::init_schema() { if (_metadata.schema[0].num_children <= 0) { - Status::Corruption("Invalid parquet schema"); + return Status::Corruption("Invalid parquet schema"); } return _schema.parse_from_thrift(_metadata.schema); } diff --git a/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp b/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp index ca11a25123..9cde2f1d70 100644 --- a/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp +++ b/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp @@ -860,7 +860,7 @@ Status RowGroupReader::_rewrite_dict_predicates() { } // 4. Rewrite conjuncts. - _rewrite_dict_conjuncts(dict_codes, slot_id, dict_column->is_nullable()); + static_cast(_rewrite_dict_conjuncts(dict_codes, slot_id, dict_column->is_nullable())); ++it; } return Status::OK(); diff --git a/be/src/vec/exec/format/parquet/vparquet_reader.cpp b/be/src/vec/exec/format/parquet/vparquet_reader.cpp index da645175fd..ad97e519f8 100644 --- a/be/src/vec/exec/format/parquet/vparquet_reader.cpp +++ b/be/src/vec/exec/format/parquet/vparquet_reader.cpp @@ -785,8 +785,8 @@ Status ParquetReader::_process_page_index(const tparquet::RowGroup& row_group, auto& conjuncts = conjunct_iter->second; std::vector skipped_page_range; const FieldSchema* col_schema = schema_desc.get_column(read_col); - page_index.collect_skipped_page_range(&column_index, conjuncts, col_schema, - skipped_page_range, *_ctz); + static_cast(page_index.collect_skipped_page_range( + &column_index, conjuncts, col_schema, skipped_page_range, *_ctz)); if (skipped_page_range.empty()) { continue; } @@ -794,8 +794,8 @@ Status ParquetReader::_process_page_index(const tparquet::RowGroup& row_group, RETURN_IF_ERROR(page_index.parse_offset_index(chunk, off_index_buff, &offset_index)); for (int page_id : skipped_page_range) { RowRange skipped_row_range; - page_index.create_skipped_row_range(offset_index, row_group.num_rows, page_id, - &skipped_row_range); + static_cast(page_index.create_skipped_row_range(offset_index, row_group.num_rows, + page_id, &skipped_row_range)); // use the union row range skipped_row_ranges.emplace_back(skipped_row_range); } @@ -837,7 +837,7 @@ Status ParquetReader::_process_page_index(const tparquet::RowGroup& row_group, Status ParquetReader::_process_row_group_filter(const tparquet::RowGroup& row_group, bool* filter_group) { - _process_column_stat_filter(row_group.columns, filter_group); + static_cast(_process_column_stat_filter(row_group.columns, filter_group)); _init_chunk_dicts(); RETURN_IF_ERROR(_process_dict_filter(filter_group)); _init_bloom_filter(); diff --git a/be/src/vec/exec/format/table/iceberg_reader.cpp b/be/src/vec/exec/format/table/iceberg_reader.cpp index c2496f870f..0133354565 100644 --- a/be/src/vec/exec/format/table/iceberg_reader.cpp +++ b/be/src/vec/exec/format/table/iceberg_reader.cpp @@ -125,7 +125,7 @@ Status IcebergTableReader::init_reader( _file_col_names = file_col_names; _colname_to_value_range = colname_to_value_range; auto parquet_meta_kv = parquet_reader->get_metadata_key_values(); - _gen_col_name_maps(parquet_meta_kv); + static_cast(_gen_col_name_maps(parquet_meta_kv)); _gen_file_col_names(); _gen_new_colname_to_value_range(); parquet_reader->set_table_to_file_col_map(_table_col_to_file_col); @@ -271,7 +271,8 @@ Status IcebergTableReader::_position_delete( const_cast(&_state->timezone_obj()), _io_ctx, _state); if (!init_schema) { - delete_reader.get_parsed_schema(&delete_file_col_names, &delete_file_col_types); + static_cast(delete_reader.get_parsed_schema(&delete_file_col_names, + &delete_file_col_types)); init_schema = true; } create_status = delete_reader.open(); @@ -288,7 +289,7 @@ Status IcebergTableReader::_position_delete( std::unordered_map> partition_columns; std::unordered_map missing_columns; - delete_reader.set_fill_columns(partition_columns, missing_columns); + static_cast(delete_reader.set_fill_columns(partition_columns, missing_columns)); bool dictionary_coded = true; const tparquet::FileMetaData* meta_data = delete_reader.get_meta_data(); diff --git a/be/src/vec/exec/format/table/transactional_hive_reader.cpp b/be/src/vec/exec/format/table/transactional_hive_reader.cpp index 6f80f31a86..c2ce935369 100644 --- a/be/src/vec/exec/format/table/transactional_hive_reader.cpp +++ b/be/src/vec/exec/format/table/transactional_hive_reader.cpp @@ -146,7 +146,7 @@ Status TransactionalHiveReader::init_row_filters(const TFileRangeDesc& range) { std::unordered_map> partition_columns; std::unordered_map missing_columns; - delete_reader.set_fill_columns(partition_columns, missing_columns); + static_cast(delete_reader.set_fill_columns(partition_columns, missing_columns)); bool eof = false; while (!eof) { diff --git a/be/src/vec/exec/format/wal/wal_reader.cpp b/be/src/vec/exec/format/wal/wal_reader.cpp index f616740e68..9c1f164b9e 100644 --- a/be/src/vec/exec/format/wal/wal_reader.cpp +++ b/be/src/vec/exec/format/wal/wal_reader.cpp @@ -26,7 +26,7 @@ WalReader::WalReader(RuntimeState* state) : _state(state) { } WalReader::~WalReader() { if (_wal_reader.get() != nullptr) { - _wal_reader->finalize(); + static_cast(_wal_reader->finalize()); } } Status WalReader::init_reader() { @@ -48,7 +48,7 @@ Status WalReader::get_next_block(Block* block, size_t* read_rows, bool* eof) { return st; } vectorized::Block tmp_block; - tmp_block.deserialize(pblock); + static_cast(tmp_block.deserialize(pblock)); block->swap(tmp_block); *read_rows = block->rows(); VLOG_DEBUG << "read block rows:" << *read_rows; diff --git a/be/src/vec/exec/join/process_hash_table_probe_impl.h b/be/src/vec/exec/join/process_hash_table_probe_impl.h index 03c903379c..0cee4fe749 100644 --- a/be/src/vec/exec/join/process_hash_table_probe_impl.h +++ b/be/src/vec/exec/join/process_hash_table_probe_impl.h @@ -806,8 +806,9 @@ Status ProcessHashTableProbe::do_other_join_conjuncts( JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN) { orig_columns = _right_col_idx; } - Block::filter_block(output_block, result_column_id, - is_mark_join ? output_block->columns() : orig_columns); + static_cast( + Block::filter_block(output_block, result_column_id, + is_mark_join ? output_block->columns() : orig_columns)); } return Status::OK(); diff --git a/be/src/vec/exec/join/vjoin_node_base.cpp b/be/src/vec/exec/join/vjoin_node_base.cpp index 62c6dd1685..1cb6c6e337 100644 --- a/be/src/vec/exec/join/vjoin_node_base.cpp +++ b/be/src/vec/exec/join/vjoin_node_base.cpp @@ -241,10 +241,10 @@ Status VJoinNodeBase::open(RuntimeState* state) { std::promise thread_status; try { - state->exec_env()->join_node_thread_pool()->submit_func( + static_cast(state->exec_env()->join_node_thread_pool()->submit_func( [this, state, thread_status_p = &thread_status] { this->_probe_side_open_thread(state, thread_status_p); - }); + })); } catch (const std::system_error& e) { return Status::InternalError("In VJoinNodeBase::open create thread fail, reason={}", e.what()); diff --git a/be/src/vec/exec/join/vnested_loop_join_node.cpp b/be/src/vec/exec/join/vnested_loop_join_node.cpp index 3bf7d2ff54..49aa6970ba 100644 --- a/be/src/vec/exec/join/vnested_loop_join_node.cpp +++ b/be/src/vec/exec/join/vnested_loop_join_node.cpp @@ -79,7 +79,7 @@ Status RuntimeFilterBuild::operator()(RuntimeState* state) { if (!runtime_filter_slots.empty() && !_parent->build_blocks().empty()) { SCOPED_TIMER(_parent->push_compute_timer()); for (auto& build_block : _parent->build_blocks()) { - runtime_filter_slots.insert(&build_block); + static_cast(runtime_filter_slots.insert(&build_block)); } } { @@ -189,7 +189,7 @@ Status VNestedLoopJoinNode::_materialize_build_side(RuntimeState* state) { std::placeholders::_3))); } - sink(state, &block, eos); + static_cast(sink(state, &block, eos)); if (eos) { break; @@ -215,7 +215,7 @@ Status VNestedLoopJoinNode::sink(doris::RuntimeState* state, vectorized::Block* if (eos) { COUNTER_UPDATE(_build_rows_counter, _build_rows); - RuntimeFilterBuild(this)(state); + static_cast(RuntimeFilterBuild(this)(state)); // optimize `in bitmap`, see https://github.com/apache/doris/issues/14338 if (_is_output_left_side_only && @@ -270,7 +270,7 @@ Status VNestedLoopJoinNode::get_next(RuntimeState* state, Block* block, bool* eo RETURN_IF_CANCELLED(state); while (need_more_input_data()) { RETURN_IF_ERROR(_fresh_left_block(state)); - push(state, &_left_block, _left_side_eos); + static_cast(push(state, &_left_block, _left_side_eos)); } return pull(state, block, eos); @@ -639,7 +639,7 @@ Status VNestedLoopJoinNode::open(RuntimeState* state) { RETURN_IF_CANCELLED(state); // We can close the right child to release its resources because its input has been // fully consumed. - child(1)->close(state); + static_cast(child(1)->close(state)); return Status::OK(); } diff --git a/be/src/vec/exec/scan/new_es_scanner.cpp b/be/src/vec/exec/scan/new_es_scanner.cpp index 0711e1baea..2f367b728d 100644 --- a/be/src/vec/exec/scan/new_es_scanner.cpp +++ b/be/src/vec/exec/scan/new_es_scanner.cpp @@ -230,7 +230,7 @@ Status NewEsScanner::close(RuntimeState* state) { } if (_es_reader != nullptr) { - _es_reader->close(); + static_cast(_es_reader->close()); } RETURN_IF_ERROR(VScanner::close(state)); diff --git a/be/src/vec/exec/scan/new_olap_scan_node.cpp b/be/src/vec/exec/scan/new_olap_scan_node.cpp index 5aa179d300..46d8f57c73 100644 --- a/be/src/vec/exec/scan/new_olap_scan_node.cpp +++ b/be/src/vec/exec/scan/new_olap_scan_node.cpp @@ -587,8 +587,9 @@ Status NewOlapScanNode::_init_scanners(std::list* scanners) { // dispose some segment tail if (!rs_splits.empty()) { - build_new_scanner(*scan_range, scanner_ranges, - {std::move(rs_splits), read_source.delete_predicates}); + static_cast( + build_new_scanner(*scan_range, scanner_ranges, + {std::move(rs_splits), read_source.delete_predicates})); } } } else { diff --git a/be/src/vec/exec/scan/scanner_context.cpp b/be/src/vec/exec/scan/scanner_context.cpp index 5288f0ce3d..49bdf35737 100644 --- a/be/src/vec/exec/scan/scanner_context.cpp +++ b/be/src/vec/exec/scan/scanner_context.cpp @@ -346,7 +346,7 @@ Status ScannerContext::_close_and_clear_scanners(Parent* parent, RuntimeState* s } // Only unfinished scanners here for (auto& scanner : _scanners) { - scanner->close(state); + static_cast(scanner->close(state)); // Scanners are in ObjPool in ScanNode, // so no need to delete them here. } @@ -376,7 +376,7 @@ void ScannerContext::clear_and_join(Parent* parent, RuntimeState* state) { } // Must wait all running scanners stop running. // So that we can make sure to close all scanners. - _close_and_clear_scanners(parent, state); + static_cast(_close_and_clear_scanners(parent, state)); _blocks_queue.clear(); } @@ -468,7 +468,7 @@ void ScannerContext::get_next_batch_of_scanners(std::list* current _finished_scanner_rows_read.push_back(scanner->get_rows_read()); _finished_scanner_wait_worker_time.push_back( scanner->get_scanner_wait_worker_timer()); - scanner->close(_state); + static_cast(scanner->close(_state)); } else { current_run->push_back(scanner); i++; diff --git a/be/src/vec/exec/scan/scanner_scheduler.cpp b/be/src/vec/exec/scan/scanner_scheduler.cpp index e7e2e79950..c7155bca2a 100644 --- a/be/src/vec/exec/scan/scanner_scheduler.cpp +++ b/be/src/vec/exec/scan/scanner_scheduler.cpp @@ -96,15 +96,15 @@ void ScannerScheduler::stop() { Status ScannerScheduler::init(ExecEnv* env) { // 1. scheduling thread pool and scheduling queues - ThreadPoolBuilder("SchedulingThreadPool") - .set_min_threads(QUEUE_NUM) - .set_max_threads(QUEUE_NUM) - .build(&_scheduler_pool); + static_cast(ThreadPoolBuilder("SchedulingThreadPool") + .set_min_threads(QUEUE_NUM) + .set_max_threads(QUEUE_NUM) + .build(&_scheduler_pool)); _pending_queues = new BlockingQueue*[QUEUE_NUM]; for (int i = 0; i < QUEUE_NUM; i++) { _pending_queues[i] = new BlockingQueue(INT32_MAX); - _scheduler_pool->submit_func([this, i] { this->_schedule_thread(i); }); + static_cast(_scheduler_pool->submit_func([this, i] { this->_schedule_thread(i); })); } // 2. local scan thread pool @@ -113,33 +113,35 @@ Status ScannerScheduler::init(ExecEnv* env) { config::doris_scanner_thread_pool_queue_size, "local_scan")); // 3. remote scan thread pool - ThreadPoolBuilder("RemoteScanThreadPool") - .set_min_threads(config::doris_scanner_thread_pool_thread_num) // 48 default - .set_max_threads(config::doris_max_remote_scanner_thread_pool_thread_num != -1 - ? config::doris_max_remote_scanner_thread_pool_thread_num - : std::max(512, CpuInfo::num_cores() * 10)) - .set_max_queue_size(config::doris_scanner_thread_pool_queue_size) - .build(&_remote_scan_thread_pool); + static_cast( + ThreadPoolBuilder("RemoteScanThreadPool") + .set_min_threads(config::doris_scanner_thread_pool_thread_num) // 48 default + .set_max_threads( + config::doris_max_remote_scanner_thread_pool_thread_num != -1 + ? config::doris_max_remote_scanner_thread_pool_thread_num + : std::max(512, CpuInfo::num_cores() * 10)) + .set_max_queue_size(config::doris_scanner_thread_pool_queue_size) + .build(&_remote_scan_thread_pool)); // 4. limited scan thread pool - ThreadPoolBuilder("LimitedScanThreadPool") - .set_min_threads(config::doris_scanner_thread_pool_thread_num) - .set_max_threads(config::doris_scanner_thread_pool_thread_num) - .set_max_queue_size(config::doris_scanner_thread_pool_queue_size) - .build(&_limited_scan_thread_pool); + static_cast(ThreadPoolBuilder("LimitedScanThreadPool") + .set_min_threads(config::doris_scanner_thread_pool_thread_num) + .set_max_threads(config::doris_scanner_thread_pool_thread_num) + .set_max_queue_size(config::doris_scanner_thread_pool_queue_size) + .build(&_limited_scan_thread_pool)); // 5. task group local scan _task_group_local_scan_queue = std::make_unique( config::doris_scanner_thread_pool_thread_num); - ThreadPoolBuilder("local_scan_group") - .set_min_threads(config::doris_scanner_thread_pool_thread_num) - .set_max_threads(config::doris_scanner_thread_pool_thread_num) - .set_cgroup_cpu_ctl(env->get_cgroup_cpu_ctl()) - .build(&_group_local_scan_thread_pool); + static_cast(ThreadPoolBuilder("local_scan_group") + .set_min_threads(config::doris_scanner_thread_pool_thread_num) + .set_max_threads(config::doris_scanner_thread_pool_thread_num) + .set_cgroup_cpu_ctl(env->get_cgroup_cpu_ctl()) + .build(&_group_local_scan_thread_pool)); for (int i = 0; i < config::doris_scanner_thread_pool_thread_num; i++) { - _group_local_scan_thread_pool->submit_func([this] { + static_cast(_group_local_scan_thread_pool->submit_func([this] { this->_task_group_scanner_scan(this, _task_group_local_scan_queue.get()); - }); + })); } _is_init = true; @@ -347,7 +349,7 @@ void ScannerScheduler::_scanner_scan(ScannerScheduler* scheduler, ScannerContext scanner->set_opened(); } - scanner->try_append_late_arrival_runtime_filter(); + static_cast(scanner->try_append_late_arrival_runtime_filter()); // Because we use thread pool to scan data from storage. One scanner can't // use this thread too long, this can starve other query's scanner. So, we diff --git a/be/src/vec/exec/scan/vfile_scanner.cpp b/be/src/vec/exec/scan/vfile_scanner.cpp index cfd91ba7bc..1b40e31d4d 100644 --- a/be/src/vec/exec/scan/vfile_scanner.cpp +++ b/be/src/vec/exec/scan/vfile_scanner.cpp @@ -860,7 +860,7 @@ Status VFileScanner::_get_next_reader() { _name_to_col_type.clear(); _missing_cols.clear(); - _cur_reader->get_columns(&_name_to_col_type, &_missing_cols); + static_cast(_cur_reader->get_columns(&_name_to_col_type, &_missing_cols)); _cur_reader->set_push_down_agg_type(_get_push_down_agg_type()); RETURN_IF_ERROR(_generate_fill_columns()); if (VLOG_NOTICE_IS_ON && !_missing_cols.empty() && _is_load) { @@ -1058,7 +1058,7 @@ Status VFileScanner::_init_expr_ctxes() { } // TODO: It should can move to scan node to process. if (!_conjuncts.empty()) { - _process_conjuncts_for_dict_filter(); + static_cast(_process_conjuncts_for_dict_filter()); } return Status::OK(); } diff --git a/be/src/vec/exec/scan/vmeta_scanner.cpp b/be/src/vec/exec/scan/vmeta_scanner.cpp index ad97460d0d..acccd23042 100644 --- a/be/src/vec/exec/scan/vmeta_scanner.cpp +++ b/be/src/vec/exec/scan/vmeta_scanner.cpp @@ -112,7 +112,7 @@ Status VMetaScanner::_get_block_impl(RuntimeState* state, Block* block, bool* eo } } // fill block - _fill_block_with_remote_data(columns); + static_cast(_fill_block_with_remote_data(columns)); if (_meta_eos == true) { if (block->rows() == 0) { *eof = true; diff --git a/be/src/vec/exec/scan/vscan_node.cpp b/be/src/vec/exec/scan/vscan_node.cpp index a610376757..c9c4cc7e1e 100644 --- a/be/src/vec/exec/scan/vscan_node.cpp +++ b/be/src/vec/exec/scan/vscan_node.cpp @@ -538,8 +538,9 @@ Status VScanNode::_normalize_predicate(const VExprSPtr& conjunct_expr_root, VExp if (pdt == PushDownType::UNACCEPTABLE && TExprNodeType::COMPOUND_PRED == cur_expr->node_type()) { - _normalize_compound_predicate(cur_expr, context, &pdt, _is_runtime_filter_predicate, - in_predicate_checker, eq_predicate_checker); + static_cast(_normalize_compound_predicate( + cur_expr, context, &pdt, _is_runtime_filter_predicate, in_predicate_checker, + eq_predicate_checker)); output_expr = conjunct_expr_root; // remaining in conjunct tree return Status::OK(); } @@ -1023,8 +1024,8 @@ Status VScanNode::_normalize_compound_predicate( value_range.mark_runtime_filter_predicate( _is_runtime_filter_predicate); }}; - _normalize_binary_in_compound_predicate(child_expr, expr_ctx, slot, - value_range, pdt); + static_cast(_normalize_binary_in_compound_predicate( + child_expr, expr_ctx, slot, value_range, pdt)); }, active_range); @@ -1045,17 +1046,17 @@ Status VScanNode::_normalize_compound_predicate( value_range.mark_runtime_filter_predicate( _is_runtime_filter_predicate); }}; - _normalize_match_in_compound_predicate(child_expr, expr_ctx, slot, - value_range, pdt); + static_cast(_normalize_match_in_compound_predicate( + child_expr, expr_ctx, slot, value_range, pdt)); }, active_range); _compound_value_ranges.emplace_back(active_range); } } else if (TExprNodeType::COMPOUND_PRED == child_expr->node_type()) { - _normalize_compound_predicate(child_expr, expr_ctx, pdt, - _is_runtime_filter_predicate, in_predicate_checker, - eq_predicate_checker); + static_cast(_normalize_compound_predicate( + child_expr, expr_ctx, pdt, _is_runtime_filter_predicate, + in_predicate_checker, eq_predicate_checker)); } } } diff --git a/be/src/vec/exec/vaggregation_node.cpp b/be/src/vec/exec/vaggregation_node.cpp index 3ac9e7c2d0..cee153af86 100644 --- a/be/src/vec/exec/vaggregation_node.cpp +++ b/be/src/vec/exec/vaggregation_node.cpp @@ -473,7 +473,7 @@ Status AggregationNode::alloc_resource(doris::RuntimeState* state) { // this could cause unable to get JVM if (_probe_expr_ctxs.empty()) { // _create_agg_status may acquire a lot of memory, may allocate failed when memory is very few - RETURN_IF_CATCH_EXCEPTION(_create_agg_status(_agg_data->without_key)); + RETURN_IF_CATCH_EXCEPTION(static_cast(_create_agg_status(_agg_data->without_key))); _agg_data_created_without_key = true; } @@ -502,7 +502,7 @@ Status AggregationNode::open(RuntimeState* state) { std::placeholders::_3))); RETURN_IF_ERROR(sink(state, &block, eos)); } - _children[0]->close(state); + static_cast(_children[0]->close(state)); return Status::OK(); } @@ -564,7 +564,7 @@ Status AggregationNode::sink(doris::RuntimeState* state, vectorized::Block* in_b } if (eos) { if (_spill_context.has_data) { - _try_spill_disk(true); + static_cast(_try_spill_disk(true)); RETURN_IF_ERROR(_spill_context.prepare_for_reading()); } _can_read = true; @@ -757,7 +757,7 @@ void AggregationNode::_close_without_key() { //but finally call close to destory agg data, if agg data has bitmapValue //will be core dump, it's not initialized if (_agg_data_created_without_key) { - _destroy_agg_status(_agg_data->without_key); + static_cast(_destroy_agg_status(_agg_data->without_key)); _agg_data_created_without_key = false; } release_tracker(); @@ -869,7 +869,7 @@ Status AggregationNode::_reset_hash_table() { hash_table.for_each_mapped([&](auto& mapped) { if (mapped) { - _destroy_agg_status(mapped); + static_cast(_destroy_agg_status(mapped)); mapped = nullptr; } }); @@ -911,11 +911,11 @@ void AggregationNode::_emplace_into_hash_table(AggregateDataPtr* places, ColumnR ArenaKeyHolder key_holder {string_ref, *_agg_arena_pool}; key_holder_persist_key(key_holder); auto mapped = _aggregate_data_container->append_data(key_holder.key); - _create_agg_status(mapped); + static_cast(_create_agg_status(mapped)); ctor(key, mapped); } else { auto mapped = _aggregate_data_container->append_data(key); - _create_agg_status(mapped); + static_cast(_create_agg_status(mapped)); ctor(key, mapped); } }; @@ -923,7 +923,7 @@ void AggregationNode::_emplace_into_hash_table(AggregateDataPtr* places, ColumnR auto creator_for_null_key = [this](auto& mapped) { mapped = _agg_arena_pool->aligned_alloc(_total_size_of_aggregate_states, _align_aggregate_states); - _create_agg_status(mapped); + static_cast(_create_agg_status(mapped)); }; if constexpr (HashTableTraits::is_phmap) { @@ -1223,7 +1223,7 @@ Status AggregationNode::_spill_hash_table(HashTableCtxType& agg_method, HashTabl std::numeric_limits::max(), writer, _spill_context.runtime_profile)); Defer defer {[&]() { // redundant call is ok - writer->close(); + static_cast(writer->close()); }}; _spill_context.stream_ids.emplace_back(writer->get_id()); @@ -1250,7 +1250,7 @@ Status AggregationNode::_spill_hash_table(HashTableCtxType& agg_method, HashTabl if (blocks_rows[i] == 0) { /// Here write one empty block to ensure there are enough blocks in the file, /// blocks' count should be equal with partition_count. - writer->write(block_to_write); + static_cast(writer->write(block_to_write)); continue; } @@ -1641,12 +1641,12 @@ void AggregationNode::_close_with_serialized_key() { auto& data = agg_method.data; data.for_each_mapped([&](auto& mapped) { if (mapped) { - _destroy_agg_status(mapped); + static_cast(_destroy_agg_status(mapped)); mapped = nullptr; } }); if (data.has_null_key_data()) { - _destroy_agg_status(data.get_null_key_data()); + static_cast(_destroy_agg_status(data.get_null_key_data())); } }, _agg_data->method_variant); diff --git a/be/src/vec/exec/vaggregation_node.h b/be/src/vec/exec/vaggregation_node.h index a388218c59..1fa80db363 100644 --- a/be/src/vec/exec/vaggregation_node.h +++ b/be/src/vec/exec/vaggregation_node.h @@ -714,7 +714,7 @@ struct AggSpillContext { ~AggSpillContext() { for (auto& reader : readers) { if (reader) { - reader->close(); + static_cast(reader->close()); reader.reset(); } } diff --git a/be/src/vec/exec/vanalytic_eval_node.cpp b/be/src/vec/exec/vanalytic_eval_node.cpp index c31e65b8c1..49fbc1c711 100644 --- a/be/src/vec/exec/vanalytic_eval_node.cpp +++ b/be/src/vec/exec/vanalytic_eval_node.cpp @@ -206,7 +206,7 @@ Status VAnalyticEvalNode::prepare(RuntimeState* state) { } _fn_place_ptr = _agg_arena_pool->aligned_alloc(_total_size_of_aggregate_states, _align_aggregate_states); - RETURN_IF_CATCH_EXCEPTION(_create_agg_status()); + RETURN_IF_CATCH_EXCEPTION(static_cast(_create_agg_status())); _executor.insert_result = std::bind(&VAnalyticEvalNode::_insert_result_info, this, std::placeholders::_1); _executor.execute = @@ -214,7 +214,7 @@ Status VAnalyticEvalNode::prepare(RuntimeState* state) { std::placeholders::_2, std::placeholders::_3, std::placeholders::_4); for (const auto& ctx : _agg_expr_ctxs) { - VExpr::prepare(ctx, state, child(0)->row_desc()); + static_cast(VExpr::prepare(ctx, state, child(0)->row_desc())); } if (!_partition_by_eq_expr_ctxs.empty() || !_order_by_eq_expr_ctxs.empty()) { vector tuple_ids; @@ -276,9 +276,9 @@ Status VAnalyticEvalNode::pull(doris::RuntimeState* /*state*/, vectorized::Block return Status::OK(); } _next_partition = _init_next_partition(_found_partition_end); - _init_result_columns(); + static_cast(_init_result_columns()); size_t current_block_rows = _input_blocks[_output_block_index].rows(); - _executor.get_next(current_block_rows); + static_cast(_executor.get_next(current_block_rows)); if (_window_end_position == current_block_rows) { break; } @@ -297,7 +297,7 @@ void VAnalyticEvalNode::release_resource(RuntimeState* state) { agg_function->close(state); } - _destroy_agg_status(); + static_cast(_destroy_agg_status()); _release_mem(); return ExecNode::release_resource(state); } @@ -375,7 +375,7 @@ Status VAnalyticEvalNode::_get_next_for_rows(size_t current_block_rows) { range_end = _current_row_position + 1; //going on calculate,add up data, no need to reset state } else { - _reset_agg_status(); + static_cast(_reset_agg_status()); if (!_window.__isset .window_start) { //[preceding, offset] --unbound: [preceding, following] range_start = _partition_by_start.pos; @@ -611,7 +611,7 @@ bool VAnalyticEvalNode::_init_next_partition(BlockRowPos found_partition_end) { _partition_by_start = _partition_by_end; _partition_by_end = found_partition_end; _current_row_position = _partition_by_start.pos; - _reset_agg_status(); + static_cast(_reset_agg_status()); return true; } return false; diff --git a/be/src/vec/exec/vdata_gen_scan_node.cpp b/be/src/vec/exec/vdata_gen_scan_node.cpp index 95ce6cbc8a..999a88a493 100644 --- a/be/src/vec/exec/vdata_gen_scan_node.cpp +++ b/be/src/vec/exec/vdata_gen_scan_node.cpp @@ -131,7 +131,7 @@ Status VDataGenFunctionScanNode::close(RuntimeState* state) { if (is_closed()) { return Status::OK(); } - _table_func->close(state); + static_cast(_table_func->close(state)); SCOPED_TIMER(_runtime_profile->total_time_counter()); return ExecNode::close(state); diff --git a/be/src/vec/exec/vjdbc_connector.cpp b/be/src/vec/exec/vjdbc_connector.cpp index 65ebc42882..bb50e21163 100644 --- a/be/src/vec/exec/vjdbc_connector.cpp +++ b/be/src/vec/exec/vjdbc_connector.cpp @@ -81,7 +81,7 @@ JdbcConnector::JdbcConnector(const JdbcConnectorParam& param) JdbcConnector::~JdbcConnector() { if (!_closed) { - close(); + static_cast(close()); } } @@ -97,7 +97,7 @@ Status JdbcConnector::close(Status) { return Status::OK(); } if (_is_in_transaction) { - abort_trans(); + static_cast(abort_trans()); } JNIEnv* env; RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env)); @@ -184,7 +184,7 @@ Status JdbcConnector::open(RuntimeState* state, bool read) { RETURN_ERROR_IF_EXC(env); RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, _executor_obj, &_executor_obj)); _is_open = true; - begin_trans(); + static_cast(begin_trans()); return Status::OK(); } @@ -492,13 +492,13 @@ Status JdbcConnector::get_next(bool* eos, std::vector& columns env->DeleteLocalRef(column_data); //here need to cast string to array type if (slot_desc->type().is_array_type()) { - _cast_string_to_array(slot_desc, block, column_index, num_rows); + static_cast(_cast_string_to_array(slot_desc, block, column_index, num_rows)); } else if (slot_desc->type().is_hll_type()) { - _cast_string_to_hll(slot_desc, block, column_index, num_rows); + static_cast(_cast_string_to_hll(slot_desc, block, column_index, num_rows)); } else if (slot_desc->type().is_json_type()) { - _cast_string_to_json(slot_desc, block, column_index, num_rows); + static_cast(_cast_string_to_json(slot_desc, block, column_index, num_rows)); } else if (slot_desc->type().is_bitmap_type()) { - _cast_string_to_bitmap(slot_desc, block, column_index, num_rows); + static_cast(_cast_string_to_bitmap(slot_desc, block, column_index, num_rows)); } materialized_column_index++; } @@ -867,7 +867,7 @@ Status JdbcConnector::_cast_string_to_hll(const SlotDescriptor* slot_desc, Block Block cast_block(argument_template); int result_idx = cast_block.columns(); cast_block.insert({nullptr, make_nullable(_target_data_type), "cast_result"}); - func_cast->execute(nullptr, cast_block, {0, 1}, result_idx, rows); + static_cast(func_cast->execute(nullptr, cast_block, {0, 1}, result_idx, rows)); auto res_col = cast_block.get_by_position(result_idx).column; if (_target_data_type->is_nullable()) { @@ -902,7 +902,7 @@ Status JdbcConnector::_cast_string_to_bitmap(const SlotDescriptor* slot_desc, Bl Block cast_block(argument_template); int result_idx = cast_block.columns(); cast_block.insert({nullptr, make_nullable(_target_data_type), "cast_result"}); - func_cast->execute(nullptr, cast_block, {0, 1}, result_idx, rows); + static_cast(func_cast->execute(nullptr, cast_block, {0, 1}, result_idx, rows)); auto res_col = cast_block.get_by_position(result_idx).column; if (_target_data_type->is_nullable()) { @@ -938,7 +938,7 @@ Status JdbcConnector::_cast_string_to_array(const SlotDescriptor* slot_desc, Blo Block cast_block(argument_template); int result_idx = cast_block.columns(); cast_block.insert({nullptr, make_nullable(_target_data_type), "cast_result"}); - func_cast->execute(nullptr, cast_block, {0, 1}, result_idx, rows); + static_cast(func_cast->execute(nullptr, cast_block, {0, 1}, result_idx, rows)); auto res_col = cast_block.get_by_position(result_idx).column; if (_target_data_type->is_nullable()) { @@ -973,7 +973,7 @@ Status JdbcConnector::_cast_string_to_json(const SlotDescriptor* slot_desc, Bloc Block cast_block(argument_template); int result_idx = cast_block.columns(); cast_block.insert({nullptr, make_nullable(_target_data_type), "cast_result"}); - func_cast->execute(nullptr, cast_block, {0, 1}, result_idx, rows); + static_cast(func_cast->execute(nullptr, cast_block, {0, 1}, result_idx, rows)); auto res_col = cast_block.get_by_position(result_idx).column; if (_target_data_type->is_nullable()) { diff --git a/be/src/vec/exec/vpartition_sort_node.cpp b/be/src/vec/exec/vpartition_sort_node.cpp index bcd10a7681..7f407e517e 100644 --- a/be/src/vec/exec/vpartition_sort_node.cpp +++ b/be/src/vec/exec/vpartition_sort_node.cpp @@ -239,7 +239,7 @@ Status VPartitionSortNode::open(RuntimeState* state) { RETURN_IF_ERROR(sink(state, input_block.get(), eos)); } while (!eos); - child(0)->close(state); + static_cast(child(0)->close(state)); return Status::OK(); } diff --git a/be/src/vec/exec/vrepeat_node.cpp b/be/src/vec/exec/vrepeat_node.cpp index 58c993c8b3..b839a3285a 100644 --- a/be/src/vec/exec/vrepeat_node.cpp +++ b/be/src/vec/exec/vrepeat_node.cpp @@ -247,7 +247,7 @@ Status VRepeatNode::get_next(RuntimeState* state, Block* block, bool* eos) { _children[0], std::placeholders::_1, std::placeholders::_2, std::placeholders::_3))); - push(state, &_child_block, _child_eos); + static_cast(push(state, &_child_block, _child_eos)); } return pull(state, block, eos); diff --git a/be/src/vec/exec/vset_operation_node.cpp b/be/src/vec/exec/vset_operation_node.cpp index 6a0b515780..fdd22d0b78 100644 --- a/be/src/vec/exec/vset_operation_node.cpp +++ b/be/src/vec/exec/vset_operation_node.cpp @@ -463,9 +463,9 @@ Status VSetOperationNode::hash_table_build(RuntimeState* state) { _children[0], std::placeholders::_1, std::placeholders::_2, std::placeholders::_3))); if (eos) { - child(0)->close(state); + static_cast(child(0)->close(state)); } - sink(state, &block, eos); + static_cast(sink(state, &block, eos)); } return Status::OK(); @@ -489,7 +489,7 @@ Status VSetOperationNode::process_build_block(Block& block, uint8_ if constexpr (!std::is_same_v) { HashTableBuild hash_table_build_process( rows, raw_ptrs, this, offset, state); - hash_table_build_process(arg); + static_cast(hash_table_build_process(arg)); } else { LOG(FATAL) << "FATAL: uninited hash table"; } diff --git a/be/src/vec/exec/vsort_node.cpp b/be/src/vec/exec/vsort_node.cpp index f4eaafe634..d32110c7b6 100644 --- a/be/src/vec/exec/vsort_node.cpp +++ b/be/src/vec/exec/vsort_node.cpp @@ -192,7 +192,7 @@ Status VSortNode::open(RuntimeState* state) { } while (!eos); - child(0)->close(state); + static_cast(child(0)->close(state)); mem_tracker()->consume(_sorter->data_size()); COUNTER_UPDATE(_sort_blocks_memory_usage, _sorter->data_size()); diff --git a/be/src/vec/exec/vtable_function_node.cpp b/be/src/vec/exec/vtable_function_node.cpp index 81fdef4389..f66b3e3e62 100644 --- a/be/src/vec/exec/vtable_function_node.cpp +++ b/be/src/vec/exec/vtable_function_node.cpp @@ -204,7 +204,7 @@ Status VTableFunctionNode::_get_expanded_block(RuntimeState* state, Block* outpu _fns[i]->get_value(columns[i + _child_slots.size()]); } _current_row_insert_times++; - _fns[_fn_num - 1]->forward(); + static_cast(_fns[_fn_num - 1]->forward()); } } } @@ -284,7 +284,7 @@ int VTableFunctionNode::_find_last_fn_eos_idx() { bool VTableFunctionNode::_roll_table_functions(int last_eos_idx) { int i = last_eos_idx - 1; for (; i >= 0; --i) { - _fns[i]->forward(); + static_cast(_fns[i]->forward()); if (!_fns[i]->eos()) { break; } @@ -296,7 +296,7 @@ bool VTableFunctionNode::_roll_table_functions(int last_eos_idx) { } for (int j = i + 1; j < _fn_num; ++j) { - _fns[j]->reset(); + static_cast(_fns[j]->reset()); } return true; diff --git a/be/src/vec/exec/vunion_node.cpp b/be/src/vec/exec/vunion_node.cpp index 10a3ca001a..a27a1b7a42 100644 --- a/be/src/vec/exec/vunion_node.cpp +++ b/be/src/vec/exec/vunion_node.cpp @@ -269,7 +269,7 @@ Status VUnionNode::get_next(RuntimeState* state, Block* block, bool* eos) { // passthrough case, the child was already closed in the previous call to get_next(). DCHECK(is_child_passthrough(_to_close_child_idx)); DCHECK(!is_in_subplan()); - child(_to_close_child_idx)->close(state); + static_cast(child(_to_close_child_idx)->close(state)); _to_close_child_idx = -1; } diff --git a/be/src/vec/exprs/table_function/table_function.h b/be/src/vec/exprs/table_function/table_function.h index 7ba6379a20..04c80ba220 100644 --- a/be/src/vec/exprs/table_function/table_function.h +++ b/be/src/vec/exprs/table_function/table_function.h @@ -61,7 +61,7 @@ public: int i = 0; for (; i < max_step && !eos(); i++) { get_value(column); - forward(); + static_cast(forward()); } return i; } diff --git a/be/src/vec/exprs/table_function/vexplode_numbers.h b/be/src/vec/exprs/table_function/vexplode_numbers.h index 7bdde9278b..d8c5c37da9 100644 --- a/be/src/vec/exprs/table_function/vexplode_numbers.h +++ b/be/src/vec/exprs/table_function/vexplode_numbers.h @@ -62,7 +62,7 @@ public: ->insert_range_from(*_elements_column, _cur_offset, max_step); } - forward(max_step); + static_cast(forward(max_step)); return max_step; } diff --git a/be/src/vec/exprs/vectorized_agg_fn.cpp b/be/src/vec/exprs/vectorized_agg_fn.cpp index 642b37cccc..1f80d8c839 100644 --- a/be/src/vec/exprs/vectorized_agg_fn.cpp +++ b/be/src/vec/exprs/vectorized_agg_fn.cpp @@ -346,7 +346,8 @@ AggFnEvaluator::AggFnEvaluator(AggFnEvaluator& evaluator, RuntimeState* state) const DataTypes& argument_types = _real_argument_types.empty() ? tmp_argument_types : _real_argument_types; _function = AggregateJavaUdaf::create(evaluator._fn, argument_types, evaluator._data_type); - static_cast(_function.get())->check_udaf(evaluator._fn); + static_cast( + static_cast(_function.get())->check_udaf(evaluator._fn)); } DCHECK(_function != nullptr); diff --git a/be/src/vec/exprs/vexpr.cpp b/be/src/vec/exprs/vexpr.cpp index b2e3b39c5a..b483642f9c 100644 --- a/be/src/vec/exprs/vexpr.cpp +++ b/be/src/vec/exprs/vexpr.cpp @@ -61,79 +61,80 @@ TExprNode create_texpr_node_from(const void* data, const PrimitiveType& type, in switch (type) { case TYPE_BOOLEAN: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_TINYINT: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_SMALLINT: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_INT: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_BIGINT: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_LARGEINT: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_FLOAT: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_DOUBLE: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_DATEV2: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_DATETIMEV2: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_DATE: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_DATETIME: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_DECIMALV2: { - create_texpr_literal_node(data, &node, precision, scale); + static_cast(create_texpr_literal_node(data, &node, precision, scale)); break; } case TYPE_DECIMAL32: { - create_texpr_literal_node(data, &node, precision, scale); + static_cast(create_texpr_literal_node(data, &node, precision, scale)); break; } case TYPE_DECIMAL64: { - create_texpr_literal_node(data, &node, precision, scale); + static_cast(create_texpr_literal_node(data, &node, precision, scale)); break; } case TYPE_DECIMAL128I: { - create_texpr_literal_node(data, &node, precision, scale); + static_cast( + create_texpr_literal_node(data, &node, precision, scale)); break; } case TYPE_CHAR: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_VARCHAR: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } case TYPE_STRING: { - create_texpr_literal_node(data, &node); + static_cast(create_texpr_literal_node(data, &node)); break; } default: @@ -524,9 +525,9 @@ void VExpr::close_function_context(VExprContext* context, FunctionContext::Funct const FunctionBasePtr& function) const { if (_fn_context_index != -1) { FunctionContext* fn_ctx = context->fn_context(_fn_context_index); - function->close(fn_ctx, FunctionContext::THREAD_LOCAL); + static_cast(function->close(fn_ctx, FunctionContext::THREAD_LOCAL)); if (scope == FunctionContext::FRAGMENT_LOCAL) { - function->close(fn_ctx, FunctionContext::FRAGMENT_LOCAL); + static_cast(function->close(fn_ctx, FunctionContext::FRAGMENT_LOCAL)); } } } diff --git a/be/src/vec/functions/comparison_equal_for_null.cpp b/be/src/vec/functions/comparison_equal_for_null.cpp index 80e0bd40d9..983d404240 100644 --- a/be/src/vec/functions/comparison_equal_for_null.cpp +++ b/be/src/vec/functions/comparison_equal_for_null.cpp @@ -99,7 +99,8 @@ public: SimpleFunctionFactory::instance().get_function("eq", eq_columns, return_type); DCHECK(func_eq); temporary_block.insert(ColumnWithTypeAndName {nullptr, return_type, ""}); - func_eq->execute(context, temporary_block, {0, 1}, 2, input_rows_count); + static_cast( + func_eq->execute(context, temporary_block, {0, 1}, 2, input_rows_count)); if (left_nullable) { auto res_column = std::move(*temporary_block.get_by_position(2).column).mutate(); @@ -127,7 +128,8 @@ public: Block temporary_block(eq_columns); temporary_block.insert(ColumnWithTypeAndName {nullptr, return_type, ""}); - func_eq->execute(context, temporary_block, {0, 1}, 2, input_rows_count); + static_cast( + func_eq->execute(context, temporary_block, {0, 1}, 2, input_rows_count)); auto res_nullable_column = assert_cast( std::move(*temporary_block.get_by_position(2).column).mutate().get()); diff --git a/be/src/vec/functions/function_bitmap.cpp b/be/src/vec/functions/function_bitmap.cpp index 15bb2d057a..d2289b3fa6 100644 --- a/be/src/vec/functions/function_bitmap.cpp +++ b/be/src/vec/functions/function_bitmap.cpp @@ -368,7 +368,7 @@ public: const auto& str_column = static_cast(*argument_column); const ColumnString::Chars& data = str_column.get_chars(); const ColumnString::Offsets& offsets = str_column.get_offsets(); - Impl::vector(data, offsets, res, null_map, input_rows_count); + static_cast(Impl::vector(data, offsets, res, null_map, input_rows_count)); } else if constexpr (std::is_same_v) { auto argument_type = remove_nullable( assert_cast(*block.get_by_position(arguments[0]).type) @@ -380,20 +380,20 @@ public: const auto& nested_column = nested_nullable_column.get_nested_column(); const auto& nested_null_map = nested_nullable_column.get_null_map_column().get_data(); if (check_column(nested_column)) { - Impl::template vector(offset_column_data, nested_column, - nested_null_map, res, null_map); + static_cast(Impl::template vector( + offset_column_data, nested_column, nested_null_map, res, null_map)); } else if (check_column(nested_column)) { - Impl::template vector(offset_column_data, nested_column, - nested_null_map, res, null_map); + static_cast(Impl::template vector( + offset_column_data, nested_column, nested_null_map, res, null_map)); } else if (check_column(nested_column)) { - Impl::template vector(offset_column_data, nested_column, - nested_null_map, res, null_map); + static_cast(Impl::template vector( + offset_column_data, nested_column, nested_null_map, res, null_map)); } else if (check_column(nested_column)) { - Impl::template vector(offset_column_data, nested_column, - nested_null_map, res, null_map); + static_cast(Impl::template vector( + offset_column_data, nested_column, nested_null_map, res, null_map)); } else if (check_column(nested_column)) { - Impl::template vector(offset_column_data, nested_column, - nested_null_map, res, null_map); + static_cast(Impl::template vector( + offset_column_data, nested_column, nested_null_map, res, null_map)); } else { return Status::RuntimeError("Illegal column {} of argument of function {}", block.get_by_position(arguments[0]).column->get_name(), diff --git a/be/src/vec/functions/function_bitmap_variadic.cpp b/be/src/vec/functions/function_bitmap_variadic.cpp index b2a09bb6a9..321da1a060 100644 --- a/be/src/vec/functions/function_bitmap_variadic.cpp +++ b/be/src/vec/functions/function_bitmap_variadic.cpp @@ -250,8 +250,8 @@ public: auto& vec_res = col_res->get_data(); vec_res.resize(input_rows_count); - Impl::vector_vector(argument_columns, argument_size, input_rows_count, vec_res, - col_res_nulls); + static_cast(Impl::vector_vector(argument_columns, argument_size, input_rows_count, + vec_res, col_res_nulls)); if (!use_default_implementation_for_nulls() && result_info.type->is_nullable()) { block.replace_by_position( result, ColumnNullable::create(std::move(col_res), std::move(col_res_nulls))); diff --git a/be/src/vec/functions/function_coalesce.cpp b/be/src/vec/functions/function_coalesce.cpp index 8296e04c19..715d31f1be 100644 --- a/be/src/vec/functions/function_coalesce.cpp +++ b/be/src/vec/functions/function_coalesce.cpp @@ -156,7 +156,8 @@ public: for (size_t i = 0; i < argument_size && remaining_rows; ++i) { temporary_block.get_by_position(0).column = block.get_by_position(filtered_args[i]).column; - func_is_not_null->execute(context, temporary_block, {0}, 1, input_rows_count); + static_cast( + func_is_not_null->execute(context, temporary_block, {0}, 1, input_rows_count)); auto res_column = (*temporary_block.get_by_position(1).column->convert_to_full_column_if_const()) diff --git a/be/src/vec/functions/function_encryption.cpp b/be/src/vec/functions/function_encryption.cpp index ce01e2afa0..274aa26979 100644 --- a/be/src/vec/functions/function_encryption.cpp +++ b/be/src/vec/functions/function_encryption.cpp @@ -138,8 +138,9 @@ public: chars_list[i] = &col_str->get_chars(); } - Impl::vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, - result_null_map->get_data()); + static_cast(Impl::vector_vector(offsets_list, chars_list, input_rows_count, + result_data, result_offset, + result_null_map->get_data())); block.get_by_position(result).column = ColumnNullable::create(std::move(result_data_column), std::move(result_null_map)); return Status::OK(); diff --git a/be/src/vec/functions/function_hash.cpp b/be/src/vec/functions/function_hash.cpp index ae3680400b..6aa6fd6478 100644 --- a/be/src/vec/functions/function_hash.cpp +++ b/be/src/vec/functions/function_hash.cpp @@ -57,13 +57,13 @@ struct MurmurHash2Impl64 { static Status first_apply(const IDataType* type, const IColumn* column, size_t input_rows_count, IColumn& icolumn) { - execute_any(type, column, icolumn, input_rows_count); + static_cast(execute_any(type, column, icolumn, input_rows_count)); return Status::OK(); } static Status combine_apply(const IDataType* type, const IColumn* column, size_t input_rows_count, IColumn& icolumn) { - execute_any(type, column, icolumn, input_rows_count); + static_cast(execute_any(type, column, icolumn, input_rows_count)); return Status::OK(); } diff --git a/be/src/vec/functions/function_hex.cpp b/be/src/vec/functions/function_hex.cpp index 494f58e61d..fbe13fd35c 100644 --- a/be/src/vec/functions/function_hex.cpp +++ b/be/src/vec/functions/function_hex.cpp @@ -77,7 +77,8 @@ public: auto& result_data = result_data_column->get_chars(); auto& result_offset = result_data_column->get_offsets(); - Impl::vector(argument_column, input_rows_count, result_data, result_offset); + static_cast( + Impl::vector(argument_column, input_rows_count, result_data, result_offset)); block.replace_by_position(result, std::move(result_data_column)); return Status::OK(); } diff --git a/be/src/vec/functions/function_ifnull.h b/be/src/vec/functions/function_ifnull.h index 3459663a3f..08ceb23f49 100644 --- a/be/src/vec/functions/function_ifnull.h +++ b/be/src/vec/functions/function_ifnull.h @@ -118,7 +118,8 @@ public: auto func_if = SimpleFunctionFactory::instance().get_function( "if", if_columns, block.get_by_position(result).type); - func_if->execute(context, temporary_block, {0, 1, 2}, 3, input_rows_count); + static_cast( + func_if->execute(context, temporary_block, {0, 1, 2}, 3, input_rows_count)); block.get_by_position(result).column = temporary_block.get_by_position(3).column; return Status::OK(); } diff --git a/be/src/vec/functions/function_quantile_state.cpp b/be/src/vec/functions/function_quantile_state.cpp index b75abbc308..ffc569caf1 100644 --- a/be/src/vec/functions/function_quantile_state.cpp +++ b/be/src/vec/functions/function_quantile_state.cpp @@ -149,9 +149,11 @@ public: const DataTypePtr& nested_data_type = static_cast(data_type.get())->get_nested_type(); WhichDataType nested_which(nested_data_type); - execute_internal(column, data_type, column_result, compression); + static_cast( + execute_internal(column, data_type, column_result, compression)); } else { - execute_internal(column, data_type, column_result, compression); + static_cast( + execute_internal(column, data_type, column_result, compression)); } if (status.ok()) { block.replace_by_position(result, std::move(column_result)); diff --git a/be/src/vec/functions/function_reverse.h b/be/src/vec/functions/function_reverse.h index e899b44aeb..1616bddce7 100644 --- a/be/src/vec/functions/function_reverse.h +++ b/be/src/vec/functions/function_reverse.h @@ -46,8 +46,9 @@ public: ColumnPtr& src_column = block.get_by_position(arguments[0]).column; if (const ColumnString* col_string = check_and_get_column(src_column.get())) { auto col_res = ColumnString::create(); - ReverseImpl::vector(col_string->get_chars(), col_string->get_offsets(), - col_res->get_chars(), col_res->get_offsets()); + static_cast(ReverseImpl::vector(col_string->get_chars(), + col_string->get_offsets(), col_res->get_chars(), + col_res->get_offsets())); block.replace_by_position(result, std::move(col_res)); } else if (check_column(src_column.get())) { return ArrayReverseImpl::_execute(block, arguments, result, input_rows_count); diff --git a/be/src/vec/functions/function_rpc.cpp b/be/src/vec/functions/function_rpc.cpp index 44c5e1b369..8b8b605188 100644 --- a/be/src/vec/functions/function_rpc.cpp +++ b/be/src/vec/functions/function_rpc.cpp @@ -73,7 +73,7 @@ void RPCFnImpl::_convert_block_to_proto(Block& block, const ColumnNumbers& argum ColumnWithTypeAndName& column = block.get_by_position(col_idx); arg->set_has_null(column.column->has_null(row_count)); auto col = column.column->convert_to_full_column_if_const(); - column.type->get_serde()->write_column_to_pb(*col, *arg, 0, row_count); + static_cast(column.type->get_serde()->write_column_to_pb(*col, *arg, 0, row_count)); } } @@ -81,7 +81,7 @@ void RPCFnImpl::_convert_to_block(Block& block, const PValues& result, size_t po auto data_type = block.get_data_type(pos); auto col = data_type->create_column(); auto serde = data_type->get_serde(); - serde->read_column_from_pb(*col, result); + static_cast(serde->read_column_from_pb(*col, result)); block.replace_by_position(pos, std::move(col)); } diff --git a/be/src/vec/functions/function_string.cpp b/be/src/vec/functions/function_string.cpp index 0573eca2dc..bc0d40fa9e 100644 --- a/be/src/vec/functions/function_string.cpp +++ b/be/src/vec/functions/function_string.cpp @@ -496,8 +496,9 @@ struct Trim1Impl { auto col_res = ColumnString::create(); char blank[] = " "; StringRef rhs(blank, 1); - TrimUtil::vector(col->get_chars(), col->get_offsets(), rhs, - col_res->get_chars(), col_res->get_offsets()); + static_cast(TrimUtil::vector( + col->get_chars(), col->get_offsets(), rhs, col_res->get_chars(), + col_res->get_offsets())); block.replace_by_position(result, std::move(col_res)); } else { return Status::RuntimeError("Illegal column {} of argument of function {}", @@ -529,8 +530,9 @@ struct Trim2Impl { const char* raw_rhs = reinterpret_cast(&(col_right->get_chars()[0])); ColumnString::Offset rhs_size = col_right->get_offsets()[0]; StringRef rhs(raw_rhs, rhs_size); - TrimUtil::vector(col->get_chars(), col->get_offsets(), rhs, - col_res->get_chars(), col_res->get_offsets()); + static_cast(TrimUtil::vector( + col->get_chars(), col->get_offsets(), rhs, col_res->get_chars(), + col_res->get_offsets())); block.replace_by_position(result, std::move(col_res)); } else { return Status::RuntimeError("Illegal column {} of argument of function {}", diff --git a/be/src/vec/functions/function_string.h b/be/src/vec/functions/function_string.h index 5bfa44b387..6fc611fc83 100644 --- a/be/src/vec/functions/function_string.h +++ b/be/src/vec/functions/function_string.h @@ -694,7 +694,8 @@ public: Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, size_t result, size_t input_rows_count) const override { - NullOrEmptyImpl::execute(context, block, arguments, result, input_rows_count, false); + static_cast(NullOrEmptyImpl::execute(context, block, arguments, result, + input_rows_count, false)); return Status::OK(); } }; @@ -714,7 +715,8 @@ public: Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, size_t result, size_t input_rows_count) const override { - NullOrEmptyImpl::execute(context, block, arguments, result, input_rows_count, true); + static_cast(NullOrEmptyImpl::execute(context, block, arguments, result, + input_rows_count, true)); return Status::OK(); } }; diff --git a/be/src/vec/functions/function_string_to_string.h b/be/src/vec/functions/function_string_to_string.h index 1317506805..13dce2ba6f 100644 --- a/be/src/vec/functions/function_string_to_string.h +++ b/be/src/vec/functions/function_string_to_string.h @@ -63,8 +63,8 @@ public: const ColumnPtr column = block.get_by_position(arguments[0]).column; if (const ColumnString* col = check_and_get_column(column.get())) { auto col_res = ColumnString::create(); - Impl::vector(col->get_chars(), col->get_offsets(), col_res->get_chars(), - col_res->get_offsets()); + static_cast(Impl::vector(col->get_chars(), col->get_offsets(), + col_res->get_chars(), col_res->get_offsets())); block.replace_by_position(result, std::move(col_res)); } else { return Status::RuntimeError("Illegal column {} of argument of function {}", diff --git a/be/src/vec/functions/function_totype.h b/be/src/vec/functions/function_totype.h index cb050ef84c..39c8cba09e 100644 --- a/be/src/vec/functions/function_totype.h +++ b/be/src/vec/functions/function_totype.h @@ -243,17 +243,17 @@ private: if (auto col_left = check_and_get_column(lcol.get())) { if (auto col_right = check_and_get_column(rcol.get())) { if (left_const) { - Impl::scalar_vector( + static_cast(Impl::scalar_vector( col_left->get_data_at(0), col_right->get_chars(), - col_right->get_offsets(), vec_res); + col_right->get_offsets(), vec_res)); } else if (right_const) { - Impl::vector_scalar( + static_cast(Impl::vector_scalar( col_left->get_chars(), col_left->get_offsets(), - col_right->get_data_at(0), vec_res); + col_right->get_data_at(0), vec_res)); } else { - Impl::vector_vector( + static_cast(Impl::vector_vector( col_left->get_chars(), col_left->get_offsets(), col_right->get_chars(), - col_right->get_offsets(), vec_res); + col_right->get_offsets(), vec_res)); } block.replace_by_position(result, std::move(col_res)); @@ -476,8 +476,9 @@ public: auto res = Impl::ColumnType::create(); if (const ColumnString* col = check_and_get_column(col_ptr.get())) { auto col_res = Impl::ColumnType::create(); - Impl::vector(col->get_chars(), col->get_offsets(), col_res->get_chars(), - col_res->get_offsets(), null_map->get_data()); + static_cast(Impl::vector(col->get_chars(), col->get_offsets(), + col_res->get_chars(), col_res->get_offsets(), + null_map->get_data())); block.replace_by_position( result, ColumnNullable::create(std::move(col_res), std::move(null_map))); } else { diff --git a/be/src/vec/functions/if.cpp b/be/src/vec/functions/if.cpp index 64dc004327..1664c0719e 100644 --- a/be/src/vec/functions/if.cpp +++ b/be/src/vec/functions/if.cpp @@ -450,7 +450,8 @@ public: temporary_block.insert( {nullptr, std::make_shared(), "result_column_null_map"}); - execute_impl(context, temporary_block, {0, 1, 2}, 3, temporary_block.rows()); + static_cast( + execute_impl(context, temporary_block, {0, 1, 2}, 3, temporary_block.rows())); result_null_mask = temporary_block.get_by_position(3).column; } @@ -464,7 +465,8 @@ public: {get_nested_column(arg_else.column), remove_nullable(arg_else.type), ""}, {nullptr, remove_nullable(block.get_by_position(result).type), ""}}); - execute_impl(context, temporary_block, {0, 1, 2}, 3, temporary_block.rows()); + static_cast( + execute_impl(context, temporary_block, {0, 1, 2}, 3, temporary_block.rows())); result_nested_column = temporary_block.get_by_position(3).column; } @@ -503,7 +505,8 @@ public: block.insert({nullable->get_nested_column_ptr(), remove_nullable(arg_cond.type), arg_cond.name}); - execute_impl(context, block, {column_size, arguments[1], arguments[2]}, result, rows); + static_cast(execute_impl( + context, block, {column_size, arguments[1], arguments[2]}, result, rows)); return true; } return false; diff --git a/be/src/vec/functions/like.cpp b/be/src/vec/functions/like.cpp index b0d0e67cb8..515ca423b2 100644 --- a/be/src/vec/functions/like.cpp +++ b/be/src/vec/functions/like.cpp @@ -350,9 +350,9 @@ Status FunctionLikeBase::execute_impl(FunctionContext* context, Block& block, for (int i = 0; i < input_rows_count; i++) { const auto pattern_val = str_patterns->get_data_at(i); const auto value_val = values->get_data_at(i); - (state->scalar_function)( + static_cast((state->scalar_function)( const_cast(&state->search_state), value_val, - pattern_val, &vec_res[i]); + pattern_val, &vec_res[i])); } } else if (const auto* const_patterns = check_and_get_column(pattern_col.get())) { diff --git a/be/src/vec/olap/vertical_merge_iterator.cpp b/be/src/vec/olap/vertical_merge_iterator.cpp index 3ff1282fd2..3278cdbd84 100644 --- a/be/src/vec/olap/vertical_merge_iterator.cpp +++ b/be/src/vec/olap/vertical_merge_iterator.cpp @@ -358,7 +358,7 @@ Status VerticalMergeIteratorContext::_load_next_block() { } for (auto it = _block_list.begin(); it != _block_list.end(); it++) { if (it->use_count() == 1) { - block_reset(*it); + static_cast(block_reset(*it)); _block = *it; _block_list.erase(it); break; @@ -366,7 +366,7 @@ Status VerticalMergeIteratorContext::_load_next_block() { } if (_block == nullptr) { _block = std::make_shared(); - block_reset(_block); + static_cast(block_reset(_block)); } Status st = _iter->next_batch(_block.get()); if (!st.ok()) { diff --git a/be/src/vec/olap/vgeneric_iterators.cpp b/be/src/vec/olap/vgeneric_iterators.cpp index f3f33c12fd..b72812de15 100644 --- a/be/src/vec/olap/vgeneric_iterators.cpp +++ b/be/src/vec/olap/vgeneric_iterators.cpp @@ -79,7 +79,7 @@ Status VStatisticsIterator::next_batch(Block* block) { } } else { for (int i = 0; i < block->columns(); ++i) { - _column_iterators[i]->next_batch_of_zone_map(&size, columns[i]); + static_cast(_column_iterators[i]->next_batch_of_zone_map(&size, columns[i])); } } _output_rows += size; @@ -290,7 +290,7 @@ Status VMergeIteratorContext::_load_next_block() { } for (auto it = _block_list.begin(); it != _block_list.end(); it++) { if (it->use_count() == 1) { - block_reset(*it); + static_cast(block_reset(*it)); _block = *it; _block_list.erase(it); break; @@ -298,7 +298,7 @@ Status VMergeIteratorContext::_load_next_block() { } if (_block == nullptr) { _block = std::make_shared(); - block_reset(_block); + static_cast(block_reset(_block)); } Status st = _iter->next_batch(_block.get()); if (!st.ok()) { diff --git a/be/src/vec/runtime/vdata_stream_recvr.cpp b/be/src/vec/runtime/vdata_stream_recvr.cpp index d5abb50e0d..a6af6c634d 100644 --- a/be/src/vec/runtime/vdata_stream_recvr.cpp +++ b/be/src/vec/runtime/vdata_stream_recvr.cpp @@ -492,7 +492,7 @@ void VDataStreamRecvr::close() { } // Remove this receiver from the DataStreamMgr that created it. // TODO: log error msg - _mgr->deregister_recvr(fragment_instance_id(), dest_node_id()); + static_cast(_mgr->deregister_recvr(fragment_instance_id(), dest_node_id())); _mgr = nullptr; _merger.reset(); diff --git a/be/src/vec/sink/autoinc_buffer.cpp b/be/src/vec/sink/autoinc_buffer.cpp index 74747c3c33..d7ae292009 100644 --- a/be/src/vec/sink/autoinc_buffer.cpp +++ b/be/src/vec/sink/autoinc_buffer.cpp @@ -81,7 +81,7 @@ void AutoIncIDBuffer::_prefetch_ids(size_t length) { } TNetworkAddress master_addr = ExecEnv::GetInstance()->master_info()->network_address; _is_fetching = true; - _rpc_token->submit_func([=, this]() { + static_cast(_rpc_token->submit_func([=, this]() { TAutoIncrementRangeRequest request; TAutoIncrementRangeResult result; request.__set_db_id(_db_id); @@ -112,7 +112,7 @@ void AutoIncIDBuffer::_prefetch_ids(size_t length) { _backend_buffer = {result.start, result.length}; } _is_fetching = false; - }); + })); } } // namespace doris::vectorized \ No newline at end of file diff --git a/be/src/vec/sink/delta_writer_v2_pool.cpp b/be/src/vec/sink/delta_writer_v2_pool.cpp index 0f86efd8bc..c2b10e6593 100644 --- a/be/src/vec/sink/delta_writer_v2_pool.cpp +++ b/be/src/vec/sink/delta_writer_v2_pool.cpp @@ -58,7 +58,9 @@ Status DeltaWriterV2Map::close() { } void DeltaWriterV2Map::cancel(Status status) { - _map.for_each([&status](auto& entry) { entry.second->cancel_with_status(status); }); + _map.for_each([&status](auto& entry) { + static_cast(entry.second->cancel_with_status(status)); + }); } DeltaWriterV2Pool::DeltaWriterV2Pool() = default; diff --git a/be/src/vec/sink/multi_cast_data_stream_sink.h b/be/src/vec/sink/multi_cast_data_stream_sink.h index 364586cad0..852c08397a 100644 --- a/be/src/vec/sink/multi_cast_data_stream_sink.h +++ b/be/src/vec/sink/multi_cast_data_stream_sink.h @@ -32,7 +32,7 @@ public: ~MultiCastDataStreamSink() override = default; Status send(RuntimeState* state, Block* block, bool eos = false) override { - _multi_cast_data_streamer->push(state, block, eos); + static_cast(_multi_cast_data_streamer->push(state, block, eos)); return Status::OK(); }; diff --git a/be/src/vec/sink/vdata_stream_sender.cpp b/be/src/vec/sink/vdata_stream_sender.cpp index 61d95538c9..4f4e4983e1 100644 --- a/be/src/vec/sink/vdata_stream_sender.cpp +++ b/be/src/vec/sink/vdata_stream_sender.cpp @@ -501,7 +501,7 @@ void VDataStreamSender::_handle_eof_channel(RuntimeState* state, ChannelPtrType Status st) { channel->set_receiver_eof(st); // Chanel will not send RPC to the downstream when eof, so close chanel by OK status. - channel->close(state, Status::OK()); + static_cast(channel->close(state, Status::OK())); } Status VDataStreamSender::send(RuntimeState* state, Block* block, bool eos) { @@ -741,7 +741,7 @@ Status VDataStreamSender::close(RuntimeState* state, Status exec_status) { if (_peak_memory_usage_counter) { _peak_memory_usage_counter->set(_mem_tracker->peak_consumption()); } - DataSink::close(state, exec_status); + static_cast(DataSink::close(state, exec_status)); return final_st; } diff --git a/be/src/vec/sink/vresult_file_sink.cpp b/be/src/vec/sink/vresult_file_sink.cpp index 82f4e7e805..503e2a3c68 100644 --- a/be/src/vec/sink/vresult_file_sink.cpp +++ b/be/src/vec/sink/vresult_file_sink.cpp @@ -130,11 +130,11 @@ Status VResultFileSink::close(RuntimeState* state, Status exec_status) { // close sender, this is normal path end if (_sender) { _sender->update_num_written_rows(_writer == nullptr ? 0 : _writer->get_written_rows()); - _sender->close(final_status); + static_cast(_sender->close(final_status)); } - state->exec_env()->result_mgr()->cancel_at_time( + static_cast(state->exec_env()->result_mgr()->cancel_at_time( time(nullptr) + config::result_buffer_cancelled_interval_time, - state->fragment_instance_id()); + state->fragment_instance_id())); } else { if (final_status.ok()) { auto st = _stream_sender->send(state, _output_block.get(), true); diff --git a/be/src/vec/sink/vresult_sink.cpp b/be/src/vec/sink/vresult_sink.cpp index 96c825ecb1..b3a2d3bae7 100644 --- a/be/src/vec/sink/vresult_sink.cpp +++ b/be/src/vec/sink/vresult_sink.cpp @@ -166,11 +166,11 @@ Status VResultSink::close(RuntimeState* state, Status exec_status) { _sender->update_num_written_rows(_writer->get_written_rows()); } _sender->update_max_peak_memory_bytes(); - _sender->close(final_status); + static_cast(_sender->close(final_status)); } - state->exec_env()->result_mgr()->cancel_at_time( + static_cast(state->exec_env()->result_mgr()->cancel_at_time( time(nullptr) + config::result_buffer_cancelled_interval_time, - state->fragment_instance_id()); + state->fragment_instance_id())); return DataSink::close(state, exec_status); } diff --git a/be/src/vec/sink/vtablet_sink_v2.cpp b/be/src/vec/sink/vtablet_sink_v2.cpp index a251427c44..66ac604e74 100644 --- a/be/src/vec/sink/vtablet_sink_v2.cpp +++ b/be/src/vec/sink/vtablet_sink_v2.cpp @@ -344,7 +344,7 @@ Status VOlapTableSinkV2::_write_memtable(std::shared_ptr bloc } } DeltaWriterV2* delta_writer = nullptr; - DeltaWriterV2::open(&req, streams, &delta_writer, _profile); + static_cast(DeltaWriterV2::open(&req, streams, &delta_writer, _profile)); return delta_writer; }); { @@ -388,7 +388,7 @@ Status VOlapTableSinkV2::close(RuntimeState* state, Status exec_status) { { SCOPED_TIMER(_close_writer_timer); // close all delta writers if this is the last user - _delta_writer_for_tablet->close(); + static_cast(_delta_writer_for_tablet->close()); _delta_writer_for_tablet.reset(); } @@ -403,7 +403,7 @@ Status VOlapTableSinkV2::close(RuntimeState* state, Status exec_status) { SCOPED_TIMER(_close_load_timer); for (const auto& [_, streams] : _streams_for_node) { for (const auto& stream : *streams) { - stream->close_wait(); + static_cast(stream->close_wait()); } } } @@ -436,11 +436,11 @@ Status VOlapTableSinkV2::close(RuntimeState* state, Status exec_status) { LOG(INFO) << "finished to close olap table sink. load_id=" << print_id(_load_id) << ", txn_id=" << _txn_id; } else { - _cancel(status); + static_cast(_cancel(status)); } _close_status = status; - DataSink::close(state, exec_status); + static_cast(DataSink::close(state, exec_status)); return status; } diff --git a/be/src/vec/sink/writer/async_result_writer.cpp b/be/src/vec/sink/writer/async_result_writer.cpp index c1e7424c61..0e752f63ab 100644 --- a/be/src/vec/sink/writer/async_result_writer.cpp +++ b/be/src/vec/sink/writer/async_result_writer.cpp @@ -79,8 +79,8 @@ std::unique_ptr AsyncResultWriter::get_block_from_queue() { } void AsyncResultWriter::start_writer(RuntimeState* state, RuntimeProfile* profile) { - ExecEnv::GetInstance()->fragment_mgr()->get_thread_pool()->submit_func( - [this, state, profile]() { this->process_block(state, profile); }); + static_cast(ExecEnv::GetInstance()->fragment_mgr()->get_thread_pool()->submit_func( + [this, state, profile]() { this->process_block(state, profile); })); } void AsyncResultWriter::process_block(RuntimeState* state, RuntimeProfile* profile) { @@ -120,7 +120,7 @@ void AsyncResultWriter::process_block(RuntimeState* state, RuntimeProfile* profi // if not in transaction or status is in error or force close we can do close in // async IO thread if (!_writer_status.ok() || !in_transaction()) { - close(_writer_status); + static_cast(close(_writer_status)); _need_normal_close = false; } _writer_thread_closed = true; diff --git a/be/src/vec/sink/writer/vfile_result_writer.cpp b/be/src/vec/sink/writer/vfile_result_writer.cpp index bb67f635b2..0df4e4e649 100644 --- a/be/src/vec/sink/writer/vfile_result_writer.cpp +++ b/be/src/vec/sink/writer/vfile_result_writer.cpp @@ -304,7 +304,7 @@ Status VFileResultWriter::_send_result() { row_buffer.push_bigint(_written_rows_counter->value()); // total rows row_buffer.push_bigint(_written_data_bytes->value()); // file size std::string file_url; - _get_file_url(&file_url); + static_cast(_get_file_url(&file_url)); row_buffer.push_string(file_url.c_str(), file_url.length()); // url std::unique_ptr result = std::make_unique(); @@ -341,7 +341,7 @@ Status VFileResultWriter::_fill_result_block() { column->insert_data(reinterpret_cast(&written_data_bytes), 0); \ } else if (i == 3) { \ std::string file_url; \ - _get_file_url(&file_url); \ + static_cast(_get_file_url(&file_url)); \ column->insert_data(file_url.c_str(), file_url.size()); \ } \ _output_block->replace_by_position(i, std::move(column)); diff --git a/be/src/vec/sink/writer/vtablet_writer.cpp b/be/src/vec/sink/writer/vtablet_writer.cpp index 1fdd1004f9..9b538deaa7 100644 --- a/be/src/vec/sink/writer/vtablet_writer.cpp +++ b/be/src/vec/sink/writer/vtablet_writer.cpp @@ -1494,7 +1494,7 @@ Status VTabletWriter::close(Status exec_status) { SCOPED_TIMER(_close_timer); SCOPED_TIMER(_profile->total_time_counter()); - try_close(_state, exec_status); + static_cast(try_close(_state, exec_status)); // If _close_status is not ok, all nodes have been canceled in try_close. if (_close_status.ok()) { @@ -1632,7 +1632,7 @@ Status VTabletWriter::close(Status exec_status) { } if (_wal_writer.get() != nullptr) { - _wal_writer->finalize(); + static_cast(_wal_writer->finalize()); } return _close_status; } @@ -1686,7 +1686,7 @@ Status VTabletWriter::append_block(doris::vectorized::Block& input_block) { int result_idx; if (_vpartition->is_projection_partition()) { // calc the start value of missing partition ranges. - part_func->execute(part_ctx.get(), block.get(), &result_idx); + static_cast(part_func->execute(part_ctx.get(), block.get(), &result_idx)); VLOG_DEBUG << "Partition-calculated block:" << block->dump_data(); // change the column to compare to transformed. _vpartition->set_transformed_slots({(uint16_t)result_idx}); @@ -1860,7 +1860,8 @@ void VTabletWriter::_group_commit_block(vectorized::Block* input_block, int64_t vectorized::Block* block, OlapTableBlockConvertor* block_convertor, OlapTabletFinder* tablet_finder) { - write_wal(block_convertor, tablet_finder, block, state, num_rows, filter_rows); + static_cast( + write_wal(block_convertor, tablet_finder, block, state, num_rows, filter_rows)); #ifndef BE_TEST auto* future_block = assert_cast(input_block); std::unique_lock l(*(future_block->lock)); diff --git a/be/test/exprs/bloom_filter_predicate_test.cpp b/be/test/exprs/bloom_filter_predicate_test.cpp index 84a1538be5..4f4ecd7c87 100644 --- a/be/test/exprs/bloom_filter_predicate_test.cpp +++ b/be/test/exprs/bloom_filter_predicate_test.cpp @@ -110,10 +110,10 @@ TEST_F(BloomFilterPredicateTest, bloom_filter_func_stringval_test) { TEST_F(BloomFilterPredicateTest, bloom_filter_size_test) { std::unique_ptr func(create_bloom_filter(PrimitiveType::TYPE_VARCHAR)); int length = 4096; - func->init_with_fixed_length(4096); + static_cast(func->init_with_fixed_length(4096)); char* data = nullptr; int len; - func->get_data(&data, &len); + static_cast(func->get_data(&data, &len)); EXPECT_EQ(length, len); } diff --git a/be/test/io/cache/file_block_cache_test.cpp b/be/test/io/cache/file_block_cache_test.cpp index f8ce21dd27..b13fb4aa0e 100644 --- a/be/test/io/cache/file_block_cache_test.cpp +++ b/be/test/io/cache/file_block_cache_test.cpp @@ -87,8 +87,8 @@ void download(io::FileBlockSPtr file_segment) { std::string data(size, '0'); Slice result(data.data(), size); - file_segment->append(result); - file_segment->finalize_write(); + static_cast(file_segment->append(result)); + static_cast(file_segment->finalize_write()); } void complete(const io::FileBlocksHolder& holder) { @@ -532,7 +532,7 @@ void test_file_cache(io::CacheType cache_type) { /// Test LRUCache::restore(). io::LRUFileCache cache2(cache_base_path, settings); - cache2.initialize(); + static_cast(cache2.initialize()); auto holder1 = cache2.get_or_set(key, 2, 28, context); /// Get [2, 29] auto segments1 = fromHolder(holder1); @@ -846,7 +846,7 @@ TEST(LRUFileCache, fd_cache_remove) { assert_range(2, segments[0], io::FileBlock::Range(0, 8), io::FileBlock::State::DOWNLOADING); download(segments[0]); std::unique_ptr buffer = std::make_unique(9); - segments[0]->read_at(Slice(buffer.get(), 9), 0); + static_cast(segments[0]->read_at(Slice(buffer.get(), 9), 0)); EXPECT_TRUE(io::IFileCache::contains_file_reader(std::make_pair(key, 0))); } { @@ -858,7 +858,7 @@ TEST(LRUFileCache, fd_cache_remove) { assert_range(2, segments[0], io::FileBlock::Range(9, 9), io::FileBlock::State::DOWNLOADING); download(segments[0]); std::unique_ptr buffer = std::make_unique(1); - segments[0]->read_at(Slice(buffer.get(), 1), 0); + static_cast(segments[0]->read_at(Slice(buffer.get(), 1), 0)); EXPECT_TRUE(io::IFileCache::contains_file_reader(std::make_pair(key, 9))); } { @@ -871,7 +871,7 @@ TEST(LRUFileCache, fd_cache_remove) { io::FileBlock::State::DOWNLOADING); download(segments[0]); std::unique_ptr buffer = std::make_unique(5); - segments[0]->read_at(Slice(buffer.get(), 5), 0); + static_cast(segments[0]->read_at(Slice(buffer.get(), 5), 0)); EXPECT_TRUE(io::IFileCache::contains_file_reader(std::make_pair(key, 10))); } { @@ -884,7 +884,7 @@ TEST(LRUFileCache, fd_cache_remove) { io::FileBlock::State::DOWNLOADING); download(segments[0]); std::unique_ptr buffer = std::make_unique(10); - segments[0]->read_at(Slice(buffer.get(), 10), 0); + static_cast(segments[0]->read_at(Slice(buffer.get(), 10), 0)); EXPECT_TRUE(io::IFileCache::contains_file_reader(std::make_pair(key, 15))); } EXPECT_FALSE(io::IFileCache::contains_file_reader(std::make_pair(key, 0))); @@ -926,7 +926,7 @@ TEST(LRUFileCache, fd_cache_evict) { assert_range(2, segments[0], io::FileBlock::Range(0, 8), io::FileBlock::State::DOWNLOADING); download(segments[0]); std::unique_ptr buffer = std::make_unique(9); - segments[0]->read_at(Slice(buffer.get(), 9), 0); + static_cast(segments[0]->read_at(Slice(buffer.get(), 9), 0)); EXPECT_TRUE(io::IFileCache::contains_file_reader(std::make_pair(key, 0))); } { @@ -938,7 +938,7 @@ TEST(LRUFileCache, fd_cache_evict) { assert_range(2, segments[0], io::FileBlock::Range(9, 9), io::FileBlock::State::DOWNLOADING); download(segments[0]); std::unique_ptr buffer = std::make_unique(1); - segments[0]->read_at(Slice(buffer.get(), 1), 0); + static_cast(segments[0]->read_at(Slice(buffer.get(), 1), 0)); EXPECT_TRUE(io::IFileCache::contains_file_reader(std::make_pair(key, 9))); } { @@ -951,7 +951,7 @@ TEST(LRUFileCache, fd_cache_evict) { io::FileBlock::State::DOWNLOADING); download(segments[0]); std::unique_ptr buffer = std::make_unique(5); - segments[0]->read_at(Slice(buffer.get(), 5), 0); + static_cast(segments[0]->read_at(Slice(buffer.get(), 5), 0)); EXPECT_TRUE(io::IFileCache::contains_file_reader(std::make_pair(key, 10))); } EXPECT_FALSE(io::IFileCache::contains_file_reader(std::make_pair(key, 0))); diff --git a/be/test/io/fs/buffered_reader_test.cpp b/be/test/io/fs/buffered_reader_test.cpp index 97ef217136..1f20e007f9 100644 --- a/be/test/io/fs/buffered_reader_test.cpp +++ b/be/test/io/fs/buffered_reader_test.cpp @@ -38,10 +38,10 @@ class BufferedReaderTest : public testing::Test { public: BufferedReaderTest() { std::unique_ptr _pool; - ThreadPoolBuilder("BufferedReaderPrefetchThreadPool") - .set_min_threads(5) - .set_max_threads(10) - .build(&_pool); + static_cast(ThreadPoolBuilder("BufferedReaderPrefetchThreadPool") + .set_min_threads(5) + .set_max_threads(10) + .build(&_pool)); ExecEnv::GetInstance()->_buffered_reader_prefetch_thread_pool = std::move(_pool); } @@ -121,8 +121,8 @@ private: TEST_F(BufferedReaderTest, normal_use) { // buffered_reader_test_file 950 bytes io::FileReaderSPtr local_reader; - io::global_local_filesystem()->open_file( - "./be/test/io/fs/test_data/buffered_reader/buffered_reader_test_file", &local_reader); + static_cast(io::global_local_filesystem()->open_file( + "./be/test/io/fs/test_data/buffered_reader/buffered_reader_test_file", &local_reader)); auto sync_local_reader = std::make_shared(std::move(local_reader)); io::PrefetchBufferedReader reader(nullptr, std::move(sync_local_reader), io::PrefetchRange(0, 1024)); @@ -140,9 +140,9 @@ TEST_F(BufferedReaderTest, normal_use) { TEST_F(BufferedReaderTest, test_validity) { // buffered_reader_test_file.txt 45 bytes io::FileReaderSPtr local_reader; - io::global_local_filesystem()->open_file( + static_cast(io::global_local_filesystem()->open_file( "./be/test/io/fs/test_data/buffered_reader/buffered_reader_test_file.txt", - &local_reader); + &local_reader)); auto sync_local_reader = std::make_shared(std::move(local_reader)); io::PrefetchBufferedReader reader(nullptr, std::move(sync_local_reader), io::PrefetchRange(0, 1024)); @@ -190,9 +190,9 @@ TEST_F(BufferedReaderTest, test_validity) { TEST_F(BufferedReaderTest, test_seek) { // buffered_reader_test_file.txt 45 bytes io::FileReaderSPtr local_reader; - io::global_local_filesystem()->open_file( + static_cast(io::global_local_filesystem()->open_file( "./be/test/io/fs/test_data/buffered_reader/buffered_reader_test_file.txt", - &local_reader); + &local_reader)); auto sync_local_reader = std::make_shared(std::move(local_reader)); io::PrefetchBufferedReader reader(nullptr, std::move(sync_local_reader), io::PrefetchRange(0, 1024)); @@ -237,9 +237,9 @@ TEST_F(BufferedReaderTest, test_seek) { TEST_F(BufferedReaderTest, test_miss) { // buffered_reader_test_file.txt 45 bytes io::FileReaderSPtr local_reader; - io::global_local_filesystem()->open_file( + static_cast(io::global_local_filesystem()->open_file( "./be/test/io/fs/test_data/buffered_reader/buffered_reader_test_file.txt", - &local_reader); + &local_reader)); auto sync_local_reader = std::make_shared(std::move(local_reader)); io::PrefetchBufferedReader reader(nullptr, std::move(sync_local_reader), io::PrefetchRange(0, 1024)); @@ -292,25 +292,25 @@ TEST_F(BufferedReaderTest, test_read_amplify) { // read column4 result.size = 1024 * kb; - merge_reader.read_at(1024 * kb, result, &bytes_read, nullptr); + static_cast(merge_reader.read_at(1024 * kb, result, &bytes_read, nullptr)); EXPECT_EQ(bytes_read, 1024 * kb); EXPECT_EQ(merge_reader.statistics().request_bytes, 1024 * kb); EXPECT_EQ(merge_reader.statistics().read_bytes, 1024 * kb); // read column0 result.size = 1 * kb; // will merge column 0 ~ 3 - merge_reader.read_at(0, result, &bytes_read, nullptr); + static_cast(merge_reader.read_at(0, result, &bytes_read, nullptr)); EXPECT_EQ(bytes_read, 1 * kb); EXPECT_EQ(merge_reader.statistics().read_bytes, 1024 * kb + 12 * kb); // read column1 result.size = 1 * kb; - merge_reader.read_at(3 * kb, result, &bytes_read, nullptr); + static_cast(merge_reader.read_at(3 * kb, result, &bytes_read, nullptr)); // read column2 result.size = 1 * kb; - merge_reader.read_at(5 * kb, result, &bytes_read, nullptr); + static_cast(merge_reader.read_at(5 * kb, result, &bytes_read, nullptr)); // read column3 result.size = 5 * kb; - merge_reader.read_at(7 * kb, result, &bytes_read, nullptr); + static_cast(merge_reader.read_at(7 * kb, result, &bytes_read, nullptr)); EXPECT_EQ(merge_reader.statistics().request_bytes, 1024 * kb + 8 * kb); EXPECT_EQ(merge_reader.statistics().read_bytes, 1024 * kb + 12 * kb); } @@ -331,7 +331,7 @@ TEST_F(BufferedReaderTest, test_merged_io) { size_t bytes_read = 0; // read column 0 - merge_reader.read_at(0, result, &bytes_read, nullptr); + static_cast(static_cast(merge_reader.read_at(0, result, &bytes_read, nullptr))); // will merge 3MB + 1MB + 3MB, and read out 1MB // so _remaining in MergeRangeFileReader is: ${NUM_BOX}MB - (3MB + 3MB - 1MB) EXPECT_EQ((io::MergeRangeFileReader::NUM_BOX - 5) * 1024 * 1024, @@ -345,7 +345,8 @@ TEST_F(BufferedReaderTest, test_merged_io) { EXPECT_EQ(7 * 1024 * 1024, range_cached_data[1].end_offset); // read column 1 - merge_reader.read_at(4 * 1024 * 1024, result, &bytes_read, nullptr); + static_cast( + static_cast(merge_reader.read_at(4 * 1024 * 1024, result, &bytes_read, nullptr))); // the column 1 is already cached EXPECT_EQ(5 * 1024 * 1024, range_cached_data[1].start_offset); EXPECT_EQ(7 * 1024 * 1024, range_cached_data[1].end_offset); @@ -353,10 +354,14 @@ TEST_F(BufferedReaderTest, test_merged_io) { merge_reader.buffer_remaining()); // read all cached data - merge_reader.read_at(1 * 1024 * 1024, result, &bytes_read, nullptr); - merge_reader.read_at(2 * 1024 * 1024, result, &bytes_read, nullptr); - merge_reader.read_at(5 * 1024 * 1024, result, &bytes_read, nullptr); - merge_reader.read_at(6 * 1024 * 1024, result, &bytes_read, nullptr); + static_cast( + static_cast(merge_reader.read_at(1 * 1024 * 1024, result, &bytes_read, nullptr))); + static_cast( + static_cast(merge_reader.read_at(2 * 1024 * 1024, result, &bytes_read, nullptr))); + static_cast( + static_cast(merge_reader.read_at(5 * 1024 * 1024, result, &bytes_read, nullptr))); + static_cast( + static_cast(merge_reader.read_at(6 * 1024 * 1024, result, &bytes_read, nullptr))); EXPECT_EQ(io::MergeRangeFileReader::TOTAL_BUFFER_SIZE, merge_reader.buffer_remaining()); // read all remaining columns @@ -365,19 +370,22 @@ TEST_F(BufferedReaderTest, test_merged_io) { if (i == 0) { size_t start_offset = 4 * 1024 * 1024 * col; size_t to_read = 729 * 1024; // read 729KB - merge_reader.read_at(start_offset, Slice(data, to_read), &bytes_read, nullptr); + static_cast(static_cast(merge_reader.read_at( + start_offset, Slice(data, to_read), &bytes_read, nullptr))); EXPECT_EQ(to_read, bytes_read); EXPECT_EQ(start_offset % UCHAR_MAX, (uint8)data[0]); } else if (i == 1) { size_t start_offset = 4 * 1024 * 1024 * col + 729 * 1024; size_t to_read = 1872 * 1024; // read 1872KB - merge_reader.read_at(start_offset, Slice(data, to_read), &bytes_read, nullptr); + static_cast(static_cast(merge_reader.read_at( + start_offset, Slice(data, to_read), &bytes_read, nullptr))); EXPECT_EQ(to_read, bytes_read); EXPECT_EQ(start_offset % UCHAR_MAX, (uint8)data[0]); } else if (i == 2) { size_t start_offset = 4 * 1024 * 1024 * col + 729 * 1024 + 1872 * 1024; size_t to_read = 471 * 1024; // read 471KB - merge_reader.read_at(start_offset, Slice(data, to_read), &bytes_read, nullptr); + static_cast(static_cast(merge_reader.read_at( + start_offset, Slice(data, to_read), &bytes_read, nullptr))); EXPECT_EQ(to_read, bytes_read); EXPECT_EQ(start_offset % UCHAR_MAX, (uint8)data[0]); } diff --git a/be/test/io/fs/local_file_system_test.cpp b/be/test/io/fs/local_file_system_test.cpp index 953d7669b8..7056710846 100644 --- a/be/test/io/fs/local_file_system_test.cpp +++ b/be/test/io/fs/local_file_system_test.cpp @@ -111,8 +111,8 @@ TEST_F(LocalFileSystemTest, TestRemove) { EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_test/abc/def/zxc").ok()); EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_test/abc/123").ok()); - save_string_file("./file_test/s1", "123"); - save_string_file("./file_test/123/s2", "123"); + static_cast(save_string_file("./file_test/s1", "123")); + static_cast(save_string_file("./file_test/123/s2", "123")); EXPECT_TRUE(check_exists("./file_test")); EXPECT_TRUE(io::global_local_filesystem()->delete_directory("./file_test").ok()); @@ -120,7 +120,7 @@ TEST_F(LocalFileSystemTest, TestRemove) { // remove EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_test/abc/123").ok()); - save_string_file("./file_test/abc/123/s2", "123"); + static_cast(save_string_file("./file_test/abc/123/s2", "123")); EXPECT_TRUE(check_exists("./file_test/abc/123/s2")); EXPECT_TRUE(io::global_local_filesystem()->delete_file("./file_test/abc/123/s2").ok()); @@ -136,8 +136,8 @@ TEST_F(LocalFileSystemTest, TestRemove) { // remove paths EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_test/123/456/789").ok()); EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_test/abc/def/zxc").ok()); - save_string_file("./file_test/s1", "123"); - save_string_file("./file_test/s2", "123"); + static_cast(save_string_file("./file_test/s1", "123")); + static_cast(save_string_file("./file_test/s2", "123")); std::vector ps; ps.push_back("./file_test/123/456/789"); @@ -172,7 +172,7 @@ TEST_F(LocalFileSystemTest, TestRemove) { TEST_F(LocalFileSystemTest, TestCreateDir) { // normal std::string path = "./file_test/123/456/789"; - io::global_local_filesystem()->delete_directory("./file_test"); + static_cast(io::global_local_filesystem()->delete_directory("./file_test")); EXPECT_FALSE(check_exists(path)); EXPECT_TRUE(io::global_local_filesystem()->create_directory(path).ok()); @@ -312,7 +312,7 @@ TEST_F(LocalFileSystemTest, TestRename) { EXPECT_TRUE(io::global_local_filesystem()->create_directory(path).ok()); EXPECT_TRUE(io::global_local_filesystem()->rename_dir(path, new_path).ok()); - save_string_file("./file_rename2/f1", "just test1"); + static_cast(save_string_file("./file_rename2/f1", "just test1")); EXPECT_TRUE( io::global_local_filesystem()->rename("./file_rename2/f1", "./file_rename2/f2").ok()); @@ -333,7 +333,7 @@ TEST_F(LocalFileSystemTest, TestLink) { EXPECT_TRUE(io::global_local_filesystem()->create_directory(path).ok()); // link file - save_string_file("./file_link/f2", "just test2"); + static_cast(save_string_file("./file_link/f2", "just test2")); EXPECT_TRUE( io::global_local_filesystem()->link_file("./file_link/f2", "./file_link/f2-1").ok()); std::vector dirs; @@ -352,7 +352,7 @@ TEST_F(LocalFileSystemTest, TestMD5) { EXPECT_TRUE(io::global_local_filesystem()->create_directory(path).ok()); // link fir - save_string_file("./file_md5/f1", "just test1"); + static_cast(save_string_file("./file_md5/f1", "just test1")); std::string md5; EXPECT_TRUE(io::global_local_filesystem()->md5sum("./file_md5/f1", &md5).ok()); EXPECT_EQ("56947c63232fef1c65e4c3f4d1c69a9c", md5); @@ -369,11 +369,11 @@ TEST_F(LocalFileSystemTest, TestCopyAndBatchDelete) { EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_copy/4").ok()); EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_copy/5").ok()); - save_string_file("./file_copy/f1", "just test1"); - save_string_file("./file_copy/f2", "just test2"); - save_string_file("./file_copy/f3", "just test3"); - save_string_file("./file_copy/1/f4", "just test3"); - save_string_file("./file_copy/2/f5", "just test3"); + static_cast(save_string_file("./file_copy/f1", "just test1")); + static_cast(save_string_file("./file_copy/f2", "just test2")); + static_cast(save_string_file("./file_copy/f3", "just test3")); + static_cast(save_string_file("./file_copy/1/f4", "just test3")); + static_cast(save_string_file("./file_copy/2/f5", "just test3")); // copy std::string dest_path = "./file_copy_dest/"; @@ -427,11 +427,11 @@ TEST_F(LocalFileSystemTest, TestIterate) { EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_iterate/d1").ok()); EXPECT_TRUE(io::global_local_filesystem()->create_directory("./file_iterate/d2").ok()); - save_string_file("./file_iterate/f1", "just test1"); - save_string_file("./file_iterate/f2", "just test2"); - save_string_file("./file_iterate/f3", "just test3"); - save_string_file("./file_iterate/d1/f4", "just test4"); - save_string_file("./file_iterate/d2/f5", "just test5"); + static_cast(save_string_file("./file_iterate/f1", "just test1")); + static_cast(save_string_file("./file_iterate/f2", "just test2")); + static_cast(save_string_file("./file_iterate/f3", "just test3")); + static_cast(save_string_file("./file_iterate/d1/f4", "just test4")); + static_cast(save_string_file("./file_iterate/d2/f5", "just test5")); int64_t file_count = 0; int64_t dir_count = 0; @@ -484,9 +484,9 @@ TEST_F(LocalFileSystemTest, TestListDirsFiles) { EXPECT_EQ(5, dirs.size()); EXPECT_EQ(0, files.size()); - save_string_file("./file_test/f1", "just test"); - save_string_file("./file_test/f2", "just test"); - save_string_file("./file_test/f3", "just test"); + static_cast(save_string_file("./file_test/f1", "just test")); + static_cast(save_string_file("./file_test/f2", "just test")); + static_cast(save_string_file("./file_test/f3", "just test")); dirs.clear(); files.clear(); @@ -624,9 +624,9 @@ TEST_F(LocalFileSystemTest, TestGlob) { ->create_directory("./be/ut_build_ASAN/test/file_path/3") .ok()); - save_string_file("./be/ut_build_ASAN/test/file_path/1/f1.txt", "just test"); - save_string_file("./be/ut_build_ASAN/test/file_path/1/f2.txt", "just test"); - save_string_file("./be/ut_build_ASAN/test/file_path/f3.txt", "just test"); + static_cast(save_string_file("./be/ut_build_ASAN/test/file_path/1/f1.txt", "just test")); + static_cast(save_string_file("./be/ut_build_ASAN/test/file_path/1/f2.txt", "just test")); + static_cast(save_string_file("./be/ut_build_ASAN/test/file_path/f3.txt", "just test")); std::vector files; EXPECT_FALSE(io::global_local_filesystem()->safe_glob("./../*.txt", &files).ok()); diff --git a/be/test/io/fs/multi_table_pipe_test.cpp b/be/test/io/fs/multi_table_pipe_test.cpp index ddc894d45f..16b0495ed9 100644 --- a/be/test/io/fs/multi_table_pipe_test.cpp +++ b/be/test/io/fs/multi_table_pipe_test.cpp @@ -54,16 +54,18 @@ TEST_F(MultiTablePipeTest, append_json) { std::shared_ptr ctx = std::make_shared(exec_env); MultiTablePipe pipe(ctx); - pipe.append_json(data1.c_str(), data1.size()); - pipe.append_json(data2.c_str(), data2.size()); - pipe.append_json(data3.c_str(), data3.size()); // should trigger 1st plan, for table 1&2 + static_cast(pipe.append_json(data1.c_str(), data1.size())); + static_cast(pipe.append_json(data2.c_str(), data2.size())); + static_cast(pipe.append_json(data3.c_str(), + data3.size())); // should trigger 1st plan, for table 1&2 EXPECT_EQ(pipe.get_pipe_by_table("test_table_1")->get_queue_size(), 2); EXPECT_EQ(pipe.get_pipe_by_table("test_table_2")->get_queue_size(), 1); - pipe.append_json(data4.c_str(), data4.size()); - pipe.append_json(data5.c_str(), data5.size()); - pipe.append_json(data6.c_str(), data6.size()); - pipe.append_json(data7.c_str(), data7.size()); - pipe.append_json(data8.c_str(), data8.size()); // should trigger 2nd plan, for table 3 + static_cast(pipe.append_json(data4.c_str(), data4.size())); + static_cast(pipe.append_json(data5.c_str(), data5.size())); + static_cast(pipe.append_json(data6.c_str(), data6.size())); + static_cast(pipe.append_json(data7.c_str(), data7.size())); + static_cast( + pipe.append_json(data8.c_str(), data8.size())); // should trigger 2nd plan, for table 3 EXPECT_EQ(pipe.get_pipe_by_table("test_table_1")->get_queue_size(), 3); EXPECT_EQ(pipe.get_pipe_by_table("test_table_2")->get_queue_size(), 2); EXPECT_EQ(pipe.get_pipe_by_table("test_table_3")->get_queue_size(), 3); diff --git a/be/test/olap/cumulative_compaction_policy_test.cpp b/be/test/olap/cumulative_compaction_policy_test.cpp index 553d29460e..dc44be734d 100644 --- a/be/test/olap/cumulative_compaction_policy_test.cpp +++ b/be/test/olap/cumulative_compaction_policy_test.cpp @@ -332,11 +332,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, calc_cumulative_compaction_score init_rs_meta_small_base(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); std::shared_ptr cumulative_compaction_policy = @@ -353,11 +354,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, calc_cumulative_compaction_score init_rs_meta_big_base(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); std::shared_ptr cumulative_compaction_policy = CumulativeCompactionPolicyFactory::create_cumulative_compaction_policy( @@ -373,11 +375,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, calculate_cumulative_point_big_b init_rs_meta_big_base(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); EXPECT_EQ(4, _tablet->cumulative_layer_point()); @@ -388,11 +391,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, calculate_cumulative_point_overl init_all_rs_meta_cal_point(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); EXPECT_EQ(2, _tablet->cumulative_layer_point()); @@ -403,11 +407,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_candidate_rowsets) { init_all_rs_meta_cal_point(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -419,11 +424,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_candidate_rowsets_big_base) init_rs_meta_big_base(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -435,11 +441,11 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_input_rowsets_normal) { init_rs_meta_small_base(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -462,11 +468,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_input_rowsets_big_base) { init_rs_meta_big_base(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -489,11 +496,11 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_input_rowsets_promotion) { init_rs_meta_pick_promotion(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -516,11 +523,11 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_input_rowsets_not_same_leve init_rs_meta_pick_not_same_level(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -543,11 +550,11 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_input_rowsets_empty) { init_rs_meta_pick_empty(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -570,11 +577,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_input_rowsets_not_reach_min init_rs_meta_pick_empty_not_reach_min_limit(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -598,11 +606,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_input_rowsets_delete_in_cum init_all_rs_meta_delete(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -628,11 +637,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, pick_input_rowsets_delete) { init_all_rs_meta_delete(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -656,11 +666,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, _calc_promotion_size_big) { init_rs_meta_pick_not_same_level(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); EXPECT_EQ(1073741824, _tablet->cumulative_promotion_size()); @@ -671,11 +682,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, _calc_promotion_size_small) { init_rs_meta_small_base(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; _tablet->calculate_cumulative_point(); EXPECT_EQ(67108864, _tablet->cumulative_promotion_size()); @@ -686,11 +698,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, _level_size) { init_rs_meta_small_base(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } config::compaction_promotion_size_mbytes = 1024; TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; SizeBasedCumulativeCompactionPolicy* policy = dynamic_cast( @@ -707,11 +720,12 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, _pick_missing_version_cumulative init_rs_meta_missing_version(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_SIZE_BASED_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); + ; // has miss version std::vector rowsets; @@ -720,20 +734,20 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy, _pick_missing_version_cumulative rowsets.push_back(_tablet->get_rowset_by_version({2, 2})); rowsets.push_back(_tablet->get_rowset_by_version({4, 4})); CumulativeCompaction compaction(_tablet); - compaction.find_longest_consecutive_version(&rowsets, nullptr); + static_cast(compaction.find_longest_consecutive_version(&rowsets, nullptr)); EXPECT_EQ(3, rowsets.size()); EXPECT_EQ(2, rowsets[2]->end_version()); // no miss version std::vector rowsets2; rowsets2.push_back(_tablet->get_rowset_by_version({0, 0})); - compaction.find_longest_consecutive_version(&rowsets2, nullptr); + static_cast(compaction.find_longest_consecutive_version(&rowsets2, nullptr)); EXPECT_EQ(1, rowsets2.size()); EXPECT_EQ(0, rowsets[0]->end_version()); // no version std::vector rowsets3; - compaction.find_longest_consecutive_version(&rowsets3, nullptr); + static_cast(compaction.find_longest_consecutive_version(&rowsets3, nullptr)); EXPECT_EQ(0, rowsets3.size()); } } // namespace doris diff --git a/be/test/olap/cumulative_compaction_time_series_policy_test.cpp b/be/test/olap/cumulative_compaction_time_series_policy_test.cpp index 27ead8ccc4..c0eb88c86b 100644 --- a/be/test/olap/cumulative_compaction_time_series_policy_test.cpp +++ b/be/test/olap/cumulative_compaction_time_series_policy_test.cpp @@ -298,11 +298,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, calculate_cumulative_point_over init_rs_meta_cal_point(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); EXPECT_EQ(4, _tablet->cumulative_layer_point()); @@ -313,11 +313,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, calculate_cumulative_point_big_ init_rs_meta_big_rowset(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); EXPECT_EQ(4, _tablet->cumulative_layer_point()); @@ -328,11 +328,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, calc_cumulative_compaction_scor init_rs_meta_normal(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); std::shared_ptr cumulative_compaction_policy = @@ -349,11 +349,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, calc_cumulative_compaction_scor init_rs_meta_big_rowset(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); std::shared_ptr cumulative_compaction_policy = CumulativeCompactionPolicyFactory::create_cumulative_compaction_policy( @@ -369,11 +369,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, pick_candidate_rowsets) { init_rs_meta_normal(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -385,11 +385,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, pick_candidate_rowsets_big_rows init_rs_meta_big_rowset(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -401,11 +401,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, pick_input_rowsets_goal_size) { init_rs_meta_big_rowset(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -428,11 +428,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, pick_input_rowsets_file_count) init_all_rs_meta_normal_size(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -455,11 +455,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, pick_input_rowsets_time_interva init_all_rs_meta_normal_size_nonoverlapping(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); int64_t now = UnixMillis(); _tablet->set_last_cumu_compaction_success_time(now - 3700 * 1000); @@ -484,11 +484,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, pick_input_rowsets_empty) { init_all_rs_meta_normal_size_nonoverlapping(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); int64_t now = UnixMillis(); _tablet->set_last_cumu_compaction_success_time(now); @@ -513,11 +513,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, pick_input_rowsets_delete) { init_all_rs_meta_delete(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); _tablet->calculate_cumulative_point(); auto candidate_rowsets = _tablet->pick_candidate_rowsets_to_cumulative_compaction(); @@ -541,11 +541,11 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, _pick_missing_version_cumulativ init_rs_meta_missing_version(&rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr, CUMULATIVE_TIME_SERIES_POLICY)); - _tablet->init(); + static_cast(_tablet->init()); // has miss version std::vector rowsets; @@ -554,20 +554,20 @@ TEST_F(TestTimeSeriesCumulativeCompactionPolicy, _pick_missing_version_cumulativ rowsets.push_back(_tablet->get_rowset_by_version({2, 2})); rowsets.push_back(_tablet->get_rowset_by_version({4, 4})); CumulativeCompaction compaction(_tablet); - compaction.find_longest_consecutive_version(&rowsets, nullptr); + static_cast(compaction.find_longest_consecutive_version(&rowsets, nullptr)); EXPECT_EQ(3, rowsets.size()); EXPECT_EQ(2, rowsets[2]->end_version()); // no miss version std::vector rowsets2; rowsets2.push_back(_tablet->get_rowset_by_version({0, 0})); - compaction.find_longest_consecutive_version(&rowsets2, nullptr); + static_cast(compaction.find_longest_consecutive_version(&rowsets2, nullptr)); EXPECT_EQ(1, rowsets2.size()); EXPECT_EQ(0, rowsets[0]->end_version()); // no version std::vector rowsets3; - compaction.find_longest_consecutive_version(&rowsets3, nullptr); + static_cast(compaction.find_longest_consecutive_version(&rowsets3, nullptr)); EXPECT_EQ(0, rowsets3.size()); } } // namespace doris diff --git a/be/test/olap/delete_bitmap_calculator_test.cpp b/be/test/olap/delete_bitmap_calculator_test.cpp index 53bdb9c0fb..898e6f2f5a 100644 --- a/be/test/olap/delete_bitmap_calculator_test.cpp +++ b/be/test/olap/delete_bitmap_calculator_test.cpp @@ -109,7 +109,7 @@ public: Status st = fs->create_file(path, &file_writer); EXPECT_TRUE(st.ok()); DataDir data_dir(kSegmentDir); - data_dir.init(); + static_cast(data_dir.init()); SegmentWriter writer(file_writer.get(), segment_id, build_schema, nullptr, &data_dir, INT32_MAX, opts, nullptr); st = writer.init(); diff --git a/be/test/olap/delete_handler_test.cpp b/be/test/olap/delete_handler_test.cpp index 31af67d535..c4b883c994 100644 --- a/be/test/olap/delete_handler_test.cpp +++ b/be/test/olap/delete_handler_test.cpp @@ -311,8 +311,8 @@ protected: // Remove all dir. tablet.reset(); dup_tablet.reset(); - StorageEngine::instance()->tablet_manager()->drop_tablet(_create_tablet.tablet_id, - _create_tablet.replica_id, false); + static_cast(StorageEngine::instance()->tablet_manager()->drop_tablet( + _create_tablet.tablet_id, _create_tablet.replica_id, false)); EXPECT_TRUE( io::global_local_filesystem()->delete_directory(config::storage_root_path).ok()); } @@ -510,8 +510,8 @@ protected: void TearDown() { // Remove all dir. tablet.reset(); - k_engine->tablet_manager()->drop_tablet(_create_tablet.tablet_id, _create_tablet.replica_id, - false); + static_cast(k_engine->tablet_manager()->drop_tablet( + _create_tablet.tablet_id, _create_tablet.replica_id, false)); EXPECT_TRUE( io::global_local_filesystem()->delete_directory(config::storage_root_path).ok()); } @@ -881,8 +881,9 @@ protected: EXPECT_TRUE(tablet != nullptr); _tablet_path = tablet->tablet_path(); - _data_row_cursor.init(tablet->tablet_schema()); - _data_row_cursor.allocate_memory_for_string_type(tablet->tablet_schema()); + static_cast(_data_row_cursor.init(tablet->tablet_schema())); + static_cast( + _data_row_cursor.allocate_memory_for_string_type(tablet->tablet_schema())); _json_rowset_meta = R"({ "rowset_id": 540081, "tablet_id": 15673, @@ -909,8 +910,8 @@ protected: // Remove all dir. tablet.reset(); _delete_handler.finalize(); - StorageEngine::instance()->tablet_manager()->drop_tablet(_create_tablet.tablet_id, - _create_tablet.replica_id, false); + static_cast(StorageEngine::instance()->tablet_manager()->drop_tablet( + _create_tablet.tablet_id, _create_tablet.replica_id, false)); EXPECT_TRUE( io::global_local_filesystem()->delete_directory(config::storage_root_path).ok()); } @@ -934,7 +935,7 @@ protected: rsm->set_delete_predicate(del_pred); rsm->set_tablet_schema(tablet->tablet_schema()); RowsetSharedPtr rowset = std::make_shared(tablet->tablet_schema(), "", rsm); - tablet->add_rowset(rowset); + static_cast(tablet->add_rowset(rowset)); } std::vector get_delete_predicates() { diff --git a/be/test/olap/delta_writer_test.cpp b/be/test/olap/delta_writer_test.cpp index 0cfc9e944b..56cb647983 100644 --- a/be/test/olap/delta_writer_test.cpp +++ b/be/test/olap/delta_writer_test.cpp @@ -73,7 +73,8 @@ static void set_up() { char buffer[MAX_PATH_LEN]; EXPECT_NE(getcwd(buffer, MAX_PATH_LEN), nullptr); config::storage_root_path = std::string(buffer) + "/data_test"; - io::global_local_filesystem()->delete_and_create_directory(config::storage_root_path); + static_cast( + io::global_local_filesystem()->delete_and_create_directory(config::storage_root_path)); std::vector paths; paths.emplace_back(config::storage_root_path, -1); @@ -85,8 +86,8 @@ static void set_up() { ExecEnv* exec_env = doris::ExecEnv::GetInstance(); exec_env->set_memtable_memory_limiter(new MemTableMemoryLimiter()); - exec_env->set_storage_engine(k_engine.get()); - k_engine->start_bg_threads(); + static_cast(exec_env->set_storage_engine(k_engine.get())); + static_cast(k_engine->start_bg_threads()); } static void tear_down() { @@ -95,8 +96,8 @@ static void tear_down() { exec_env->set_storage_engine(nullptr); k_engine.reset(); EXPECT_EQ(system("rm -rf ./data_test"), 0); - io::global_local_filesystem()->delete_directory(std::string(getenv("DORIS_HOME")) + "/" + - UNUSED_PREFIX); + static_cast(io::global_local_filesystem()->delete_directory( + std::string(getenv("DORIS_HOME")) + "/" + UNUSED_PREFIX)); } static void create_tablet_request(int64_t tablet_id, int32_t schema_hash, @@ -482,7 +483,7 @@ TEST_F(TestDeltaWriter, open) { TDescriptorTable tdesc_tbl = create_descriptor_tablet(); ObjectPool obj_pool; DescriptorTbl* desc_tbl = nullptr; - DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl); + static_cast(DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl)); TupleDescriptor* tuple_desc = desc_tbl->get_tuple_descriptor(0); OlapTableSchemaParam param; @@ -503,7 +504,7 @@ TEST_F(TestDeltaWriter, open) { // test vec delta writer profile = std::make_unique("LoadChannels"); - DeltaWriter::open(&write_req, &delta_writer, profile.get(), TUniqueId()); + static_cast(DeltaWriter::open(&write_req, &delta_writer, profile.get(), TUniqueId())); EXPECT_NE(delta_writer, nullptr); res = delta_writer->close(); EXPECT_EQ(Status::OK(), res); @@ -528,7 +529,7 @@ TEST_F(TestDeltaWriter, vec_write) { TDescriptorTable tdesc_tbl = create_descriptor_tablet(); ObjectPool obj_pool; DescriptorTbl* desc_tbl = nullptr; - DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl); + static_cast(DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl)); TupleDescriptor* tuple_desc = desc_tbl->get_tuple_descriptor(0); // const std::vector& slots = tuple_desc->slots(); OlapTableSchemaParam param; @@ -548,7 +549,7 @@ TEST_F(TestDeltaWriter, vec_write) { write_req.table_schema_param = ¶m; DeltaWriter* delta_writer = nullptr; profile = std::make_unique("LoadChannels"); - DeltaWriter::open(&write_req, &delta_writer, profile.get(), TUniqueId()); + static_cast(DeltaWriter::open(&write_req, &delta_writer, profile.get(), TUniqueId())); ASSERT_NE(delta_writer, nullptr); vectorized::Block block; @@ -694,7 +695,7 @@ TEST_F(TestDeltaWriter, vec_sequence_col) { TDescriptorTable tdesc_tbl = create_descriptor_tablet_with_sequence_col(); ObjectPool obj_pool; DescriptorTbl* desc_tbl = nullptr; - DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl); + static_cast(DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl)); TupleDescriptor* tuple_desc = desc_tbl->get_tuple_descriptor(0); OlapTableSchemaParam param; @@ -713,7 +714,7 @@ TEST_F(TestDeltaWriter, vec_sequence_col) { write_req.table_schema_param = ¶m; DeltaWriter* delta_writer = nullptr; profile = std::make_unique("LoadChannels"); - DeltaWriter::open(&write_req, &delta_writer, profile.get(), TUniqueId()); + static_cast(DeltaWriter::open(&write_req, &delta_writer, profile.get(), TUniqueId())); ASSERT_NE(delta_writer, nullptr); vectorized::Block block; @@ -811,7 +812,7 @@ TEST_F(TestDeltaWriter, vec_sequence_col_concurrent_write) { TDescriptorTable tdesc_tbl = create_descriptor_tablet_with_sequence_col(); ObjectPool obj_pool; DescriptorTbl* desc_tbl = nullptr; - DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl); + static_cast(DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl)); TupleDescriptor* tuple_desc = desc_tbl->get_tuple_descriptor(0); OlapTableSchemaParam param; @@ -834,8 +835,8 @@ TEST_F(TestDeltaWriter, vec_sequence_col_concurrent_write) { profile1 = std::make_unique("LoadChannels1"); std::unique_ptr profile2; profile2 = std::make_unique("LoadChannels2"); - DeltaWriter::open(&write_req, &delta_writer1, profile1.get(), TUniqueId()); - DeltaWriter::open(&write_req, &delta_writer2, profile2.get(), TUniqueId()); + static_cast(DeltaWriter::open(&write_req, &delta_writer1, profile1.get(), TUniqueId())); + static_cast(DeltaWriter::open(&write_req, &delta_writer2, profile2.get(), TUniqueId())); ASSERT_NE(delta_writer1, nullptr); ASSERT_NE(delta_writer2, nullptr); @@ -995,7 +996,7 @@ TEST_F(TestDeltaWriter, vec_sequence_col_concurrent_write) { std::unique_ptr iter; std::shared_ptr schema = std::make_shared(rowset1->tablet_schema()); std::vector segments; - ((BetaRowset*)rowset1.get())->load_segments(&segments); + static_cast(((BetaRowset*)rowset1.get())->load_segments(&segments)); auto s = segments[0]->new_iterator(schema, opts, &iter); ASSERT_TRUE(s.ok()); auto read_block = rowset1->tablet_schema()->create_block(); @@ -1023,7 +1024,7 @@ TEST_F(TestDeltaWriter, vec_sequence_col_concurrent_write) { std::unique_ptr iter; std::shared_ptr schema = std::make_shared(rowset2->tablet_schema()); std::vector segments; - ((BetaRowset*)rowset2.get())->load_segments(&segments); + static_cast(((BetaRowset*)rowset2.get())->load_segments(&segments)); auto s = segments[0]->new_iterator(schema, opts, &iter); ASSERT_TRUE(s.ok()); auto read_block = rowset2->tablet_schema()->create_block(); diff --git a/be/test/olap/engine_storage_migration_task_test.cpp b/be/test/olap/engine_storage_migration_task_test.cpp index 037e2a70c7..7fc00bfe02 100644 --- a/be/test/olap/engine_storage_migration_task_test.cpp +++ b/be/test/olap/engine_storage_migration_task_test.cpp @@ -83,7 +83,7 @@ static void set_up() { ExecEnv* exec_env = doris::ExecEnv::GetInstance(); exec_env->set_memtable_memory_limiter(new MemTableMemoryLimiter()); exec_env->set_storage_engine(k_engine.get()); - k_engine->start_bg_threads(); + static_cast(k_engine->start_bg_threads()); } static void tear_down() { @@ -178,7 +178,7 @@ TEST_F(TestEngineStorageMigrationTask, write_and_migration) { TDescriptorTable tdesc_tbl = create_descriptor_tablet_with_sequence_col(); ObjectPool obj_pool; DescriptorTbl* desc_tbl = nullptr; - DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl); + static_cast(DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl)); TupleDescriptor* tuple_desc = desc_tbl->get_tuple_descriptor(0); OlapTableSchemaParam param; @@ -199,7 +199,7 @@ TEST_F(TestEngineStorageMigrationTask, write_and_migration) { DeltaWriter* delta_writer = nullptr; profile = std::make_unique("LoadChannels"); - DeltaWriter::open(&write_req, &delta_writer, profile.get()); + static_cast(DeltaWriter::open(&write_req, &delta_writer, profile.get())); EXPECT_NE(delta_writer, nullptr); res = delta_writer->close(); diff --git a/be/test/olap/key_coder_test.cpp b/be/test/olap/key_coder_test.cpp index 6660617842..d8c341fce8 100644 --- a/be/test/olap/key_coder_test.cpp +++ b/be/test/olap/key_coder_test.cpp @@ -57,7 +57,8 @@ void test_integer_encode() { { Slice slice(buf); CppType check_val; - key_coder->decode_ascending(&slice, sizeof(CppType), (uint8_t*)&check_val); + static_cast( + key_coder->decode_ascending(&slice, sizeof(CppType), (uint8_t*)&check_val)); EXPECT_EQ(val, check_val); } } @@ -76,7 +77,8 @@ void test_integer_encode() { { Slice slice(buf); CppType check_val; - key_coder->decode_ascending(&slice, sizeof(CppType), (uint8_t*)&check_val); + static_cast( + key_coder->decode_ascending(&slice, sizeof(CppType), (uint8_t*)&check_val)); EXPECT_EQ(val, check_val); } } @@ -132,7 +134,8 @@ TEST_F(KeyCoderTest, test_date) { { Slice slice(buf); CppType check_val; - key_coder->decode_ascending(&slice, sizeof(CppType), (uint8_t*)&check_val); + static_cast( + key_coder->decode_ascending(&slice, sizeof(CppType), (uint8_t*)&check_val)); EXPECT_EQ(val, check_val); } } @@ -148,7 +151,8 @@ TEST_F(KeyCoderTest, test_date) { { Slice slice(buf); CppType check_val; - key_coder->decode_ascending(&slice, sizeof(CppType), (uint8_t*)&check_val); + static_cast( + key_coder->decode_ascending(&slice, sizeof(CppType), (uint8_t*)&check_val)); EXPECT_EQ(val, check_val); } } @@ -183,7 +187,8 @@ TEST_F(KeyCoderTest, test_decimal) { decimal12_t check_val; Slice slice1(buf1); - key_coder->decode_ascending(&slice1, sizeof(decimal12_t), (uint8_t*)&check_val); + static_cast( + key_coder->decode_ascending(&slice1, sizeof(decimal12_t), (uint8_t*)&check_val)); EXPECT_EQ(check_val, val1); { diff --git a/be/test/olap/memtable_memory_limiter_test.cpp b/be/test/olap/memtable_memory_limiter_test.cpp index 22a8421fd9..54d75d0a19 100644 --- a/be/test/olap/memtable_memory_limiter_test.cpp +++ b/be/test/olap/memtable_memory_limiter_test.cpp @@ -79,7 +79,8 @@ protected: char buffer[MAX_PATH_LEN]; EXPECT_NE(getcwd(buffer, MAX_PATH_LEN), nullptr); config::storage_root_path = std::string(buffer) + "/data_test"; - io::global_local_filesystem()->delete_and_create_directory(config::storage_root_path); + static_cast(io::global_local_filesystem()->delete_and_create_directory( + config::storage_root_path)); std::vector paths; paths.emplace_back(config::storage_root_path, -1); @@ -94,7 +95,7 @@ protected: // So we must do this before storage engine's other operation. exec_env->set_storage_engine(_engine.get()); exec_env->set_memtable_memory_limiter(new MemTableMemoryLimiter()); - _engine->start_bg_threads(); + static_cast(_engine->start_bg_threads()); } void TearDown() override { @@ -103,8 +104,8 @@ protected: exec_env->set_storage_engine(nullptr); _engine.reset(nullptr); EXPECT_EQ(system("rm -rf ./data_test"), 0); - io::global_local_filesystem()->delete_directory(std::string(getenv("DORIS_HOME")) + "/" + - UNUSED_PREFIX); + static_cast(io::global_local_filesystem()->delete_directory( + std::string(getenv("DORIS_HOME")) + "/" + UNUSED_PREFIX)); } std::unique_ptr _engine; @@ -121,7 +122,7 @@ TEST_F(MemTableMemoryLimiterTest, handle_memtable_flush_test) { TDescriptorTable tdesc_tbl = create_descriptor_tablet(); ObjectPool obj_pool; DescriptorTbl* desc_tbl = nullptr; - DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl); + static_cast(DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl)); TupleDescriptor* tuple_desc = desc_tbl->get_tuple_descriptor(0); OlapTableSchemaParam param; @@ -140,7 +141,7 @@ TEST_F(MemTableMemoryLimiterTest, handle_memtable_flush_test) { write_req.table_schema_param = ¶m; DeltaWriter* delta_writer = nullptr; profile = std::make_unique("MemTableMemoryLimiterTest"); - DeltaWriter::open(&write_req, &delta_writer, profile.get(), TUniqueId()); + static_cast(DeltaWriter::open(&write_req, &delta_writer, profile.get(), TUniqueId())); ASSERT_NE(delta_writer, nullptr); auto mem_limiter = ExecEnv::GetInstance()->memtable_memory_limiter(); @@ -164,7 +165,7 @@ TEST_F(MemTableMemoryLimiterTest, handle_memtable_flush_test) { res = delta_writer->write(&block, {0}); ASSERT_TRUE(res.ok()); } - mem_limiter->init(100); + static_cast(mem_limiter->init(100)); mem_limiter->handle_memtable_flush(); CHECK_EQ(0, mem_limiter->mem_usage()); diff --git a/be/test/olap/ordered_data_compaction_test.cpp b/be/test/olap/ordered_data_compaction_test.cpp index b53689c229..bac4b63e20 100644 --- a/be/test/olap/ordered_data_compaction_test.cpp +++ b/be/test/olap/ordered_data_compaction_test.cpp @@ -87,7 +87,7 @@ protected: .ok()); _data_dir = std::make_unique(absolute_dir); - _data_dir->update_capacity(); + static_cast(_data_dir->update_capacity()); doris::EngineOptions options; k_engine = new StorageEngine(options); ExecEnv::GetInstance()->set_storage_engine(k_engine); @@ -308,7 +308,7 @@ protected: rsm->set_delete_predicate(del_pred); rsm->set_tablet_schema(tablet->tablet_schema()); RowsetSharedPtr rowset = std::make_shared(tablet->tablet_schema(), "", rsm); - tablet->add_rowset(rowset); + static_cast(tablet->add_rowset(rowset)); } TabletSharedPtr create_tablet(const TabletSchema& tablet_schema, @@ -344,7 +344,7 @@ protected: TCompressionType::LZ4F, 0, enable_unique_key_merge_on_write)); TabletSharedPtr tablet(new Tablet(tablet_meta, _data_dir.get())); - tablet->init(); + static_cast(tablet->init()); if (has_delete_handler) { // delete data with key < 1000 std::vector conditions; diff --git a/be/test/olap/primary_key_index_test.cpp b/be/test/olap/primary_key_index_test.cpp index 70cb670396..4de6be24fe 100644 --- a/be/test/olap/primary_key_index_test.cpp +++ b/be/test/olap/primary_key_index_test.cpp @@ -58,12 +58,12 @@ TEST_F(PrimaryKeyIndexTest, builder) { EXPECT_TRUE(fs->create_file(filename, &file_writer).ok()); PrimaryKeyIndexBuilder builder(file_writer.get(), 0); - builder.init(); + static_cast(builder.init()); size_t num_rows = 0; std::vector keys; for (int i = 1000; i < 10000; i += 2) { keys.push_back(std::to_string(i)); - builder.add_item(std::to_string(i)); + static_cast(builder.add_item(std::to_string(i))); num_rows++; } EXPECT_EQ("1000", builder.min_key().to_string()); diff --git a/be/test/olap/rowid_conversion_test.cpp b/be/test/olap/rowid_conversion_test.cpp index 21d17d834f..20687d263c 100644 --- a/be/test/olap/rowid_conversion_test.cpp +++ b/be/test/olap/rowid_conversion_test.cpp @@ -277,7 +277,7 @@ protected: TCompressionType::LZ4F, 0, enable_unique_key_merge_on_write)); TabletSharedPtr tablet(new Tablet(tablet_meta, nullptr)); - tablet->init(); + static_cast(tablet->init()); return tablet; } diff --git a/be/test/olap/rowset/beta_rowset_test.cpp b/be/test/olap/rowset/beta_rowset_test.cpp index 81e587370a..e88ae95d03 100644 --- a/be/test/olap/rowset/beta_rowset_test.cpp +++ b/be/test/olap/rowset/beta_rowset_test.cpp @@ -79,7 +79,7 @@ static const std::string kTestDir = "./data_test/data/beta_rowset_test"; class BetaRowsetTest : public testing::Test { public: BetaRowsetTest() : _data_dir(std::make_unique(kTestDir)) { - _data_dir->update_capacity(); + static_cast(_data_dir->update_capacity()); } static void SetUpTestSuite() { diff --git a/be/test/olap/rowset/rowset_tree_test.cpp b/be/test/olap/rowset/rowset_tree_test.cpp index 0864be576a..a6f7965f44 100644 --- a/be/test/olap/rowset/rowset_tree_test.cpp +++ b/be/test/olap/rowset/rowset_tree_test.cpp @@ -94,7 +94,7 @@ public: RowsetMetaSharedPtr meta_ptr = make_shared(); meta_ptr->init_from_pb(rs_meta_pb); RowsetSharedPtr res_ptr; - MockRowset::create_rowset(schema_, meta_ptr, &res_ptr, is_mem_rowset); + static_cast(MockRowset::create_rowset(schema_, meta_ptr, &res_ptr, is_mem_rowset)); return res_ptr; } @@ -292,7 +292,7 @@ TEST_F(TestRowsetTree, TestTreeRandomized) { tree.FindRowsetsIntersectingInterval(Slice(bound.first), Slice(bound.second), &out); for (const auto& e : out) { std::vector segments_key_bounds; - e.first->get_segments_key_bounds(&segments_key_bounds); + static_cast(e.first->get_segments_key_bounds(&segments_key_bounds)); ASSERT_EQ(1, segments_key_bounds.size()); string min = segments_key_bounds[0].min_key(); string max = segments_key_bounds[0].max_key(); diff --git a/be/test/olap/rowset/segment_v2/bitmap_index_test.cpp b/be/test/olap/rowset/segment_v2/bitmap_index_test.cpp index cfcfbb7a01..114b61caa8 100644 --- a/be/test/olap/rowset/segment_v2/bitmap_index_test.cpp +++ b/be/test/olap/rowset/segment_v2/bitmap_index_test.cpp @@ -66,7 +66,7 @@ void write_index_file(const std::string& filename, FileSystemSPtr fs, const void EXPECT_TRUE(fs->create_file(filename, &file_writer).ok()); std::unique_ptr writer; - BitmapIndexWriter::create(type_info, &writer); + static_cast(BitmapIndexWriter::create(type_info, &writer)); writer->add_values(values, value_count); writer->add_nulls(null_count); EXPECT_TRUE(writer->finish(file_writer.get(), meta).ok()); @@ -113,7 +113,7 @@ TEST_F(BitmapIndexTest, test_invert) { EXPECT_EQ(2, iter->current_ordinal()); Roaring bitmap; - iter->read_bitmap(iter->current_ordinal(), &bitmap); + static_cast(iter->read_bitmap(iter->current_ordinal(), &bitmap)); EXPECT_TRUE(Roaring::bitmapOf(1, 2) == bitmap); int value2 = 1024 * 9; @@ -122,15 +122,16 @@ TEST_F(BitmapIndexTest, test_invert) { EXPECT_TRUE(exact_match); EXPECT_EQ(1024 * 9, iter->current_ordinal()); - iter->read_union_bitmap(iter->current_ordinal(), iter->bitmap_nums(), &bitmap); + static_cast( + iter->read_union_bitmap(iter->current_ordinal(), iter->bitmap_nums(), &bitmap)); EXPECT_EQ(1025, bitmap.cardinality()); int value3 = 1024; - iter->seek_dictionary(&value3, &exact_match); + static_cast(iter->seek_dictionary(&value3, &exact_match)); EXPECT_EQ(1024, iter->current_ordinal()); Roaring bitmap2; - iter->read_union_bitmap(0, iter->current_ordinal(), &bitmap2); + static_cast(iter->read_union_bitmap(0, iter->current_ordinal(), &bitmap2)); EXPECT_EQ(1024, bitmap2.cardinality()); delete reader; @@ -169,7 +170,7 @@ TEST_F(BitmapIndexTest, test_invert_2) { EXPECT_EQ(1024, iter->current_ordinal()); Roaring bitmap; - iter->read_union_bitmap(0, iter->current_ordinal(), &bitmap); + static_cast(iter->read_union_bitmap(0, iter->current_ordinal(), &bitmap)); EXPECT_EQ(1024, bitmap.cardinality()); delete reader; @@ -203,7 +204,7 @@ TEST_F(BitmapIndexTest, test_multi_pages) { EXPECT_EQ(0, iter->current_ordinal()); Roaring bitmap; - iter->read_bitmap(iter->current_ordinal(), &bitmap); + static_cast(iter->read_bitmap(iter->current_ordinal(), &bitmap)); EXPECT_EQ(1, bitmap.cardinality()); delete reader; @@ -229,7 +230,7 @@ TEST_F(BitmapIndexTest, test_null) { get_bitmap_reader_iter(file_name, meta, &reader, &iter); Roaring bitmap; - iter->read_null_bitmap(&bitmap); + static_cast(iter->read_null_bitmap(&bitmap)); EXPECT_EQ(30, bitmap.cardinality()); delete reader; diff --git a/be/test/olap/rowset/segment_v2/bloom_filter_index_reader_writer_test.cpp b/be/test/olap/rowset/segment_v2/bloom_filter_index_reader_writer_test.cpp index e02ed57295..9f05cd093c 100644 --- a/be/test/olap/rowset/segment_v2/bloom_filter_index_reader_writer_test.cpp +++ b/be/test/olap/rowset/segment_v2/bloom_filter_index_reader_writer_test.cpp @@ -70,7 +70,8 @@ void write_bloom_filter_index_file(const std::string& file_name, const void* val std::unique_ptr bloom_filter_index_writer; BloomFilterOptions bf_options; - BloomFilterIndexWriter::create(bf_options, type_info, &bloom_filter_index_writer); + static_cast( + BloomFilterIndexWriter::create(bf_options, type_info, &bloom_filter_index_writer)); const CppType* vals = (const CppType*)values; for (int i = 0; i < value_count;) { size_t num = std::min(1024, (int)value_count - i); diff --git a/be/test/olap/rowset/segment_v2/zone_map_index_test.cpp b/be/test/olap/rowset/segment_v2/zone_map_index_test.cpp index 137f0986f0..1fc3bf36c5 100644 --- a/be/test/olap/rowset/segment_v2/zone_map_index_test.cpp +++ b/be/test/olap/rowset/segment_v2/zone_map_index_test.cpp @@ -51,24 +51,24 @@ public: auto fs = io::global_local_filesystem(); std::unique_ptr builder(nullptr); - ZoneMapIndexWriter::create(field, builder); + static_cast(ZoneMapIndexWriter::create(field, builder)); std::vector values1 = {"aaaa", "bbbb", "cccc", "dddd", "eeee", "ffff"}; for (auto& value : values1) { Slice slice(value); builder->add_values((const uint8_t*)&slice, 1); } - builder->flush(); + static_cast(builder->flush()); std::vector values2 = {"aaaaa", "bbbbb", "ccccc", "ddddd", "eeeee", "fffff"}; for (auto& value : values2) { Slice slice(value); builder->add_values((const uint8_t*)&slice, 1); } builder->add_nulls(1); - builder->flush(); + static_cast(builder->flush()); for (int i = 0; i < 6; ++i) { builder->add_nulls(1); } - builder->flush(); + static_cast(builder->flush()); // write out zone map index ColumnIndexMetaPB index_meta; { @@ -107,7 +107,7 @@ public: auto fs = io::global_local_filesystem(); std::unique_ptr builder(nullptr); - ZoneMapIndexWriter::create(field, builder); + static_cast(ZoneMapIndexWriter::create(field, builder)); char ch = 'a'; char buf[1024]; for (int i = 0; i < 5; i++) { @@ -115,7 +115,7 @@ public: Slice slice(buf, 1024); builder->add_values((const uint8_t*)&slice, 1); } - builder->flush(); + static_cast(builder->flush()); // write out zone map index ColumnIndexMetaPB index_meta; @@ -157,20 +157,20 @@ TEST_F(ColumnZoneMapTest, NormalTestIntPage) { Field* field = FieldFactory::create(int_column); std::unique_ptr builder(nullptr); - ZoneMapIndexWriter::create(field, builder); + static_cast(ZoneMapIndexWriter::create(field, builder)); std::vector values1 = {1, 10, 11, 20, 21, 22}; for (auto value : values1) { builder->add_values((const uint8_t*)&value, 1); } - builder->flush(); + static_cast(builder->flush()); std::vector values2 = {2, 12, 31, 23, 21, 22}; for (auto value : values2) { builder->add_values((const uint8_t*)&value, 1); } builder->add_nulls(1); - builder->flush(); + static_cast(builder->flush()); builder->add_nulls(6); - builder->flush(); + static_cast(builder->flush()); // write out zone map index ColumnIndexMetaPB index_meta; { diff --git a/be/test/olap/short_key_index_test.cpp b/be/test/olap/short_key_index_test.cpp index 7d5bded0e7..55abfec960 100644 --- a/be/test/olap/short_key_index_test.cpp +++ b/be/test/olap/short_key_index_test.cpp @@ -37,7 +37,7 @@ TEST_F(ShortKeyIndexTest, builder) { int num_items = 0; for (int i = 1000; i < 10000; i += 2) { - builder.add_item(std::to_string(i)); + static_cast(builder.add_item(std::to_string(i))); num_items++; } std::vector slices; diff --git a/be/test/olap/tablet_cooldown_test.cpp b/be/test/olap/tablet_cooldown_test.cpp index e475791da3..c6de64572c 100644 --- a/be/test/olap/tablet_cooldown_test.cpp +++ b/be/test/olap/tablet_cooldown_test.cpp @@ -341,7 +341,7 @@ void createTablet(TabletSharedPtr* tablet, int64_t replica_id, int32_t schema_ha TDescriptorTable tdesc_tbl = create_descriptor_tablet_with_sequence_col(); ObjectPool obj_pool; DescriptorTbl* desc_tbl = nullptr; - DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl); + static_cast(DescriptorTbl::create(&obj_pool, tdesc_tbl, &desc_tbl)); TupleDescriptor* tuple_desc = desc_tbl->get_tuple_descriptor(0); OlapTableSchemaParam param; @@ -363,7 +363,7 @@ void createTablet(TabletSharedPtr* tablet, int64_t replica_id, int32_t schema_ha DeltaWriter* delta_writer = nullptr; profile = std::make_unique("LoadChannels"); - DeltaWriter::open(&write_req, &delta_writer, profile.get()); + static_cast(DeltaWriter::open(&write_req, &delta_writer, profile.get())); ASSERT_NE(delta_writer, nullptr); vectorized::Block block; diff --git a/be/test/olap/tablet_meta_manager_test.cpp b/be/test/olap/tablet_meta_manager_test.cpp index 0ba8bcc53d..c56fe35f19 100644 --- a/be/test/olap/tablet_meta_manager_test.cpp +++ b/be/test/olap/tablet_meta_manager_test.cpp @@ -140,7 +140,8 @@ TEST_F(TabletMetaManagerTest, TestSaveDeleteBimap) { int64_t max_version = 300; gen1(max_rst_id, max_seg_id, 10); for (int64_t ver = 0; ver < max_version; ++ver) { - TabletMetaManager::save_delete_bitmap(_data_dir, test_tablet_id, dbmp, ver); + static_cast( + TabletMetaManager::save_delete_bitmap(_data_dir, test_tablet_id, dbmp, ver)); } size_t num_keys = 0; auto load_delete_bitmap_func = [&](int64_t tablet_id, int64_t version, const string& val) { @@ -160,22 +161,29 @@ TEST_F(TabletMetaManagerTest, TestSaveDeleteBimap) { ++num_keys; return true; }; - TabletMetaManager::traverse_delete_bitmap(_data_dir->get_meta(), load_delete_bitmap_func); + static_cast(TabletMetaManager::traverse_delete_bitmap(_data_dir->get_meta(), + load_delete_bitmap_func)); EXPECT_EQ(num_keys, max_version); num_keys = 0; - TabletMetaManager::remove_old_version_delete_bitmap(_data_dir, test_tablet_id, 100); - TabletMetaManager::traverse_delete_bitmap(_data_dir->get_meta(), load_delete_bitmap_func); + static_cast( + TabletMetaManager::remove_old_version_delete_bitmap(_data_dir, test_tablet_id, 100)); + static_cast(TabletMetaManager::traverse_delete_bitmap(_data_dir->get_meta(), + load_delete_bitmap_func)); EXPECT_EQ(num_keys, max_version - 101); num_keys = 0; - TabletMetaManager::remove_old_version_delete_bitmap(_data_dir, test_tablet_id, 200); - TabletMetaManager::traverse_delete_bitmap(_data_dir->get_meta(), load_delete_bitmap_func); + static_cast( + TabletMetaManager::remove_old_version_delete_bitmap(_data_dir, test_tablet_id, 200)); + static_cast(TabletMetaManager::traverse_delete_bitmap(_data_dir->get_meta(), + load_delete_bitmap_func)); EXPECT_EQ(num_keys, max_version - 201); num_keys = 0; - TabletMetaManager::remove_old_version_delete_bitmap(_data_dir, test_tablet_id, INT64_MAX); - TabletMetaManager::traverse_delete_bitmap(_data_dir->get_meta(), load_delete_bitmap_func); + static_cast(TabletMetaManager::remove_old_version_delete_bitmap(_data_dir, test_tablet_id, + INT64_MAX)); + static_cast(TabletMetaManager::traverse_delete_bitmap(_data_dir->get_meta(), + load_delete_bitmap_func)); EXPECT_EQ(num_keys, 0); } diff --git a/be/test/olap/tablet_meta_test.cpp b/be/test/olap/tablet_meta_test.cpp index 7d57765ca5..b85c63ef71 100644 --- a/be/test/olap/tablet_meta_test.cpp +++ b/be/test/olap/tablet_meta_test.cpp @@ -44,7 +44,7 @@ TEST(TabletMetaTest, SaveAndParse) { new_tablet_meta._preferred_rowset_type = BETA_ROWSET; } TabletMeta new_tablet_meta; - new_tablet_meta.create_from_file(meta_path); + static_cast(new_tablet_meta.create_from_file(meta_path)); EXPECT_EQ(old_tablet_meta, new_tablet_meta); } @@ -67,9 +67,9 @@ TEST(TabletMetaTest, TestReviseMeta) { meta_ptr->init_from_pb(rs_meta_pb); RowsetSharedPtr rowset_ptr; TabletSchemaSPtr schema = std::make_shared(); - MockRowset::create_rowset(schema, meta_ptr, &rowset_ptr, false); + static_cast(MockRowset::create_rowset(schema, meta_ptr, &rowset_ptr, false)); src_rowsets.push_back(rowset_ptr); - tablet_meta.add_rs_meta(rowset_ptr->rowset_meta()); + static_cast(tablet_meta.add_rs_meta(rowset_ptr->rowset_meta())); } ASSERT_EQ(4, tablet_meta.all_rs_metas().size()); diff --git a/be/test/olap/tablet_mgr_test.cpp b/be/test/olap/tablet_mgr_test.cpp index a9a4bb940d..4d20382581 100644 --- a/be/test/olap/tablet_mgr_test.cpp +++ b/be/test/olap/tablet_mgr_test.cpp @@ -69,7 +69,7 @@ public: k_engine = new StorageEngine(options); ExecEnv::GetInstance()->set_storage_engine(k_engine); _data_dir = new DataDir(_engine_data_path, 1000000000); - _data_dir->init(); + static_cast(_data_dir->init()); _tablet_mgr = k_engine->tablet_manager(); } diff --git a/be/test/olap/tablet_test.cpp b/be/test/olap/tablet_test.cpp index 3fc32d3b3d..81e952a1c7 100644 --- a/be/test/olap/tablet_test.cpp +++ b/be/test/olap/tablet_test.cpp @@ -83,7 +83,7 @@ public: ->create_directory(absolute_dir + "/tablet_path") .ok()); _data_dir = std::make_unique(absolute_dir); - _data_dir->update_capacity(); + static_cast(_data_dir->update_capacity()); doris::EngineOptions options; k_engine = new StorageEngine(options); @@ -236,11 +236,11 @@ TEST_F(TestTablet, delete_expired_stale_rowset) { fetch_expired_row_rs_meta(&expired_rs_metas); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr)); - _tablet->init(); + static_cast(_tablet->init()); for (auto ptr : expired_rs_metas) { for (auto rs : *ptr) { @@ -272,12 +272,12 @@ TEST_F(TestTablet, pad_rowset) { RowsetSharedPtr rowset3 = make_shared(nullptr, "", ptr3); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } - _data_dir->init(); + static_cast(_data_dir->init()); TabletSharedPtr _tablet(new Tablet(_tablet_meta, _data_dir.get())); - _tablet->init(); + static_cast(_tablet->init()); Version version(5, 5); std::vector splits; @@ -285,7 +285,7 @@ TEST_F(TestTablet, pad_rowset) { splits.clear(); PadRowsetAction action(nullptr, TPrivilegeHier::GLOBAL, TPrivilegeType::ADMIN); - action._pad_rowset(_tablet, version); + static_cast(action._pad_rowset(_tablet, version)); ASSERT_TRUE(_tablet->capture_rs_readers(version, &splits).ok()); } @@ -317,11 +317,11 @@ TEST_F(TestTablet, cooldown_policy) { RowsetSharedPtr rowset5 = make_shared(nullptr, "", ptr5); for (auto& rowset : rs_metas) { - _tablet_meta->add_rs_meta(rowset); + static_cast(_tablet_meta->add_rs_meta(rowset)); } TabletSharedPtr _tablet(new Tablet(_tablet_meta, nullptr)); - _tablet->init(); + static_cast(_tablet->init()); constexpr int64_t storage_policy_id = 10000; _tablet->set_storage_policy_id(storage_policy_id); diff --git a/be/test/olap/timestamped_version_tracker_test.cpp b/be/test/olap/timestamped_version_tracker_test.cpp index 937519d1db..16c31e57d2 100644 --- a/be/test/olap/timestamped_version_tracker_test.cpp +++ b/be/test/olap/timestamped_version_tracker_test.cpp @@ -305,7 +305,7 @@ TEST_F(TestTimestampedVersionTracker, delete_version_from_graph) { Version version0(0, 0); version_graph.add_version_to_graph(version0); - version_graph.delete_version_from_graph(version0); + static_cast(version_graph.delete_version_from_graph(version0)); EXPECT_EQ(2, version_graph._version_graph.size()); EXPECT_EQ(0, version_graph._version_graph[0].edges.size()); @@ -320,7 +320,7 @@ TEST_F(TestTimestampedVersionTracker, delete_version_from_graph_with_same_versio version_graph.add_version_to_graph(version0); version_graph.add_version_to_graph(version1); - version_graph.delete_version_from_graph(version0); + static_cast(version_graph.delete_version_from_graph(version0)); EXPECT_EQ(2, version_graph._version_graph.size()); EXPECT_EQ(1, version_graph._version_graph[0].edges.size()); @@ -368,7 +368,7 @@ TEST_F(TestTimestampedVersionTracker, capture_consistent_versions) { version_graph.construct_version_graph(rs_metas, &max_version); Version spec_version(0, 8); - version_graph.capture_consistent_versions(spec_version, &version_path); + static_cast(version_graph.capture_consistent_versions(spec_version, &version_path)); EXPECT_EQ(4, version_path.size()); EXPECT_EQ(Version(0, 0), version_path[0]); @@ -392,7 +392,7 @@ TEST_F(TestTimestampedVersionTracker, capture_consistent_versions_with_same_rows version_graph.construct_version_graph(rs_metas, &max_version); Version spec_version(0, 8); - version_graph.capture_consistent_versions(spec_version, &version_path); + static_cast(version_graph.capture_consistent_versions(spec_version, &version_path)); EXPECT_EQ(4, version_path.size()); EXPECT_EQ(Version(0, 0), version_path[0]); @@ -549,7 +549,7 @@ TEST_F(TestTimestampedVersionTracker, capture_consistent_versions_tracker) { } Version spec_version(0, 8); - tracker.capture_consistent_versions(spec_version, &version_path); + static_cast(tracker.capture_consistent_versions(spec_version, &version_path)); EXPECT_EQ(4, version_path.size()); EXPECT_EQ(Version(0, 0), version_path[0]); @@ -576,7 +576,7 @@ TEST_F(TestTimestampedVersionTracker, capture_consistent_versions_tracker_with_s } Version spec_version(0, 8); - tracker.capture_consistent_versions(spec_version, &version_path); + static_cast(tracker.capture_consistent_versions(spec_version, &version_path)); EXPECT_EQ(4, version_path.size()); EXPECT_EQ(Version(0, 0), version_path[0]); @@ -802,8 +802,8 @@ TEST_F(TestTimestampedVersionTracker, get_version_graph_orphan_vertex_ratio) { version_graph.add_version_to_graph(version1); version_graph.add_version_to_graph(version2); version_graph.add_version_to_graph(version3); - version_graph.delete_version_from_graph(version2); - version_graph.delete_version_from_graph(version3); + static_cast(version_graph.delete_version_from_graph(version2)); + static_cast(version_graph.delete_version_from_graph(version3)); EXPECT_EQ(5, version_graph._version_graph.size()); EXPECT_EQ(0.4, version_graph.get_orphan_vertex_ratio()); diff --git a/be/test/olap/txn_manager_test.cpp b/be/test/olap/txn_manager_test.cpp index fe05e206c7..d7f4520794 100644 --- a/be/test/olap/txn_manager_test.cpp +++ b/be/test/olap/txn_manager_test.cpp @@ -196,8 +196,8 @@ TEST_F(TxnManagerTest, PrepareNewTxn) { TEST_F(TxnManagerTest, CommitTxnWithPrepare) { Status status = _txn_mgr->prepare_txn(partition_id, transaction_id, tablet_id, _tablet_uid, load_id); - _txn_mgr->commit_txn(_meta, partition_id, transaction_id, tablet_id, _tablet_uid, load_id, - _rowset, false); + static_cast(_txn_mgr->commit_txn(_meta, partition_id, transaction_id, tablet_id, + _tablet_uid, load_id, _rowset, false)); EXPECT_TRUE(status == Status::OK()); RowsetMetaSharedPtr rowset_meta(new RowsetMeta()); status = RowsetMetaManager::get_rowset_meta(_meta, _tablet_uid, _rowset->rowset_id(), diff --git a/be/test/olap/wal_manager_test.cpp b/be/test/olap/wal_manager_test.cpp index c2a0ae6fe6..e9527043f3 100644 --- a/be/test/olap/wal_manager_test.cpp +++ b/be/test/olap/wal_manager_test.cpp @@ -68,18 +68,18 @@ public: k_stream_load_plan_status = Status::OK(); } void TearDown() override { - io::global_local_filesystem()->delete_directory(wal_dir); + static_cast(io::global_local_filesystem()->delete_directory(wal_dir)); SAFE_DELETE(_env->_function_client_cache); SAFE_DELETE(_env->_internal_client_cache); SAFE_DELETE(_env->_master_info); } - void prepare() { io::global_local_filesystem()->create_directory(wal_dir); } + void prepare() { static_cast(io::global_local_filesystem()->create_directory(wal_dir)); } void createWal(const std::string& wal_path) { auto wal_writer = WalWriter(wal_path); - wal_writer.init(); - wal_writer.finalize(); + static_cast(wal_writer.init()); + static_cast(wal_writer.finalize()); } }; @@ -107,7 +107,7 @@ TEST_F(WalManagerTest, recovery_normal) { std::string wal_201 = wal_dir + "/" + db_id + "/" + tb_2_id + "/" + wal_201_id; createWal(wal_200); createWal(wal_201); - _env->wal_mgr()->init(); + static_cast(_env->wal_mgr()->init()); while (_env->wal_mgr()->get_wal_table_size(tb_1_id) > 0 || _env->wal_mgr()->get_wal_table_size(tb_2_id) > 0) { @@ -129,7 +129,7 @@ TEST_F(WalManagerTest, not_need_recovery) { std::string wal_100 = wal_dir + "/" + db_id + "/" + tb_id + "/" + wal_id; createWal(wal_100); - _env->wal_mgr()->init(); + static_cast(_env->wal_mgr()->init()); while (_env->wal_mgr()->get_wal_table_size("1") > 0) { sleep(1); @@ -151,7 +151,7 @@ TEST_F(WalManagerTest, recover_fail) { std::string wal_100 = wal_dir + "/" + db_id + "/" + tb_id + "/" + wal_id; createWal(wal_100); - _env->wal_mgr()->init(); + static_cast(_env->wal_mgr()->init()); while (_env->wal_mgr()->get_wal_table_size("1") > 0) { sleep(1); diff --git a/be/test/olap/wal_reader_writer_test.cpp b/be/test/olap/wal_reader_writer_test.cpp index 070f2b8942..71c822013a 100644 --- a/be/test/olap/wal_reader_writer_test.cpp +++ b/be/test/olap/wal_reader_writer_test.cpp @@ -44,10 +44,14 @@ namespace doris { class WalReaderWriterTest : public testing::Test { public: // create a mock cgroup folder - virtual void SetUp() { io::global_local_filesystem()->create_directory(_s_test_data_path); } + virtual void SetUp() { + static_cast(io::global_local_filesystem()->create_directory(_s_test_data_path)); + } // delete the mock cgroup folder - virtual void TearDown() { io::global_local_filesystem()->delete_directory(_s_test_data_path); } + virtual void TearDown() { + static_cast(io::global_local_filesystem()->delete_directory(_s_test_data_path)); + } static std::string _s_test_data_path; }; @@ -86,7 +90,7 @@ void generate_block(PBlock& pblock, int row_index) { TEST_F(WalReaderWriterTest, TestWriteAndRead1) { std::string file_name = _s_test_data_path + "/abcd123.txt"; auto wal_writer = WalWriter(file_name); - wal_writer.init(); + static_cast(wal_writer.init()); size_t file_len = 0; int64_t file_size = -1; // add 1 block @@ -96,7 +100,7 @@ TEST_F(WalReaderWriterTest, TestWriteAndRead1) { EXPECT_EQ(Status::OK(), wal_writer.append_blocks(std::vector {&pblock})); file_len += pblock.ByteSizeLong() + WalWriter::LENGTH_SIZE + WalWriter::CHECKSUM_SIZE; - io::global_local_filesystem()->file_size(file_name, &file_size); + EXPECT_TRUE(io::global_local_filesystem()->file_size(file_name, &file_size).ok()); EXPECT_EQ(file_len, file_size); } // add 2 block @@ -110,13 +114,13 @@ TEST_F(WalReaderWriterTest, TestWriteAndRead1) { file_len += pblock1.ByteSizeLong() + WalWriter::LENGTH_SIZE + WalWriter::CHECKSUM_SIZE; EXPECT_EQ(Status::OK(), wal_writer.append_blocks(std::vector {&pblock, &pblock1})); - io::global_local_filesystem()->file_size(file_name, &file_size); + EXPECT_TRUE(io::global_local_filesystem()->file_size(file_name, &file_size).ok()); EXPECT_EQ(file_len, file_size); } - wal_writer.finalize(); + static_cast(wal_writer.finalize()); // read block auto wal_reader = WalReader(file_name); - wal_reader.init(); + static_cast(wal_reader.init()); auto block_count = 0; while (true) { doris::PBlock pblock; @@ -128,10 +132,10 @@ TEST_F(WalReaderWriterTest, TestWriteAndRead1) { break; } vectorized::Block block; - block.deserialize(pblock); + EXPECT_TRUE(block.deserialize(pblock).ok()); EXPECT_EQ(block_rows, block.rows()); } - wal_reader.finalize(); + static_cast(wal_reader.finalize()); EXPECT_EQ(3, block_count); } } // namespace doris \ No newline at end of file diff --git a/be/test/runtime/load_stream_test.cpp b/be/test/runtime/load_stream_test.cpp index f3c9b55cd7..f9af893858 100644 --- a/be/test/runtime/load_stream_test.cpp +++ b/be/test/runtime/load_stream_test.cpp @@ -133,7 +133,7 @@ void construct_schema(OlapTableSchemaParam* schema) { tschema.indexes[1].id = NORMAL_INDEX_ID + 1; tschema.indexes[1].columns = {"c1", "c2", "c3"}; - schema->init(tschema); + static_cast(schema->init(tschema)); } // copied from delta_writer_test.cpp @@ -506,7 +506,7 @@ public: size_t hdr_len = header.ByteSizeLong(); append_buf.append((char*)&hdr_len, sizeof(size_t)); append_buf.append(header.SerializeAsString()); - client.send(&append_buf); + static_cast(client.send(&append_buf)); } void write_one_tablet(MockSinkClient& client, UniqueId load_id, uint32_t sender_id, @@ -531,7 +531,7 @@ public: append_buf.append((char*)&data_len, sizeof(size_t)); append_buf.append(data); LOG(INFO) << "send " << header.DebugString() << data; - client.send(&append_buf); + static_cast(client.send(&append_buf)); } void write_abnormal_load(MockSinkClient& client) { @@ -590,7 +590,7 @@ public: EXPECT_TRUE(io::global_local_filesystem()->create_directory(zTestDir).ok()); - k_engine->start_bg_threads(); + static_cast(k_engine->start_bg_threads()); _load_stream_mgr = std::make_unique(4, &_heavy_work_pool, &_light_work_pool); _stream_service = new StreamService(_load_stream_mgr.get()); diff --git a/be/test/testutil/run_all_tests.cpp b/be/test/testutil/run_all_tests.cpp index bf496c35d9..6dd65bf2ec 100644 --- a/be/test/testutil/run_all_tests.cpp +++ b/be/test/testutil/run_all_tests.cpp @@ -60,7 +60,7 @@ int main(int argc, char** argv) { doris::BackendOptions::init(); auto service = std::make_unique(doris::ExecEnv::GetInstance(), 0, 1); - service->start(); + static_cast(service->start()); doris::global_test_http_host = "http://127.0.0.1:" + std::to_string(service->get_real_port()); int res = RUN_ALL_TESTS(); diff --git a/be/test/util/key_util_test.cpp b/be/test/util/key_util_test.cpp index 9e50033318..dd4a987c68 100644 --- a/be/test/util/key_util_test.cpp +++ b/be/test/util/key_util_test.cpp @@ -52,7 +52,7 @@ TEST_F(KeyUtilTest, encode) { // test encoding with padding { RowCursor row; - row.init(tablet_schema, 2); + static_cast(row.init(tablet_schema, 2)); { // test padding diff --git a/be/test/util/threadpool_test.cpp b/be/test/util/threadpool_test.cpp index 83593d9f9e..124a1749a0 100644 --- a/be/test/util/threadpool_test.cpp +++ b/be/test/util/threadpool_test.cpp @@ -776,17 +776,17 @@ static void MyFunc(int idx, int n) { TEST_F(ThreadPoolTest, TestNormal) { std::unique_ptr thread_pool; - ThreadPoolBuilder("my_pool") - .set_min_threads(0) - .set_max_threads(5) - .set_max_queue_size(10) - .set_idle_timeout(std::chrono::milliseconds(2000)) - .build(&thread_pool); + static_cast(ThreadPoolBuilder("my_pool") + .set_min_threads(0) + .set_max_threads(5) + .set_max_queue_size(10) + .set_idle_timeout(std::chrono::milliseconds(2000)) + .build(&thread_pool)); std::unique_ptr token1 = thread_pool->new_token(ThreadPool::ExecutionMode::CONCURRENT, 2); for (int i = 0; i < 10; i++) { - token1->submit_func(std::bind(&MyFunc, i, 1)); + static_cast(token1->submit_func(std::bind(&MyFunc, i, 1))); } token1->wait(); EXPECT_EQ(0, token1->num_tasks()); @@ -794,7 +794,7 @@ TEST_F(ThreadPoolTest, TestNormal) { std::unique_ptr token2 = thread_pool->new_token(ThreadPool::ExecutionMode::CONCURRENT, 20); for (int i = 0; i < 10; i++) { - token2->submit_func(std::bind(&MyFunc, i, 1)); + static_cast(token2->submit_func(std::bind(&MyFunc, i, 1))); } token2->wait(); EXPECT_EQ(0, token2->num_tasks()); @@ -802,7 +802,7 @@ TEST_F(ThreadPoolTest, TestNormal) { std::unique_ptr token3 = thread_pool->new_token(ThreadPool::ExecutionMode::CONCURRENT, 1); for (int i = 0; i < 10; i++) { - token3->submit_func(std::bind(&MyFunc, i, 1)); + static_cast(token3->submit_func(std::bind(&MyFunc, i, 1))); } token3->wait(); EXPECT_EQ(0, token3->num_tasks()); @@ -810,7 +810,7 @@ TEST_F(ThreadPoolTest, TestNormal) { std::unique_ptr token4 = thread_pool->new_token(ThreadPool::ExecutionMode::SERIAL); for (int i = 0; i < 10; i++) { - token4->submit_func(std::bind(&MyFunc, i, 1)); + static_cast(token4->submit_func(std::bind(&MyFunc, i, 1))); } token4->wait(); EXPECT_EQ(0, token4->num_tasks()); @@ -818,7 +818,7 @@ TEST_F(ThreadPoolTest, TestNormal) { std::unique_ptr token5 = thread_pool->new_token(ThreadPool::ExecutionMode::CONCURRENT, 20); for (int i = 0; i < 10; i++) { - token5->submit_func(std::bind(&MyFunc, i, 1)); + static_cast(token5->submit_func(std::bind(&MyFunc, i, 1))); } token5->shutdown(); EXPECT_EQ(0, token5->num_tasks()); @@ -905,21 +905,21 @@ TEST_F(ThreadPoolTest, TestThreadPoolDynamicAdjustMaximumMinimum) { TEST_F(ThreadPoolTest, TestThreadTokenSerial) { std::unique_ptr thread_pool; - ThreadPoolBuilder("my_pool") - .set_min_threads(0) - .set_max_threads(1) - .set_max_queue_size(10) - .set_idle_timeout(std::chrono::milliseconds(2000)) - .build(&thread_pool); + static_cast(ThreadPoolBuilder("my_pool") + .set_min_threads(0) + .set_max_threads(1) + .set_max_queue_size(10) + .set_idle_timeout(std::chrono::milliseconds(2000)) + .build(&thread_pool)); std::unique_ptr token1 = thread_pool->new_token(ThreadPool::ExecutionMode::SERIAL, 2); - token1->submit_func(std::bind(&MyFunc, 0, 1)); + static_cast(token1->submit_func(std::bind(&MyFunc, 0, 1))); std::cout << "after submit 1" << std::endl; token1->wait(); ASSERT_EQ(0, token1->num_tasks()); for (int i = 0; i < 10; i++) { - token1->submit_func(std::bind(&MyFunc, i, 1)); + static_cast(token1->submit_func(std::bind(&MyFunc, i, 1))); } std::cout << "after submit 1" << std::endl; token1->wait(); @@ -928,17 +928,17 @@ TEST_F(ThreadPoolTest, TestThreadTokenSerial) { TEST_F(ThreadPoolTest, TestThreadTokenConcurrent) { std::unique_ptr thread_pool; - ThreadPoolBuilder("my_pool") - .set_min_threads(0) - .set_max_threads(1) - .set_max_queue_size(10) - .set_idle_timeout(std::chrono::milliseconds(2000)) - .build(&thread_pool); + static_cast(ThreadPoolBuilder("my_pool") + .set_min_threads(0) + .set_max_threads(1) + .set_max_queue_size(10) + .set_idle_timeout(std::chrono::milliseconds(2000)) + .build(&thread_pool)); std::unique_ptr token1 = thread_pool->new_token(ThreadPool::ExecutionMode::CONCURRENT, 2); for (int i = 0; i < 10; i++) { - token1->submit_func(std::bind(&MyFunc, i, 1)); + static_cast(token1->submit_func(std::bind(&MyFunc, i, 1))); } std::cout << "after submit 1" << std::endl; token1->wait(); diff --git a/be/test/vec/core/block_spill_test.cpp b/be/test/vec/core/block_spill_test.cpp index e59ef83287..7b98b1c81f 100644 --- a/be/test/vec/core/block_spill_test.cpp +++ b/be/test/vec/core/block_spill_test.cpp @@ -75,16 +75,17 @@ public: EXPECT_NE(getcwd(buffer, MAX_PATH_LEN), nullptr); test_data_dir = std::string(buffer) + "/" + TMP_DATA_DIR; std::cout << "test data dir: " << test_data_dir << "\n"; - io::global_local_filesystem()->delete_and_create_directory(test_data_dir); + static_cast( + io::global_local_filesystem()->delete_and_create_directory(test_data_dir)); std::vector paths; paths.emplace_back(test_data_dir, -1); block_spill_manager = std::make_shared(paths); - block_spill_manager->init(); + static_cast(block_spill_manager->init()); } static void TearDownTestSuite() { - io::global_local_filesystem()->delete_directory(test_data_dir); + static_cast(io::global_local_filesystem()->delete_directory(test_data_dir)); } protected: @@ -124,19 +125,20 @@ TEST_F(TestBlockSpill, TestInt) { vectorized::Block block2({type_and_name2}); vectorized::BlockSpillWriterUPtr spill_block_writer; - block_spill_manager->get_writer(batch_size, spill_block_writer, profile_); - spill_block_writer->write(block1); - spill_block_writer->write(block2); - spill_block_writer->close(); + static_cast(block_spill_manager->get_writer(batch_size, spill_block_writer, profile_)); + static_cast(spill_block_writer->write(block1)); + static_cast(spill_block_writer->write(block2)); + static_cast(spill_block_writer->close()); vectorized::BlockSpillReaderUPtr spill_block_reader; - block_spill_manager->get_reader(spill_block_writer->get_id(), spill_block_reader, profile_); + static_cast(block_spill_manager->get_reader(spill_block_writer->get_id(), + spill_block_reader, profile_)); vectorized::Block block_read; bool eos = false; for (int i = 0; i < batch_num; ++i) { - spill_block_reader->read(&block_read, &eos); + static_cast(spill_block_reader->read(&block_read, &eos)); EXPECT_EQ(block_read.rows(), batch_size); auto column = block_read.get_by_position(0).column; auto* real_column = (vectorized::ColumnVector*)column.get(); @@ -145,8 +147,8 @@ TEST_F(TestBlockSpill, TestInt) { } } - spill_block_reader->read(&block_read, &eos); - spill_block_reader->close(); + static_cast(spill_block_reader->read(&block_read, &eos)); + static_cast(spill_block_reader->close()); EXPECT_EQ(block_read.rows(), 1); auto column = block_read.get_by_position(0).column; @@ -174,18 +176,19 @@ TEST_F(TestBlockSpill, TestIntNullable) { vectorized::Block block({type_and_name}); vectorized::BlockSpillWriterUPtr spill_block_writer; - block_spill_manager->get_writer(batch_size, spill_block_writer, profile_); - spill_block_writer->write(block); - spill_block_writer->close(); + static_cast(block_spill_manager->get_writer(batch_size, spill_block_writer, profile_)); + static_cast(spill_block_writer->write(block)); + static_cast(spill_block_writer->close()); vectorized::BlockSpillReaderUPtr spill_block_reader; - block_spill_manager->get_reader(spill_block_writer->get_id(), spill_block_reader, profile_); + static_cast(block_spill_manager->get_reader(spill_block_writer->get_id(), + spill_block_reader, profile_)); vectorized::Block block_read; bool eos = false; for (int i = 0; i < batch_num; ++i) { - spill_block_reader->read(&block_read, &eos); + static_cast(spill_block_reader->read(&block_read, &eos)); EXPECT_EQ(block_read.rows(), batch_size); auto column = block_read.get_by_position(0).column; @@ -201,8 +204,8 @@ TEST_F(TestBlockSpill, TestIntNullable) { } } - spill_block_reader->read(&block_read, &eos); - spill_block_reader->close(); + static_cast(spill_block_reader->read(&block_read, &eos)); + static_cast(spill_block_reader->close()); EXPECT_EQ(block_read.rows(), 1); auto column = block_read.get_by_position(0).column; @@ -226,13 +229,14 @@ TEST_F(TestBlockSpill, TestString) { vectorized::Block block({test_string}); vectorized::BlockSpillWriterUPtr spill_block_writer; - block_spill_manager->get_writer(batch_size, spill_block_writer, profile_); + static_cast(block_spill_manager->get_writer(batch_size, spill_block_writer, profile_)); Status st = spill_block_writer->write(block); - spill_block_writer->close(); + static_cast(spill_block_writer->close()); EXPECT_TRUE(st.ok()); vectorized::BlockSpillReaderUPtr spill_block_reader; - block_spill_manager->get_reader(spill_block_writer->get_id(), spill_block_reader, profile_); + static_cast(block_spill_manager->get_reader(spill_block_writer->get_id(), + spill_block_reader, profile_)); vectorized::Block block_read; bool eos = false; @@ -249,8 +253,8 @@ TEST_F(TestBlockSpill, TestString) { } } - spill_block_reader->read(&block_read, &eos); - spill_block_reader->close(); + static_cast(spill_block_reader->read(&block_read, &eos)); + static_cast(spill_block_reader->close()); EXPECT_EQ(block_read.rows(), 1); auto column = block_read.get_by_position(0).column; @@ -278,13 +282,14 @@ TEST_F(TestBlockSpill, TestStringNullable) { vectorized::Block block({type_and_name}); vectorized::BlockSpillWriterUPtr spill_block_writer; - block_spill_manager->get_writer(batch_size, spill_block_writer, profile_); + static_cast(block_spill_manager->get_writer(batch_size, spill_block_writer, profile_)); Status st = spill_block_writer->write(block); - spill_block_writer->close(); + static_cast(spill_block_writer->close()); EXPECT_TRUE(st.ok()); vectorized::BlockSpillReaderUPtr spill_block_reader; - block_spill_manager->get_reader(spill_block_writer->get_id(), spill_block_reader, profile_); + static_cast(block_spill_manager->get_reader(spill_block_writer->get_id(), + spill_block_reader, profile_)); vectorized::Block block_read; bool eos = false; @@ -309,7 +314,7 @@ TEST_F(TestBlockSpill, TestStringNullable) { } st = spill_block_reader->read(&block_read, &eos); - spill_block_reader->close(); + static_cast(spill_block_reader->close()); EXPECT_TRUE(st.ok()); EXPECT_EQ(block_read.rows(), 1); @@ -337,13 +342,14 @@ TEST_F(TestBlockSpill, TestDecimal) { vectorized::Block block({test_decimal}); vectorized::BlockSpillWriterUPtr spill_block_writer; - block_spill_manager->get_writer(batch_size, spill_block_writer, profile_); + static_cast(block_spill_manager->get_writer(batch_size, spill_block_writer, profile_)); auto st = spill_block_writer->write(block); - spill_block_writer->close(); + static_cast(spill_block_writer->close()); EXPECT_TRUE(st.ok()); vectorized::BlockSpillReaderUPtr spill_block_reader; - block_spill_manager->get_reader(spill_block_writer->get_id(), spill_block_reader, profile_); + static_cast(block_spill_manager->get_reader(spill_block_writer->get_id(), + spill_block_reader, profile_)); vectorized::Block block_read; bool eos = false; @@ -363,7 +369,7 @@ TEST_F(TestBlockSpill, TestDecimal) { } st = spill_block_reader->read(&block_read, &eos); - spill_block_reader->close(); + static_cast(spill_block_reader->close()); EXPECT_TRUE(st.ok()); EXPECT_EQ(block_read.rows(), 1); @@ -394,13 +400,14 @@ TEST_F(TestBlockSpill, TestDecimalNullable) { vectorized::Block block({type_and_name}); vectorized::BlockSpillWriterUPtr spill_block_writer; - block_spill_manager->get_writer(batch_size, spill_block_writer, profile_); + static_cast(block_spill_manager->get_writer(batch_size, spill_block_writer, profile_)); auto st = spill_block_writer->write(block); - spill_block_writer->close(); + static_cast(spill_block_writer->close()); EXPECT_TRUE(st.ok()); vectorized::BlockSpillReaderUPtr spill_block_reader; - block_spill_manager->get_reader(spill_block_writer->get_id(), spill_block_reader, profile_); + static_cast(block_spill_manager->get_reader(spill_block_writer->get_id(), + spill_block_reader, profile_)); vectorized::Block block_read; bool eos = false; @@ -425,7 +432,7 @@ TEST_F(TestBlockSpill, TestDecimalNullable) { } st = spill_block_reader->read(&block_read, &eos); - spill_block_reader->close(); + static_cast(spill_block_reader->close()); EXPECT_TRUE(st.ok()); EXPECT_EQ(block_read.rows(), 1); @@ -460,13 +467,14 @@ TEST_F(TestBlockSpill, TestBitmap) { vectorized::Block block({type_and_name}); vectorized::BlockSpillWriterUPtr spill_block_writer; - block_spill_manager->get_writer(batch_size, spill_block_writer, profile_); + static_cast(block_spill_manager->get_writer(batch_size, spill_block_writer, profile_)); auto st = spill_block_writer->write(block); - spill_block_writer->close(); + static_cast(spill_block_writer->close()); EXPECT_TRUE(st.ok()); vectorized::BlockSpillReaderUPtr spill_block_reader; - block_spill_manager->get_reader(spill_block_writer->get_id(), spill_block_reader, profile_); + static_cast(block_spill_manager->get_reader(spill_block_writer->get_id(), + spill_block_reader, profile_)); vectorized::Block block_read; bool eos = false; @@ -485,7 +493,7 @@ TEST_F(TestBlockSpill, TestBitmap) { } st = spill_block_reader->read(&block_read, &eos); - spill_block_reader->close(); + static_cast(spill_block_reader->close()); EXPECT_TRUE(st.ok()); EXPECT_EQ(block_read.rows(), 1); diff --git a/be/test/vec/core/block_test.cpp b/be/test/vec/core/block_test.cpp index 61903e588f..7d4896da21 100644 --- a/be/test/vec/core/block_test.cpp +++ b/be/test/vec/core/block_test.cpp @@ -130,7 +130,7 @@ void serialize_and_deserialize_test(segment_v2::CompressionTypePB compression_ty std::string s1 = pblock.DebugString(); vectorized::Block block2; - block2.deserialize(pblock); + static_cast(block2.deserialize(pblock)); PBlock pblock2; block_to_pb(block2, &pblock2, compression_type); std::string s2 = pblock2.DebugString(); @@ -152,7 +152,7 @@ void serialize_and_deserialize_test(segment_v2::CompressionTypePB compression_ty std::string s1 = pblock.DebugString(); vectorized::Block block2; - block2.deserialize(pblock); + static_cast(block2.deserialize(pblock)); PBlock pblock2; block_to_pb(block2, &pblock2, compression_type); std::string s2 = pblock2.DebugString(); @@ -177,7 +177,7 @@ void serialize_and_deserialize_test(segment_v2::CompressionTypePB compression_ty std::string s1 = pblock.DebugString(); vectorized::Block block2; - block2.deserialize(pblock); + static_cast(block2.deserialize(pblock)); PBlock pblock2; block_to_pb(block2, &pblock2, compression_type); std::string s2 = pblock2.DebugString(); @@ -204,7 +204,7 @@ void serialize_and_deserialize_test(segment_v2::CompressionTypePB compression_ty std::string s1 = pblock.DebugString(); vectorized::Block block2; - block2.deserialize(pblock); + static_cast(block2.deserialize(pblock)); PBlock pblock2; block_to_pb(block2, &pblock2, compression_type); std::string s2 = pblock2.DebugString(); @@ -225,7 +225,7 @@ void serialize_and_deserialize_test(segment_v2::CompressionTypePB compression_ty std::string s1 = pblock.DebugString(); vectorized::Block block2; - block2.deserialize(pblock); + static_cast(block2.deserialize(pblock)); PBlock pblock2; block_to_pb(block2, &pblock2, compression_type); std::string s2 = pblock2.DebugString(); @@ -248,7 +248,7 @@ void serialize_and_deserialize_test(segment_v2::CompressionTypePB compression_ty std::string s1 = pblock.DebugString(); vectorized::Block block2; - block2.deserialize(pblock); + static_cast(block2.deserialize(pblock)); PBlock pblock2; block_to_pb(block2, &pblock2, compression_type); std::string s2 = pblock2.DebugString(); @@ -271,7 +271,7 @@ void serialize_and_deserialize_test(segment_v2::CompressionTypePB compression_ty std::string s1 = pblock.DebugString(); vectorized::Block block2; - block2.deserialize(pblock); + static_cast(block2.deserialize(pblock)); PBlock pblock2; block_to_pb(block2, &pblock2, compression_type); std::string s2 = pblock2.DebugString(); @@ -287,7 +287,7 @@ void serialize_and_deserialize_test(segment_v2::CompressionTypePB compression_ty std::string s1 = pblock.DebugString(); vectorized::Block block2; - block2.deserialize(pblock); + static_cast(block2.deserialize(pblock)); PBlock pblock2; block_to_pb(block2, &pblock2, compression_type); std::string s2 = pblock2.DebugString(); diff --git a/be/test/vec/data_types/from_string_test.cpp b/be/test/vec/data_types/from_string_test.cpp index 67e2cc0214..bbfb7da92a 100644 --- a/be/test/vec/data_types/from_string_test.cpp +++ b/be/test/vec/data_types/from_string_test.cpp @@ -234,7 +234,7 @@ TEST(FromStringTest, ScalaWrapperFieldVsDataType) { min_wf->set_to_min(); max_wf->set_to_max(); - rand_wf->from_string(pair.second, 0, 0); + static_cast(rand_wf->from_string(pair.second, 0, 0)); string min_s = min_wf->to_string(); string max_s = max_wf->to_string(); @@ -291,7 +291,7 @@ TEST(FromStringTest, ScalaWrapperFieldVsDataType) { std::unique_ptr rand_wf( WrapperField::create_by_type(FieldType::OLAP_FIELD_TYPE_STRING)); std::string test_str = generate(128); - rand_wf->from_string(test_str, 0, 0); + static_cast(rand_wf->from_string(test_str, 0, 0)); Field string_field(test_str); ColumnPtr col = nullable_ptr->create_column_const(0, string_field); EXPECT_EQ(rand_wf->to_string(), nullable_ptr->to_string(*col, 0)); diff --git a/be/test/vec/data_types/serde/data_type_serde_arrow_test.cpp b/be/test/vec/data_types/serde/data_type_serde_arrow_test.cpp index 2bf47ca135..b76ab28514 100644 --- a/be/test/vec/data_types/serde/data_type_serde_arrow_test.cpp +++ b/be/test/vec/data_types/serde/data_type_serde_arrow_test.cpp @@ -464,7 +464,8 @@ void serialize_and_deserialize_arrow_test() { std::cout << "block data: " << block.dump_data(0, row_num) << std::endl; std::cout << "_arrow_schema: " << _arrow_schema->ToString(true) << std::endl; - convert_to_arrow_batch(block, _arrow_schema, arrow::default_memory_pool(), &result); + static_cast( + convert_to_arrow_batch(block, _arrow_schema, arrow::default_memory_pool(), &result)); Block new_block = block.clone_empty(); EXPECT_TRUE(result != nullptr); std::cout << "result: " << result->ToString() << std::endl; @@ -480,8 +481,8 @@ void serialize_and_deserialize_arrow_test() { vectorized::DataTypePtr data_type(std::make_shared()); vectorized::ColumnWithTypeAndName type_and_name(strcol->get_ptr(), data_type, real_column_name); - arrow_column_to_doris_column(array, 0, type_and_name.column, type_and_name.type, - block.rows(), "UTC"); + static_cast(arrow_column_to_doris_column( + array, 0, type_and_name.column, type_and_name.type, block.rows(), "UTC")); { auto& col = column_with_type_and_name.column.get()->assume_mutable_ref(); auto& date_data = static_cast&>(col).get_data(); @@ -499,8 +500,8 @@ void serialize_and_deserialize_arrow_test() { vectorized::DataTypePtr data_type(std::make_shared()); vectorized::ColumnWithTypeAndName type_and_name(strcol->get_ptr(), data_type, real_column_name); - arrow_column_to_doris_column(array, 0, type_and_name.column, type_and_name.type, - block.rows(), "UTC"); + static_cast(arrow_column_to_doris_column( + array, 0, type_and_name.column, type_and_name.type, block.rows(), "UTC")); { auto& col = column_with_type_and_name.column.get()->assume_mutable_ref(); auto& date_data = static_cast&>(col).get_data(); @@ -518,8 +519,9 @@ void serialize_and_deserialize_arrow_test() { new_block.erase(real_column_name); continue; } - arrow_column_to_doris_column(array, 0, column_with_type_and_name.column, - column_with_type_and_name.type, block.rows(), "UTC"); + static_cast(arrow_column_to_doris_column(array, 0, column_with_type_and_name.column, + column_with_type_and_name.type, block.rows(), + "UTC")); } std::cout << block.dump_data() << std::endl; @@ -598,15 +600,17 @@ TEST(DataTypeSerDeArrowTest, DataTypeMapNullKeySerDeTest) { std::cout << "block structure: " << block.dump_structure() << std::endl; std::cout << "_arrow_schema: " << _arrow_schema->ToString(true) << std::endl; - convert_to_arrow_batch(block, _arrow_schema, arrow::default_memory_pool(), &result); + static_cast( + convert_to_arrow_batch(block, _arrow_schema, arrow::default_memory_pool(), &result)); Block new_block = block.clone_empty(); EXPECT_TRUE(result != nullptr); std::cout << "result: " << result->ToString() << std::endl; // deserialize auto* array = result->GetColumnByName(col_name).get(); auto& column_with_type_and_name = new_block.get_by_name(col_name); - arrow_column_to_doris_column(array, 0, column_with_type_and_name.column, - column_with_type_and_name.type, block.rows(), "UTC"); + static_cast(arrow_column_to_doris_column(array, 0, column_with_type_and_name.column, + column_with_type_and_name.type, block.rows(), + "UTC")); std::cout << block.dump_data() << std::endl; std::cout << new_block.dump_data() << std::endl; // new block row_index 0, 2 which row has key null will be filter diff --git a/be/test/vec/data_types/serde/data_type_serde_csv_test.cpp b/be/test/vec/data_types/serde/data_type_serde_csv_test.cpp index a9f5a7b12f..e8aeb9faba 100644 --- a/be/test/vec/data_types/serde/data_type_serde_csv_test.cpp +++ b/be/test/vec/data_types/serde/data_type_serde_csv_test.cpp @@ -195,7 +195,7 @@ TEST(CsvSerde, ScalaDataTypeSerdeCsvTest) { min_wf->set_to_min(); max_wf->set_to_max(); - rand_wf->from_string(pair.second, 0, 0); + EXPECT_EQ(rand_wf->from_string(pair.second, 0, 0).ok(), true); string min_s = min_wf->to_string(); string max_s = max_wf->to_string(); @@ -251,7 +251,7 @@ TEST(CsvSerde, ScalaDataTypeSerdeCsvTest) { std::unique_ptr rand_wf( WrapperField::create_by_type(FieldType::OLAP_FIELD_TYPE_STRING)); std::string test_str = generate(128); - rand_wf->from_string(test_str, 0, 0); + EXPECT_EQ(rand_wf->from_string(test_str, 0, 0).ok(), true); Field string_field(test_str); ColumnPtr col = nullable_ptr->create_column_const(0, string_field); DataTypeSerDe::FormatOptions default_format_option; diff --git a/be/test/vec/data_types/serde/data_type_serde_pb_test.cpp b/be/test/vec/data_types/serde/data_type_serde_pb_test.cpp index 17ba900b68..356b984041 100644 --- a/be/test/vec/data_types/serde/data_type_serde_pb_test.cpp +++ b/be/test/vec/data_types/serde/data_type_serde_pb_test.cpp @@ -53,12 +53,12 @@ namespace doris::vectorized { inline void column_to_pb(const DataTypePtr data_type, const IColumn& col, PValues* result) { const DataTypeSerDeSPtr serde = data_type->get_serde(); - serde->write_column_to_pb(col, *result, 0, col.size()); + static_cast(serde->write_column_to_pb(col, *result, 0, col.size())); } inline void pb_to_column(const DataTypePtr data_type, PValues& result, IColumn& col) { auto serde = data_type->get_serde(); - serde->read_column_from_pb(col, result); + static_cast(serde->read_column_from_pb(col, result)); } inline void check_pb_col(const DataTypePtr data_type, const IColumn& col) { diff --git a/be/test/vec/data_types/serde/data_type_serde_test.cpp b/be/test/vec/data_types/serde/data_type_serde_test.cpp index 4ad0bf4401..c6fc2d42f4 100644 --- a/be/test/vec/data_types/serde/data_type_serde_test.cpp +++ b/be/test/vec/data_types/serde/data_type_serde_test.cpp @@ -54,12 +54,12 @@ namespace doris::vectorized { inline void column_to_pb(const DataTypePtr data_type, const IColumn& col, PValues* result) { const DataTypeSerDeSPtr serde = data_type->get_serde(); - serde->write_column_to_pb(col, *result, 0, col.size()); + static_cast(serde->write_column_to_pb(col, *result, 0, col.size())); } inline void pb_to_column(const DataTypePtr data_type, PValues& result, IColumn& col) { auto serde = data_type->get_serde(); - serde->read_column_from_pb(col, result); + static_cast(serde->read_column_from_pb(col, result)); } inline void check_pb_col(const DataTypePtr data_type, const IColumn& col) { diff --git a/be/test/vec/data_types/serde/data_type_serde_text_test.cpp b/be/test/vec/data_types/serde/data_type_serde_text_test.cpp index 5672164951..2d64e78af7 100644 --- a/be/test/vec/data_types/serde/data_type_serde_text_test.cpp +++ b/be/test/vec/data_types/serde/data_type_serde_text_test.cpp @@ -194,7 +194,7 @@ TEST(TextSerde, ScalaDataTypeSerdeTextTest) { min_wf->set_to_min(); max_wf->set_to_max(); - rand_wf->from_string(pair.second, 0, 0); + static_cast(rand_wf->from_string(pair.second, 0, 0)); string min_s = min_wf->to_string(); string max_s = max_wf->to_string(); @@ -250,7 +250,7 @@ TEST(TextSerde, ScalaDataTypeSerdeTextTest) { std::unique_ptr rand_wf( WrapperField::create_by_type(FieldType::OLAP_FIELD_TYPE_STRING)); std::string test_str = generate(128); - rand_wf->from_string(test_str, 0, 0); + static_cast(rand_wf->from_string(test_str, 0, 0)); Field string_field(test_str); ColumnPtr col = nullable_ptr->create_column_const(0, string_field); DataTypeSerDe::FormatOptions default_format_option; diff --git a/be/test/vec/exec/delta_writer_v2_pool_test.cpp b/be/test/vec/exec/delta_writer_v2_pool_test.cpp index 60c0374785..2cce1dd72f 100644 --- a/be/test/vec/exec/delta_writer_v2_pool_test.cpp +++ b/be/test/vec/exec/delta_writer_v2_pool_test.cpp @@ -59,19 +59,19 @@ TEST_F(DeltaWriterV2PoolTest, test_map) { auto writer = map->get_or_create(100, [&req]() { RuntimeProfile profile("test"); DeltaWriterV2* writer; - DeltaWriterV2::open(&req, {}, &writer, &profile); + static_cast(DeltaWriterV2::open(&req, {}, &writer, &profile)); return writer; }); auto writer2 = map->get_or_create(101, [&req]() { RuntimeProfile profile("test"); DeltaWriterV2* writer; - DeltaWriterV2::open(&req, {}, &writer, &profile); + static_cast(DeltaWriterV2::open(&req, {}, &writer, &profile)); return writer; }); auto writer3 = map->get_or_create(100, [&req]() { RuntimeProfile profile("test"); DeltaWriterV2* writer; - DeltaWriterV2::open(&req, {}, &writer, &profile); + static_cast(DeltaWriterV2::open(&req, {}, &writer, &profile)); return writer; }); EXPECT_EQ(2, map->size()); diff --git a/be/test/vec/exec/parquet/parquet_reader_test.cpp b/be/test/vec/exec/parquet/parquet_reader_test.cpp index 20f4f4150c..2ca5f04f04 100644 --- a/be/test/vec/exec/parquet/parquet_reader_test.cpp +++ b/be/test/vec/exec/parquet/parquet_reader_test.cpp @@ -110,12 +110,13 @@ TEST_F(ParquetReaderTest, normal) { } DescriptorTbl* desc_tbl; ObjectPool obj_pool; - DescriptorTbl::create(&obj_pool, t_desc_table, &desc_tbl); + static_cast(DescriptorTbl::create(&obj_pool, t_desc_table, &desc_tbl)); auto slot_descs = desc_tbl->get_tuple_descriptor(0)->slots(); io::FileSystemSPtr local_fs = io::LocalFileSystem::create(""); io::FileReaderSPtr reader; - local_fs->open_file("./be/test/exec/test_data/parquet_scanner/type-decoder.parquet", &reader); + static_cast(local_fs->open_file( + "./be/test/exec/test_data/parquet_scanner/type-decoder.parquet", &reader)); cctz::time_zone ctz; TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone, ctz); @@ -139,13 +140,13 @@ TEST_F(ParquetReaderTest, normal) { runtime_state.init_mem_trackers(); std::unordered_map colname_to_value_range; - p_reader->open(); - p_reader->init_reader(column_names, missing_column_names, nullptr, {}, nullptr, nullptr, - nullptr, nullptr, nullptr); + static_cast(p_reader->open()); + static_cast(p_reader->init_reader(column_names, missing_column_names, nullptr, {}, + nullptr, nullptr, nullptr, nullptr, nullptr)); std::unordered_map> partition_columns; std::unordered_map missing_columns; - p_reader->set_fill_columns(partition_columns, missing_columns); + static_cast(p_reader->set_fill_columns(partition_columns, missing_columns)); BlockUPtr block = Block::create_unique(); for (const auto& slot_desc : tuple_desc->slots()) { auto data_type = @@ -156,7 +157,7 @@ TEST_F(ParquetReaderTest, normal) { } bool eof = false; size_t read_row = 0; - p_reader->get_next_block(block.get(), &read_row, &eof); + static_cast(p_reader->get_next_block(block.get(), &read_row, &eof)); for (auto& col : block->get_columns_with_type_and_name()) { ASSERT_EQ(col.column->size(), 10); } diff --git a/be/test/vec/exec/parquet/parquet_thrift_test.cpp b/be/test/vec/exec/parquet/parquet_thrift_test.cpp index 06201f6378..be78d46815 100644 --- a/be/test/vec/exec/parquet/parquet_thrift_test.cpp +++ b/be/test/vec/exec/parquet/parquet_thrift_test.cpp @@ -83,7 +83,7 @@ TEST_F(ParquetThriftReaderTest, normal) { FileMetaData* meta_data; size_t meta_size; - parse_thrift_footer(reader, &meta_data, &meta_size, nullptr); + static_cast(parse_thrift_footer(reader, &meta_data, &meta_size, nullptr)); tparquet::FileMetaData t_metadata = meta_data->to_thrift(); LOG(WARNING) << "====================================="; @@ -117,10 +117,10 @@ TEST_F(ParquetThriftReaderTest, complex_nested_file) { FileMetaData* metadata; size_t meta_size; - parse_thrift_footer(reader, &metadata, &meta_size, nullptr); + static_cast(parse_thrift_footer(reader, &metadata, &meta_size, nullptr)); tparquet::FileMetaData t_metadata = metadata->to_thrift(); FieldDescriptor schemaDescriptor; - schemaDescriptor.parse_from_thrift(t_metadata.schema); + static_cast(schemaDescriptor.parse_from_thrift(t_metadata.schema)); // table columns ASSERT_EQ(schemaDescriptor.get_column_index("name"), 0); @@ -195,11 +195,11 @@ static Status get_column_values(io::FileReaderSPtr file_reader, tparquet::Column TimezoneUtils::find_cctz_time_zone(TimezoneUtils::default_time_zone, ctz); ColumnChunkReader chunk_reader(&stream_reader, column_chunk, field_schema, &ctz, nullptr); // initialize chunk reader - chunk_reader.init(); + static_cast(chunk_reader.init()); // seek to next page header - chunk_reader.next_page(); + static_cast(chunk_reader.next_page()); // load page data into underlying container - chunk_reader.load_page_data(); + static_cast(chunk_reader.load_page_data()); int rows = chunk_reader.remaining_num_values(); // definition levels if (field_schema->definition_level == 0) { // required field @@ -391,37 +391,40 @@ static void read_parquet_data_and_check(const std::string& parquet_file, create_block(block); FileMetaData* metadata; size_t meta_size; - parse_thrift_footer(reader, &metadata, &meta_size, nullptr); + static_cast(parse_thrift_footer(reader, &metadata, &meta_size, nullptr)); tparquet::FileMetaData t_metadata = metadata->to_thrift(); FieldDescriptor schema_descriptor; - schema_descriptor.parse_from_thrift(t_metadata.schema); + static_cast(schema_descriptor.parse_from_thrift(t_metadata.schema)); level_t defs[rows]; for (int c = 0; c < 14; ++c) { auto& column_name_with_type = block->get_by_position(c); auto& data_column = column_name_with_type.column; auto& data_type = column_name_with_type.type; - get_column_values(reader, &t_metadata.row_groups[0].columns[c], - const_cast(schema_descriptor.get_column(c)), data_column, - data_type, defs); + static_cast( + get_column_values(reader, &t_metadata.row_groups[0].columns[c], + const_cast(schema_descriptor.get_column(c)), + data_column, data_type, defs)); } // `date_v2_col` date, // 14 - 13, DATEV2 { auto& column_name_with_type = block->get_by_position(14); auto& data_column = column_name_with_type.column; auto& data_type = column_name_with_type.type; - get_column_values(reader, &t_metadata.row_groups[0].columns[13], - const_cast(schema_descriptor.get_column(13)), data_column, - data_type, defs); + static_cast( + get_column_values(reader, &t_metadata.row_groups[0].columns[13], + const_cast(schema_descriptor.get_column(13)), + data_column, data_type, defs)); } // `timestamp_v2_col` timestamp, // 15 - 9, DATETIMEV2 { auto& column_name_with_type = block->get_by_position(15); auto& data_column = column_name_with_type.column; auto& data_type = column_name_with_type.type; - get_column_values(reader, &t_metadata.row_groups[0].columns[9], - const_cast(schema_descriptor.get_column(9)), data_column, - data_type, defs); + static_cast( + get_column_values(reader, &t_metadata.row_groups[0].columns[9], + const_cast(schema_descriptor.get_column(9)), + data_column, data_type, defs)); } io::FileReaderSPtr result; @@ -431,7 +434,7 @@ static void read_parquet_data_and_check(const std::string& parquet_file, result_buf[result->size()] = '\0'; size_t bytes_read; Slice res(result_buf, result->size()); - result->read_at(0, res, &bytes_read); + static_cast(result->read_at(0, res, &bytes_read)); ASSERT_STREQ(block->dump_data(0, rows).c_str(), reinterpret_cast(result_buf)); delete metadata; } @@ -513,7 +516,7 @@ TEST_F(ParquetThriftReaderTest, group_reader) { // prepare metadata FileMetaData* meta_data; size_t meta_size; - parse_thrift_footer(file_reader, &meta_data, &meta_size, nullptr); + static_cast(parse_thrift_footer(file_reader, &meta_data, &meta_size, nullptr)); tparquet::FileMetaData t_metadata = meta_data->to_thrift(); cctz::time_zone ctz; @@ -553,7 +556,7 @@ TEST_F(ParquetThriftReaderTest, group_reader) { result_buf[result->size()] = '\0'; size_t bytes_read; Slice res(result_buf, result->size()); - result->read_at(0, res, &bytes_read); + static_cast(result->read_at(0, res, &bytes_read)); ASSERT_STREQ(block.dump_data(0, 10).c_str(), reinterpret_cast(result_buf)); delete meta_data; } diff --git a/be/test/vec/exec/vtablet_sink_test.cpp b/be/test/vec/exec/vtablet_sink_test.cpp index 4cd7265797..be1cdd94d6 100644 --- a/be/test/vec/exec/vtablet_sink_test.cpp +++ b/be/test/vec/exec/vtablet_sink_test.cpp @@ -320,7 +320,7 @@ public: if (request->has_block() && _row_desc != nullptr) { vectorized::Block block; - block.deserialize(request->block()); + static_cast(block.deserialize(request->block())); for (size_t row_num = 0; row_num < block.rows(); ++row_num) { std::stringstream out; @@ -366,18 +366,18 @@ public: _env->_internal_client_cache = new BrpcClientCache(); _env->_function_client_cache = new BrpcClientCache(); _env->_wal_manager = WalManager::create_shared(_env, wal_dir); - _env->wal_mgr()->init(); - ThreadPoolBuilder("SendBatchThreadPool") - .set_min_threads(1) - .set_max_threads(5) - .set_max_queue_size(100) - .build(&_env->_send_batch_thread_pool); + static_cast(_env->wal_mgr()->init()); + static_cast(ThreadPoolBuilder("SendBatchThreadPool") + .set_min_threads(1) + .set_max_threads(5) + .set_max_queue_size(100) + .build(&_env->_send_batch_thread_pool)); config::tablet_writer_open_rpc_timeout_sec = 60; config::max_send_batch_parallelism_per_job = 1; } void TearDown() override { - io::global_local_filesystem()->delete_directory(wal_dir); + static_cast(io::global_local_filesystem()->delete_directory(wal_dir)); SAFE_DELETE(_env->_internal_client_cache); SAFE_DELETE(_env->_function_client_cache); SAFE_DELETE(_env->_master_info); @@ -743,8 +743,8 @@ TEST_F(VOlapTableSinkTest, add_block_failed) { // Send batch multiple times, can make _cur_batch or _pending_batches(in channels) not empty. // To ensure the order of releasing resource is OK. - sink.send(&state, &block); - sink.send(&state, &block); + static_cast(sink.send(&state, &block)); + static_cast(sink.send(&state, &block)); // close st = sink.close(&state, Status::OK()); @@ -962,7 +962,7 @@ TEST_F(VOlapTableSinkTest, group_commit) { st = wal_reader.read_block(pblock); ASSERT_TRUE(st.ok()); vectorized::Block wal_block; - wal_block.deserialize(pblock); + ASSERT_TRUE(wal_block.deserialize(pblock).ok()); ASSERT_TRUE(st.ok() || st.is()); ASSERT_EQ(org_block.rows(), wal_block.rows()); for (int i = 0; i < org_block.rows(); i++) { @@ -1089,7 +1089,7 @@ TEST_F(VOlapTableSinkTest, group_commit_with_filter_row) { st = wal_reader.read_block(pblock); ASSERT_TRUE(st.ok()); vectorized::Block wal_block; - wal_block.deserialize(pblock); + ASSERT_TRUE(wal_block.deserialize(pblock).ok()); ASSERT_TRUE(st.ok() || st.is()); ASSERT_EQ(org_block.rows() - 1, wal_block.rows()); for (int i = 0; i < wal_block.rows(); i++) { diff --git a/be/test/vec/exprs/vexpr_test.cpp b/be/test/vec/exprs/vexpr_test.cpp index 8c90debda6..73ae55896c 100644 --- a/be/test/vec/exprs/vexpr_test.cpp +++ b/be/test/vec/exprs/vexpr_test.cpp @@ -59,7 +59,7 @@ TEST(TEST_VEXPR, ABSTEST) { R"|({"1":{"lst":["rec",2,{"1":{"i32":20},"2":{"rec":{"1":{"lst":["rec",1,{"1":{"i32":0},"2":{"rec":{"1":{"i32":6}}}}]}}},"4":{"i32":1},"20":{"i32":-1},"26":{"rec":{"1":{"rec":{"2":{"str":"abs"}}},"2":{"i32":0},"3":{"lst":["rec",1,{"1":{"lst":["rec",1,{"1":{"i32":0},"2":{"rec":{"1":{"i32":5}}}}]}}]},"4":{"rec":{"1":{"lst":["rec",1,{"1":{"i32":0},"2":{"rec":{"1":{"i32":6}}}}]}}},"5":{"tf":0},"7":{"str":"abs(INT)"},"9":{"rec":{"1":{"str":"_ZN5doris13MathFunctions3absEPN9doris_udf15FunctionContextERKNS1_6IntValE"}}},"11":{"i64":0}}}},{"1":{"i32":16},"2":{"rec":{"1":{"lst":["rec",1,{"1":{"i32":0},"2":{"rec":{"1":{"i32":5}}}}]}}},"4":{"i32":0},"15":{"rec":{"1":{"i32":0},"2":{"i32":0}}},"20":{"i32":-1},"23":{"i32":-1}}]}})|"; doris::TExpr exprx = apache::thrift::from_json_string(expr_json); doris::vectorized::VExprContextSPtr context; - doris::vectorized::VExpr::create_expr_tree(exprx, context); + static_cast(doris::vectorized::VExpr::create_expr_tree(exprx, context)); doris::RuntimeState runtime_stat(doris::TUniqueId(), doris::TQueryOptions(), doris::TQueryGlobals(), nullptr); @@ -152,7 +152,7 @@ TEST(TEST_VEXPR, ABSTEST2) { TExpr exprx = apache::thrift::from_json_string(expr_json); doris::vectorized::VExprContextSPtr context; - doris::vectorized::VExpr::create_expr_tree(exprx, context); + static_cast(doris::vectorized::VExpr::create_expr_tree(exprx, context)); doris::RuntimeState runtime_stat(doris::TUniqueId(), doris::TQueryOptions(), doris::TQueryGlobals(), nullptr); @@ -383,7 +383,7 @@ TEST(TEST_VEXPR, LITERALTEST) { std::cout << "data type: " << literal.data_type().get()->get_name() << std::endl; Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); bool v = ctn.column->get_bool(0); EXPECT_EQ(v, true); @@ -394,7 +394,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(1024)); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = ctn.column->get64(0); EXPECT_EQ(v, 1024); @@ -405,7 +405,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(1024)); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = ctn.column->get64(0); EXPECT_EQ(v, 1024); @@ -416,7 +416,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(1024)); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = ctn.column->get64(0); EXPECT_EQ(v, 1024); @@ -427,7 +427,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(1024)); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get<__int128_t>(); EXPECT_EQ(v, 1024); @@ -438,7 +438,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(1024.0f)); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get(); EXPECT_FLOAT_EQ(v, 1024.0f); @@ -449,7 +449,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(1024.0)); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get(); EXPECT_FLOAT_EQ(v, 1024.0); @@ -466,7 +466,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(std::string(date))); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get<__int64_t>(); EXPECT_EQ(v, dt); @@ -490,7 +490,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(date, 4)); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get<__uint64_t>(); EXPECT_EQ(v, dt); @@ -506,7 +506,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(std::string(date))); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get<__int64_t>(); EXPECT_EQ(v, dt); @@ -522,7 +522,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(std::string(date))); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get(); EXPECT_EQ(v, dt); @@ -534,7 +534,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(j)); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); EXPECT_EQ(j, literal.value()); } @@ -544,7 +544,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(std::string("I am Amory, 24"))); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get(); EXPECT_EQ(v, s); @@ -555,7 +555,7 @@ TEST(TEST_VEXPR, LITERALTEST) { VLiteral literal(create_literal(std::string("1234.56"))); Block block; int ret = -1; - literal.execute(nullptr, &block, &ret); + static_cast(literal.execute(nullptr, &block, &ret)); auto ctn = block.safe_get_by_position(ret); auto v = (*ctn.column)[0].get>(); EXPECT_FLOAT_EQ(((double)v.get_value()) / (std::pow(10, v.get_scale())), 1234.56); diff --git a/be/test/vec/function/function_arithmetic_test.cpp b/be/test/vec/function/function_arithmetic_test.cpp index bb2714099b..fffd4bc498 100644 --- a/be/test/vec/function/function_arithmetic_test.cpp +++ b/be/test/vec/function/function_arithmetic_test.cpp @@ -39,7 +39,7 @@ TEST(function_arithmetic_test, function_arithmetic_mod_test) { DataSet data_set = {{{10, 1}, 0}, {{10, -2}, 0}, {{1234, 33}, 13}, {{1234, 0}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -49,13 +49,13 @@ TEST(function_arithmetic_test, function_arithmetic_divide_test) { { InputTypeSet input_types = {TypeIndex::Int32, TypeIndex::Int32}; DataSet data_set = {{{1234, 34}, 36.294117647058826}, {{1234, 0}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::Float64, TypeIndex::Float64}; DataSet data_set = {{{1234.1, 34.6}, 35.667630057803464}, {{1234.34, 0.0}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -71,7 +71,7 @@ TEST(function_arithmetic_test, bitnot_test) { {{(int32_t)-10.44}, ~(int32_t)-10}, {{(int32_t)-999.888}, ~(int32_t)-999}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -86,7 +86,7 @@ TEST(function_arithmetic_test, bitand_test) { {{(int32_t)-10, (int32_t)111}, -10 & 111}, {{(int32_t)-999, (int32_t)888}, -999 & 888}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -101,7 +101,7 @@ TEST(function_arithmetic_test, bitor_test) { {{(int32_t)-10, (int32_t)111}, -10 | 111}, {{(int32_t)-999, (int32_t)888}, -999 | 888}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -116,7 +116,7 @@ TEST(function_arithmetic_test, bitxor_test) { {{(int32_t)-10, (int32_t)111}, -10 ^ 111}, {{(int32_t)-999, (int32_t)888}, -999 ^ 888}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } diff --git a/be/test/vec/function/function_array_aggregation_test.cpp b/be/test/vec/function/function_array_aggregation_test.cpp index 2277ac719b..0f36da1e44 100644 --- a/be/test/vec/function/function_array_aggregation_test.cpp +++ b/be/test/vec/function/function_array_aggregation_test.cpp @@ -71,7 +71,7 @@ void check_function(const std::string& func_name, const IntDataSet data_set, converted_data_set.emplace_back(std::make_pair({array}, Null())); } } - check_function(func_name, input_types, converted_data_set); + static_cast(check_function(func_name, input_types, converted_data_set)); } TEST(VFunctionArrayAggregationTest, TestArrayMin) { @@ -80,13 +80,13 @@ TEST(VFunctionArrayAggregationTest, TestArrayMin) { {{}, nullptr}, {{1, 2, 3}, 1}, }; - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); } TEST(VFunctionArrayAggregationTest, TestArrayMinNullable) { @@ -96,13 +96,13 @@ TEST(VFunctionArrayAggregationTest, TestArrayMinNullable) { {{nullptr}, nullptr}, {{1, nullptr, 3}, 1}, }; - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); } TEST(VFunctionArrayAggregationTest, TestArrayMax) { @@ -111,13 +111,13 @@ TEST(VFunctionArrayAggregationTest, TestArrayMax) { {{}, nullptr}, {{1, 2, 3}, 3}, }; - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); } TEST(VFunctionArrayAggregationTest, TestArrayMaxNullable) { @@ -127,13 +127,13 @@ TEST(VFunctionArrayAggregationTest, TestArrayMaxNullable) { {{nullptr}, nullptr}, {{1, nullptr, 3}, 3}, }; - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); } TEST(VFunctionArrayAggregationTest, TestArraySum) { @@ -142,13 +142,13 @@ TEST(VFunctionArrayAggregationTest, TestArraySum) { {{}, nullptr}, {{1, 2, 3}, 6}, }; - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); } TEST(VFunctionArrayAggregationTest, TestArraySumNullable) { @@ -158,13 +158,13 @@ TEST(VFunctionArrayAggregationTest, TestArraySumNullable) { {{nullptr}, nullptr}, {{1, nullptr, 3}, 4}, }; - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); } TEST(VFunctionArrayAggregationTest, TestArrayAverage) { @@ -173,13 +173,13 @@ TEST(VFunctionArrayAggregationTest, TestArrayAverage) { {{}, nullptr}, {{1, 2, 3}, 2}, }; - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); } TEST(VFunctionArrayAggregationTest, TestArrayAverageNullable) { @@ -189,13 +189,13 @@ TEST(VFunctionArrayAggregationTest, TestArrayAverageNullable) { {{nullptr}, nullptr}, {{1, nullptr, 3}, 2}, }; - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); } TEST(VFunctionArrayAggregationTest, TestArrayProduct) { @@ -204,13 +204,13 @@ TEST(VFunctionArrayAggregationTest, TestArrayProduct) { {{}, nullptr}, {{1, 2, 3}, 6}, }; - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); - check_function(func_name, data_set); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); + static_cast(check_function(func_name, data_set)); } TEST(VFunctionArrayAggregationTest, TestArrayProductNullable) { @@ -220,13 +220,13 @@ TEST(VFunctionArrayAggregationTest, TestArrayProductNullable) { {{nullptr}, nullptr}, {{1, nullptr, 3}, 3}, }; - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); - check_function(func_name, data_set, true); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); + static_cast(check_function(func_name, data_set, true)); } } // namespace vectorized diff --git a/be/test/vec/function/function_array_element_test.cpp b/be/test/vec/function/function_array_element_test.cpp index 0d6a7ed8d7..1b4a55ea38 100644 --- a/be/test/vec/function/function_array_element_test.cpp +++ b/be/test/vec/function/function_array_element_test.cpp @@ -48,7 +48,7 @@ TEST(function_array_element_test, element_at) { {{vec, -1}, Int32(3)}, {{vec, -3}, Int32(1)}, {{vec, -4}, Null()}, {{Null(), 1}, Null()}, {{empty_arr, 0}, Null()}, {{empty_arr, 1}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // element_at(Array, Int32) @@ -61,7 +61,7 @@ TEST(function_array_element_test, element_at) { {{vec, -1}, Int8(3)}, {{vec, -3}, Int8(1)}, {{vec, -4}, Null()}, {{Null(), 1}, Null()}, {{empty_arr, 0}, Null()}, {{empty_arr, 1}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // element_at(Array, Int64) @@ -75,7 +75,7 @@ TEST(function_array_element_test, element_at) { {{Null(), Int64(1)}, Null()}, {{empty_arr, Int64(0)}, Null()}, {{empty_arr, Int64(1)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // element_at(Array, Int64) @@ -89,7 +89,7 @@ TEST(function_array_element_test, element_at) { {{Null(), Int64(1)}, Null()}, {{empty_arr, Int64(0)}, Null()}, {{empty_arr, Int64(1)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // element_at(Array, Int64) @@ -108,7 +108,7 @@ TEST(function_array_element_test, element_at) { {{empty_arr, Int64(0)}, Null()}, {{empty_arr, Int64(1)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // element_at(Array, Int64) @@ -127,7 +127,7 @@ TEST(function_array_element_test, element_at) { {{empty_arr, Int64(0)}, Null()}, {{empty_arr, Int64(1)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // element_at(Array, Int64) @@ -146,7 +146,8 @@ TEST(function_array_element_test, element_at) { {{empty_arr, Int64(0)}, Null()}, {{empty_arr, Int64(1)}, Null()}}; - check_function, true>(func_name, input_types, data_set); + static_cast(check_function, true>(func_name, input_types, + data_set)); } // element_at(Array, Int32) @@ -164,7 +165,7 @@ TEST(function_array_element_test, element_at) { {{empty_arr, 0}, Null()}, {{empty_arr, 1}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } diff --git a/be/test/vec/function/function_array_index_test.cpp b/be/test/vec/function/function_array_index_test.cpp index 2d5c70b5f9..0953f0f6f7 100644 --- a/be/test/vec/function/function_array_index_test.cpp +++ b/be/test/vec/function/function_array_index_test.cpp @@ -42,7 +42,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), 1}, Null()}, {{empty_arr, 1}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, Int8) @@ -55,7 +55,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), Int8(1)}, Null()}, {{empty_arr, Int8(1)}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, Int64) @@ -68,7 +68,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), Int64(1)}, Null()}, {{empty_arr, Int64(1)}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, Int128) @@ -81,7 +81,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), Int128(1)}, Null()}, {{empty_arr, Int128(1)}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, Float32) @@ -94,7 +94,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), float(1)}, Null()}, {{empty_arr, float(1)}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, Float64) @@ -107,7 +107,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), double(1)}, Null()}, {{empty_arr, double(1)}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, Date) @@ -122,7 +122,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), std::string("2022-01-04")}, Null()}, {{empty_arr, std::string("2022-01-02")}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, DateTime) @@ -137,7 +137,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), std::string("2022-01-04 00:00:00")}, Null()}, {{empty_arr, std::string("2022-01-02 00:00:00")}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, Decimal128) @@ -151,7 +151,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), ut_type::DECIMAL(0)}, Null()}, {{empty_arr, ut_type::DECIMAL(0)}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_contains(Array, String) @@ -165,7 +165,7 @@ TEST(function_array_index_test, array_contains) { {{Null(), std::string("abc")}, Null()}, {{empty_arr, std::string("")}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -183,7 +183,7 @@ TEST(function_array_index_test, array_position) { {{Null(), 1}, Null()}, {{empty_arr, 1}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_position(Array, Int32) @@ -196,7 +196,7 @@ TEST(function_array_index_test, array_position) { {{Null(), Int32(1)}, Null()}, {{empty_arr, Int32(1)}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_position(Array, Int8) @@ -209,7 +209,7 @@ TEST(function_array_index_test, array_position) { {{Null(), Int8(1)}, Null()}, {{empty_arr, Int8(1)}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_position(Array, Date) @@ -224,7 +224,7 @@ TEST(function_array_index_test, array_position) { {{Null(), std::string("2022-01-04")}, Null()}, {{empty_arr, std::string("2022-01-02")}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_position(Array, DateTime) @@ -239,7 +239,7 @@ TEST(function_array_index_test, array_position) { {{Null(), std::string("2022-01-04 00:00:00")}, Null()}, {{empty_arr, std::string("2022-01-02 00:00:00")}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_position(Array, Decimal128) @@ -253,7 +253,7 @@ TEST(function_array_index_test, array_position) { {{Null(), ut_type::DECIMAL(0)}, Null()}, {{empty_arr, ut_type::DECIMAL(0)}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_position(Array, String) @@ -267,7 +267,7 @@ TEST(function_array_index_test, array_position) { {{Null(), std::string("abc")}, Null()}, {{empty_arr, std::string("")}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } diff --git a/be/test/vec/function/function_array_size_test.cpp b/be/test/vec/function/function_array_size_test.cpp index 135a6f5330..3fa710f684 100644 --- a/be/test/vec/function/function_array_size_test.cpp +++ b/be/test/vec/function/function_array_size_test.cpp @@ -40,7 +40,7 @@ TEST(function_array_size_test, size) { Array vec = {Int32(1), Int32(2), Int32(3)}; DataSet data_set = {{{vec}, Int64(3)}, {{Null()}, Null()}, {{empty_arr}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // size(Array) @@ -54,7 +54,7 @@ TEST(function_array_size_test, size) { {{Null()}, Null()}, {{empty_arr}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -69,7 +69,7 @@ TEST(function_array_size_test, cardinality) { Array vec = {Int32(1), Int32(2), Int32(3)}; DataSet data_set = {{{vec}, Int64(3)}, {{Null()}, Null()}, {{empty_arr}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // cardinality(Array) @@ -83,7 +83,7 @@ TEST(function_array_size_test, cardinality) { {{Null()}, Null()}, {{empty_arr}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -98,7 +98,7 @@ TEST(function_array_size_test, array_size) { Array vec = {Int32(1), Int32(2), Int32(3)}; DataSet data_set = {{{vec}, Int64(3)}, {{Null()}, Null()}, {{empty_arr}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // array_size(Array) @@ -112,7 +112,7 @@ TEST(function_array_size_test, array_size) { {{Null()}, Null()}, {{empty_arr}, Int64(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } diff --git a/be/test/vec/function/function_arrays_overlap_test.cpp b/be/test/vec/function/function_arrays_overlap_test.cpp index b829055a32..6811f6e6e4 100644 --- a/be/test/vec/function/function_arrays_overlap_test.cpp +++ b/be/test/vec/function/function_arrays_overlap_test.cpp @@ -45,7 +45,7 @@ TEST(function_arrays_overlap_test, arrays_overlap) { {{Null(), vec1}, Null()}, {{empty_arr, vec1}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // arrays_overlap(Array, Array) @@ -58,7 +58,7 @@ TEST(function_arrays_overlap_test, arrays_overlap) { DataSet data_set = { {{vec1, vec2}, UInt8(1)}, {{Null(), vec1}, Null()}, {{empty_arr, vec1}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // arrays_overlap(Array, Array) @@ -71,7 +71,7 @@ TEST(function_arrays_overlap_test, arrays_overlap) { DataSet data_set = { {{vec1, vec2}, UInt8(1)}, {{Null(), vec1}, Null()}, {{empty_arr, vec1}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // arrays_overlap(Array, Array) @@ -85,7 +85,7 @@ TEST(function_arrays_overlap_test, arrays_overlap) { DataSet data_set = { {{vec1, vec2}, UInt8(1)}, {{Null(), vec1}, Null()}, {{empty_arr, vec1}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // arrays_overlap(Array, Array) @@ -102,7 +102,7 @@ TEST(function_arrays_overlap_test, arrays_overlap) { {{Null(), vec1}, Null()}, {{empty_arr, vec1}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // arrays_overlap(Array, Array) @@ -116,7 +116,7 @@ TEST(function_arrays_overlap_test, arrays_overlap) { DataSet data_set = { {{vec1, vec2}, UInt8(1)}, {{Null(), vec1}, Null()}, {{empty_arr, vec1}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // arrays_overlap(Array, Array) @@ -132,7 +132,7 @@ TEST(function_arrays_overlap_test, arrays_overlap) { {{Null(), vec1}, Null()}, {{empty_arr, vec1}, UInt8(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } diff --git a/be/test/vec/function/function_bitmap_test.cpp b/be/test/vec/function/function_bitmap_test.cpp index ba286bf5ac..c1657f8707 100644 --- a/be/test/vec/function/function_bitmap_test.cpp +++ b/be/test/vec/function/function_bitmap_test.cpp @@ -50,7 +50,7 @@ TEST(function_bitmap_test, function_bitmap_min_test) { {{&empty_bitmap}, Null()}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_bitmap_test, function_bitmap_max_test) { std::string func_name = "bitmap_max"; @@ -64,7 +64,7 @@ TEST(function_bitmap_test, function_bitmap_max_test) { {{&empty_bitmap}, Null()}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_bitmap_test, function_bitmap_to_string_test) { @@ -79,7 +79,7 @@ TEST(function_bitmap_test, function_bitmap_to_string_test) { {{&empty_bitmap}, std::string("")}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_bitmap_test, function_bitmap_remove) { @@ -96,7 +96,7 @@ TEST(function_bitmap_test, function_bitmap_remove) { {{&bitmap2, (int64_t)6}, bitmap2_res}, {{&bitmap1, Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } namespace doris { @@ -158,7 +158,7 @@ TEST(function_bitmap_test, function_bitmap_to_base64) { {{&empty_bitmap}, std::string("AA==")}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } EXPECT_TRUE(config::set_config("enable_set_in_bitmap_value", "true", false, true).ok()); @@ -190,7 +190,7 @@ TEST(function_bitmap_test, function_bitmap_to_base64) { {{&empty_bitmap}, std::string("AA==")}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -201,7 +201,7 @@ TEST(function_bitmap_test, function_bitmap_to_base64) { bitmap.add(2); bitmap.add(3); DataSet data_set = {{{&bitmap}, base64}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } // test bitmap serialize version2 @@ -216,7 +216,7 @@ TEST(function_bitmap_test, function_bitmap_to_base64) { {{&bitmap32_3}, std::string("DAI7MAAAAQAAIAABAAAAIAA=")}, {{&bitmap64_3}, std::string("DQIAAAAAAjswAAABAAAfAAEAAAAfAAEAAAABAQAAAAAAAAA=")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -268,7 +268,7 @@ TEST(function_bitmap_test, function_bitmap_from_base64) { {{bitmap64_base64_2}, bitmap64_2}, {{bitmap64_base64_3}, bitmap64_3}, {{base64_empty}, empty_bitmap}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } EXPECT_TRUE(config::set_config("enable_set_in_bitmap_value", "true", false, true).ok()); @@ -286,7 +286,7 @@ TEST(function_bitmap_test, function_bitmap_from_base64) { {{bitmap64_base64_2}, bitmap64_2}, {{bitmap64_base64_3}, bitmap64_3}, {{base64_empty}, empty_bitmap}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -295,7 +295,7 @@ TEST(function_bitmap_test, function_bitmap_from_base64) { bitmap.add(0); bitmap.add(1); DataSet data_set = {{{base64}, bitmap}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { EXPECT_TRUE(config::set_config("bitmap_serialize_version", "1", false, true).ok()); @@ -307,7 +307,7 @@ TEST(function_bitmap_test, function_bitmap_from_base64) { "BAIAAAAAOjAAAAEAAAAAAB8AEAAAAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEw" "AUABUAFgAXABgAGQAaABsAHAAdAB4AHwABAAAAOjAAAAEAAAAAAAAAEAAAAAAA"); DataSet data_set = {{{base64_32_v1}, bitmap32_3}, {{base64_64_v1}, bitmap64_3}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { EXPECT_TRUE(config::set_config("bitmap_serialize_version", "2", false, true).ok()); @@ -319,7 +319,7 @@ TEST(function_bitmap_test, function_bitmap_from_base64) { "DQIAAAAAAjowAAABAAAAAAAfABAAAAAAAAEAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASAB" "MAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AAQAAAAEBAAAAAAAAAA=="); DataSet data_set = {{{base64_32_v2}, bitmap32_3}, {{base64_64_v2}, bitmap64_3}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -333,7 +333,7 @@ TEST(function_bitmap_test, function_bitmap_and_count) { {{&bitmap1, &bitmap1}, (int64_t)3}, {{&bitmap1, &bitmap2}, (int64_t)1}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); { InputTypeSet input_types = {TypeIndex::BitMap, TypeIndex::BitMap, TypeIndex::BitMap}; @@ -347,7 +347,7 @@ TEST(function_bitmap_test, function_bitmap_and_count) { {{&bitmap1, &bitmap2, Null()}, (int64_t)0}, {{&bitmap1, &bitmap3, &bitmap3}, (int64_t)1}}; //33 - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -363,7 +363,7 @@ TEST(function_bitmap_test, function_bitmap_or_count) { {{&bitmap2, &bitmap3}, (int64_t)4}, {{&bitmap1, &bitmap3}, (int64_t)3}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); { InputTypeSet input_types = {TypeIndex::BitMap, TypeIndex::BitMap, TypeIndex::BitMap}; @@ -379,7 +379,7 @@ TEST(function_bitmap_test, function_bitmap_or_count) { {{&bitmap1, &bitmap3, &bitmap3}, (int64_t)6}}; //1,5,33,1024,2019,18446744073709551615 - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -396,7 +396,7 @@ TEST(function_bitmap_test, function_bitmap_xor_count) { {{&bitmap2, &bitmap3}, (int64_t)2}, {{&bitmap1, &bitmap4}, (int64_t)2}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); { InputTypeSet input_types = {TypeIndex::BitMap, TypeIndex::BitMap, TypeIndex::BitMap}; @@ -411,7 +411,7 @@ TEST(function_bitmap_test, function_bitmap_xor_count) { {{&bitmap1, &empty_bitmap, Null()}, (int64_t)0}, {{&bitmap1, &bitmap3, &bitmap3}, (int64_t)3}}; //1,1024,2019 - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -428,7 +428,7 @@ TEST(function_bitmap_test, function_bitmap_and_not_count) { {{&bitmap2, &bitmap3}, (int64_t)3}, //0,3,4 {{&bitmap1, &bitmap2}, (int64_t)2}}; //1,2 - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_bitmap_test, function_bitmap_and_not_count_alias) { std::string func_name = "bitmap_andnot_count"; @@ -443,7 +443,7 @@ TEST(function_bitmap_test, function_bitmap_and_not_count_alias) { {{&bitmap2, &bitmap3}, (int64_t)3}, //0,3,4 {{&bitmap1, &bitmap2}, (int64_t)2}}; //1,2 - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_bitmap_test, function_bitmap_has_all) { std::string func_name = "bitmap_has_all"; @@ -465,7 +465,7 @@ TEST(function_bitmap_test, function_bitmap_has_all) { {{&bitmap4, &bitmap5}, uint8(true)}, {{Null(), &empty_bitmap1}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } // namespace doris::vectorized diff --git a/be/test/vec/function/function_geo_test.cpp b/be/test/vec/function/function_geo_test.cpp index 3d9bccc984..c4b699e881 100644 --- a/be/test/vec/function/function_geo_test.cpp +++ b/be/test/vec/function/function_geo_test.cpp @@ -53,7 +53,7 @@ TEST(VGeoFunctionsTest, function_geo_st_point_test) { {{Null(), (double)5}, Null()}, {{(double)5, Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -70,7 +70,7 @@ TEST(VGeoFunctionsTest, function_geo_st_as_text) { DataSet data_set = {{{buf}, std::string("POINT (24.7 56.7)")}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -87,7 +87,7 @@ TEST(VGeoFunctionsTest, function_geo_st_as_wkt) { DataSet data_set = {{{buf}, std::string("POINT (24.7 56.7)")}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -104,7 +104,7 @@ TEST(VGeoFunctionsTest, function_geo_st_x) { DataSet data_set = {{{buf}, (double)24.7}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -121,7 +121,7 @@ TEST(VGeoFunctionsTest, function_geo_st_y) { DataSet data_set = {{{buf}, (double)56.7}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -142,7 +142,7 @@ TEST(VGeoFunctionsTest, function_geo_st_distance_sphere) { {{Null(), (double)39.939093, (double)116.4274406433, (double)39.9020987219}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -163,7 +163,7 @@ TEST(VGeoFunctionsTest, function_geo_st_angle_sphere) { {{Null(), (double)39.939093, (double)116.4274406433, (double)39.9020987219}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -193,7 +193,7 @@ TEST(VGeoFunctionsTest, function_geo_st_angle) { {{buf1, Null(), buf3}, Null()}, {{Null(), buf2, buf3}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -218,7 +218,7 @@ TEST(VGeoFunctionsTest, function_geo_st_azimuth) { {{buf1, Null()}, Null()}, {{Null(), buf2}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -253,7 +253,7 @@ TEST(VGeoFunctionsTest, function_geo_st_contains) { {{buf1, Null()}, Null()}, {{Null(), buf3}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -272,7 +272,7 @@ TEST(VGeoFunctionsTest, function_geo_st_circle) { {{(double)111, Null(), (double)10000}, Null()}, {{(double)111, (double)64, Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -290,7 +290,7 @@ TEST(VGeoFunctionsTest, function_geo_st_geometryfromtext) { shape->encode_to(&buf); DataSet data_set = {{{std::string("LINESTRING (1 1, 2 2)")}, buf}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -308,7 +308,7 @@ TEST(VGeoFunctionsTest, function_geo_st_geomfromtext) { shape->encode_to(&buf); DataSet data_set = {{{std::string("LINESTRING (1 1, 2 2)")}, buf}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -326,7 +326,7 @@ TEST(VGeoFunctionsTest, function_geo_st_linefromtext) { shape->encode_to(&buf); DataSet data_set = {{{std::string("LINESTRING (1 1, 2 2)")}, buf}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -345,7 +345,7 @@ TEST(VGeoFunctionsTest, function_geo_st_polygon) { DataSet data_set = {{{std::string("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))")}, buf}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -364,7 +364,7 @@ TEST(VGeoFunctionsTest, function_geo_st_polygonfromtext) { DataSet data_set = {{{std::string("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))")}, buf}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -380,7 +380,7 @@ TEST(VGeoFunctionsTest, function_geo_st_area_square_meters) { circle.encode_to(&buf); DataSet data_set = {{{buf}, (double)3.1415926535897869}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -398,7 +398,7 @@ TEST(VGeoFunctionsTest, function_geo_st_area_square_km) { shape->encode_to(&buf); DataSet data_set = {{{buf}, (double)12364.036567076409}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } diff --git a/be/test/vec/function/function_hash_test.cpp b/be/test/vec/function/function_hash_test.cpp index f65a23f3a0..2e12cd64f3 100644 --- a/be/test/vec/function/function_hash_test.cpp +++ b/be/test/vec/function/function_hash_test.cpp @@ -38,7 +38,7 @@ TEST(HashFunctionTest, murmur_hash_3_test) { DataSet data_set = {{{Null()}, Null()}, {{std::string("hello")}, (int32_t)1321743225}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -47,7 +47,7 @@ TEST(HashFunctionTest, murmur_hash_3_test) { DataSet data_set = {{{std::string("hello"), std::string("world")}, (int32_t)984713481}, {{std::string("hello"), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -57,7 +57,7 @@ TEST(HashFunctionTest, murmur_hash_3_test) { (int32_t)-666935433}, {{std::string("hello"), std::string("world"), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; } @@ -70,7 +70,7 @@ TEST(HashFunctionTest, murmur_hash_3_64_test) { DataSet data_set = {{{Null()}, Null()}, {{std::string("hello")}, (int64_t)-3215607508166160593}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -80,7 +80,7 @@ TEST(HashFunctionTest, murmur_hash_3_64_test) { {{std::string("hello"), std::string("world")}, (int64_t)3583109472027628045}, {{std::string("hello"), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -90,7 +90,7 @@ TEST(HashFunctionTest, murmur_hash_3_64_test) { (int64_t)1887828212617890932}, {{std::string("hello"), std::string("world"), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; } @@ -103,7 +103,7 @@ TEST(HashFunctionTest, murmur_hash_2_test) { DataSet data_set = {{{Null()}, Null()}, {{std::string("hello")}, (uint64_t)2191231550387646743ull}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -113,7 +113,7 @@ TEST(HashFunctionTest, murmur_hash_2_test) { {{std::string("hello"), std::string("world")}, (uint64_t)11978658642541747642ull}, {{std::string("hello"), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -123,7 +123,7 @@ TEST(HashFunctionTest, murmur_hash_2_test) { (uint64_t)1367324781703025231ull}, {{std::string("hello"), std::string("world"), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; } diff --git a/be/test/vec/function/function_ifnull_test.cpp b/be/test/vec/function/function_ifnull_test.cpp index 4ee0a405d5..382aec1510 100644 --- a/be/test/vec/function/function_ifnull_test.cpp +++ b/be/test/vec/function/function_ifnull_test.cpp @@ -36,7 +36,7 @@ TEST(IfNullTest, Int_Test) { InputTypeSet input_types = {TypeIndex::Int32, TypeIndex::Int32}; DataSet data_set = {{{4, 10}, 4}, {{-4, 10}, -4}, {{Null(), 5}, 5}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(NvlTest, Int_Test) { @@ -44,7 +44,7 @@ TEST(NvlTest, Int_Test) { InputTypeSet input_types = {TypeIndex::Int32, TypeIndex::Int32}; DataSet data_set = {{{4, 10}, 4}, {{-4, 10}, -4}, {{Null(), 5}, 5}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(IfNullTest, Float_Test) { @@ -52,7 +52,7 @@ TEST(IfNullTest, Float_Test) { InputTypeSet input_types = {TypeIndex::Float64, TypeIndex::Float64}; DataSet data_set = {{{4.0, 10.0}, 4.0}, {{-4.0, 10.0}, -4.0}, {{Null(), 5.0}, 5.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(IfNullTest, String_Test) { @@ -62,7 +62,7 @@ TEST(IfNullTest, String_Test) { {{std::string("hello"), std::string("10.0")}, std::string("hello")}, {{Null(), std::string("world")}, std::string("world")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(IfNullTest, String_Int_Test) { @@ -73,7 +73,7 @@ TEST(IfNullTest, String_Int_Test) { {{Null(), std::string("2021-10-24 13:00:01")}, str_to_date_time("2021-10-24 13:00:01")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } // namespace doris::vectorized diff --git a/be/test/vec/function/function_json_test.cpp b/be/test/vec/function/function_json_test.cpp index cda3633106..ceecadf64c 100644 --- a/be/test/vec/function/function_json_test.cpp +++ b/be/test/vec/function/function_json_test.cpp @@ -40,7 +40,7 @@ TEST(FunctionJsonTEST, GetJsonDoubleTest) { {{VARCHAR("{\"k1.key\":{\"k2\":[1.1, 2.2]}}"), VARCHAR("$.\"k1.key\".k2[0]")}, DOUBLE(1.1)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonTEST, GetJsonIntTest) { @@ -52,7 +52,7 @@ TEST(FunctionJsonTEST, GetJsonIntTest) { INT(2)}, {{VARCHAR("{\"k1.key\":{\"k2\":[1, 2]}}"), VARCHAR("$.\"k1.key\".k2[0]")}, INT(1)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonTEST, GetJsonBigIntTest) { @@ -65,7 +65,7 @@ TEST(FunctionJsonTEST, GetJsonBigIntTest) { Int64(2)}, {{VARCHAR("{\"k1.key\":{\"k2\":[1, 2]}}"), VARCHAR("$.\"k1.key\".k2[0]")}, Int64(1)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonTEST, GetJsonStringTest) { @@ -82,7 +82,7 @@ TEST(FunctionJsonTEST, GetJsonStringTest) { VARCHAR("$.k1")}, VARCHAR("[\"v1\",\"v3\",\"v4\"]")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } // namespace doris::vectorized diff --git a/be/test/vec/function/function_jsonb_test.cpp b/be/test/vec/function/function_jsonb_test.cpp index 7f29e325ae..d1c7ef121a 100644 --- a/be/test/vec/function/function_jsonb_test.cpp +++ b/be/test/vec/function/function_jsonb_test.cpp @@ -60,37 +60,43 @@ TEST(FunctionJsonbTEST, JsonbParseTest) { STRING(R"([{"k1":"v41","k2":400},1,"a",3.14])")}, // complex array }; - check_function(func_name, input_types, data_set_valid); + static_cast(check_function(func_name, input_types, data_set_valid)); DataSet data_set_invalid = { {{STRING("abc")}, Null()}, // invalid string }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("'abc'")}, Null()}, // invalid string }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("100x")}, Null()}, // invalid int }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("6.a8")}, Null()}, // invalid double }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("{x")}, Null()}, // invalid object }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("[123, abc]")}, Null()} // invalid array }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); } TEST(FunctionJsonbTEST, JsonbParseErrorToNullTest) { @@ -125,7 +131,7 @@ TEST(FunctionJsonbTEST, JsonbParseErrorToNullTest) { {{STRING("[123, abc]")}, Null()} // invalid array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbParseErrorToValueTest) { @@ -163,7 +169,7 @@ TEST(FunctionJsonbTEST, JsonbParseErrorToValueTest) { STRING(R"([123,"abc"])")} // invalid array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbParseErrorToInvalidTest) { @@ -198,7 +204,7 @@ TEST(FunctionJsonbTEST, JsonbParseErrorToInvalidTest) { {{STRING("[123, abc]")}, STRING("")} // invalid array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbParseNullableTest) { @@ -227,37 +233,43 @@ TEST(FunctionJsonbTEST, JsonbParseNullableTest) { STRING(R"([{"k1":"v41","k2":400},1,"a",3.14])")}, // complex array }; - check_function(func_name, input_types, data_set_valid); + static_cast(check_function(func_name, input_types, data_set_valid)); DataSet data_set_invalid = { {{STRING("abc")}, Null()}, // invalid string }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("'abc'")}, Null()}, // invalid string }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("100x")}, Null()}, // invalid int }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("6.a8")}, Null()}, // invalid double }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("{x")}, Null()}, // invalid object }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("[123, abc]")}, Null()} // invalid array }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); } TEST(FunctionJsonbTEST, JsonbParseNullableErrorToNullTest) { @@ -292,7 +304,7 @@ TEST(FunctionJsonbTEST, JsonbParseNullableErrorToNullTest) { {{STRING("[123, abc]")}, Null()} // invalid array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbParseNullableErrorToValueTest) { @@ -330,7 +342,7 @@ TEST(FunctionJsonbTEST, JsonbParseNullableErrorToValueTest) { STRING(R"([123,"abc"])")} // invalid array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbParseNullableErrorToInvalidTest) { @@ -365,7 +377,7 @@ TEST(FunctionJsonbTEST, JsonbParseNullableErrorToInvalidTest) { {{STRING("[123, abc]")}, STRING("")} // invalid array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbParseNotnullTest) { @@ -393,37 +405,43 @@ TEST(FunctionJsonbTEST, JsonbParseNotnullTest) { STRING(R"([{"k1":"v41","k2":400},1,"a",3.14])")}, // complex array }; - check_function(func_name, input_types, data_set_valid); + static_cast(check_function(func_name, input_types, data_set_valid)); DataSet data_set_invalid = { {{STRING("abc")}, Null()}, // invalid string }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("'abc'")}, Null()}, // invalid string }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("100x")}, Null()}, // invalid int }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("6.a8")}, Null()}, // invalid double }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("{x")}, Null()}, // invalid object }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); data_set_invalid = { {{STRING("[123, abc]")}, Null()} // invalid array }; - check_function(func_name, input_types, data_set_invalid, true); + static_cast( + check_function(func_name, input_types, data_set_invalid, true)); } TEST(FunctionJsonbTEST, JsonbParseNotnullErrorToValueTest) { @@ -460,7 +478,7 @@ TEST(FunctionJsonbTEST, JsonbParseNotnullErrorToValueTest) { STRING(R"([123,"abc"])")} // invalid array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbParseNotnullErrorToInvalidTest) { @@ -494,7 +512,7 @@ TEST(FunctionJsonbTEST, JsonbParseNotnullErrorToInvalidTest) { {{STRING("[123, abc]")}, STRING("")} // invalid array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbExtractTest) { @@ -526,7 +544,7 @@ TEST(FunctionJsonbTEST, JsonbExtractTest) { STRING(R"([{"k1":"v41","k2":400},1,"a",3.14])")}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract obejct data_set = { @@ -551,7 +569,7 @@ TEST(FunctionJsonbTEST, JsonbExtractTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract array data_set = { @@ -613,7 +631,7 @@ TEST(FunctionJsonbTEST, JsonbExtractTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract $[0].k1 data_set = { @@ -639,7 +657,7 @@ TEST(FunctionJsonbTEST, JsonbExtractTest) { STRING(R"("v41")")}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbExtractStringTest) { @@ -671,7 +689,7 @@ TEST(FunctionJsonbTEST, JsonbExtractStringTest) { STRING(R"([{"k1":"v41","k2":400},1,"a",3.14])")}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract obejct data_set = { @@ -696,7 +714,7 @@ TEST(FunctionJsonbTEST, JsonbExtractStringTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract array data_set = { @@ -758,7 +776,7 @@ TEST(FunctionJsonbTEST, JsonbExtractStringTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract $[0].k1 data_set = { @@ -783,7 +801,7 @@ TEST(FunctionJsonbTEST, JsonbExtractStringTest) { STRING("v41")}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbExtractIntTest) { @@ -813,7 +831,7 @@ TEST(FunctionJsonbTEST, JsonbExtractIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract obejct data_set = { @@ -838,7 +856,7 @@ TEST(FunctionJsonbTEST, JsonbExtractIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract array data_set = { @@ -899,7 +917,7 @@ TEST(FunctionJsonbTEST, JsonbExtractIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract $[0].k1 data_set = { @@ -926,7 +944,7 @@ TEST(FunctionJsonbTEST, JsonbExtractIntTest) { INT(400)}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbExtractBigIntTest) { @@ -956,7 +974,7 @@ TEST(FunctionJsonbTEST, JsonbExtractBigIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract obejct data_set = { @@ -981,7 +999,7 @@ TEST(FunctionJsonbTEST, JsonbExtractBigIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract array data_set = { @@ -1042,7 +1060,7 @@ TEST(FunctionJsonbTEST, JsonbExtractBigIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract $[0].k1 data_set = { @@ -1069,7 +1087,7 @@ TEST(FunctionJsonbTEST, JsonbExtractBigIntTest) { BIGINT(400)}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbExtractDoubleTest) { @@ -1099,7 +1117,7 @@ TEST(FunctionJsonbTEST, JsonbExtractDoubleTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract obejct data_set = { @@ -1123,7 +1141,7 @@ TEST(FunctionJsonbTEST, JsonbExtractDoubleTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract array data_set = { @@ -1183,7 +1201,7 @@ TEST(FunctionJsonbTEST, JsonbExtractDoubleTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // json_extract $[0].k1 data_set = { @@ -1209,7 +1227,7 @@ TEST(FunctionJsonbTEST, JsonbExtractDoubleTest) { DOUBLE(400)}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, JsonbCastToOtherTest) { @@ -1244,7 +1262,8 @@ TEST(FunctionJsonbTEST, JsonbCastToOtherTest) { }; for (const auto& row : data_set) { DataSet const_dataset = {row}; - check_function(func_name, input_types, const_dataset); + static_cast( + check_function(func_name, input_types, const_dataset)); } input_types = {Nullable {TypeIndex::JSONB}, ConstedNotnull {TypeIndex::Int8}}; // cast to TINYINT @@ -1275,7 +1294,8 @@ TEST(FunctionJsonbTEST, JsonbCastToOtherTest) { }; for (const auto& row : data_set) { DataSet const_dataset = {row}; - check_function(func_name, input_types, const_dataset); + static_cast( + check_function(func_name, input_types, const_dataset)); } input_types = {Nullable {TypeIndex::JSONB}, ConstedNotnull {TypeIndex::Int16}}; @@ -1307,7 +1327,8 @@ TEST(FunctionJsonbTEST, JsonbCastToOtherTest) { }; for (const auto& row : data_set) { DataSet const_dataset = {row}; - check_function(func_name, input_types, const_dataset); + static_cast( + check_function(func_name, input_types, const_dataset)); } input_types = {Nullable {TypeIndex::JSONB}, ConstedNotnull {TypeIndex::Int32}}; @@ -1340,7 +1361,8 @@ TEST(FunctionJsonbTEST, JsonbCastToOtherTest) { }; for (const auto& row : data_set) { DataSet const_dataset = {row}; - check_function(func_name, input_types, const_dataset); + static_cast( + check_function(func_name, input_types, const_dataset)); } input_types = {Nullable {TypeIndex::JSONB}, ConstedNotnull {TypeIndex::Int64}}; @@ -1367,7 +1389,8 @@ TEST(FunctionJsonbTEST, JsonbCastToOtherTest) { }; for (const auto& row : data_set) { DataSet const_dataset = {row}; - check_function(func_name, input_types, const_dataset); + static_cast( + check_function(func_name, input_types, const_dataset)); } input_types = {Nullable {TypeIndex::JSONB}, ConstedNotnull {TypeIndex::Float64}}; @@ -1394,7 +1417,8 @@ TEST(FunctionJsonbTEST, JsonbCastToOtherTest) { }; for (const auto& row : data_set) { DataSet const_dataset = {row}; - check_function(func_name, input_types, const_dataset); + static_cast( + check_function(func_name, input_types, const_dataset)); } input_types = {Nullable {TypeIndex::JSONB}, ConstedNotnull {TypeIndex::String}}; @@ -1423,69 +1447,70 @@ TEST(FunctionJsonbTEST, JsonbCastToOtherTest) { }; for (const auto& row : data_set) { DataSet const_dataset = {row}; - check_function(func_name, input_types, const_dataset); + static_cast( + check_function(func_name, input_types, const_dataset)); } } TEST(FunctionJsonbTEST, JsonbCastFromOtherTest) { // CAST Nullable(X) to Nullable(JSONB) - check_function( + static_cast(check_function( "CAST", {Nullable {TypeIndex::UInt8}, ConstedNotnull {TypeIndex::JSONB}}, - {{{BOOLEAN(1), Null()}, STRING("true")}}); - check_function( + {{{BOOLEAN(1), Null()}, STRING("true")}})); + static_cast(check_function( "CAST", {Nullable {TypeIndex::UInt8}, ConstedNotnull {TypeIndex::JSONB}}, - {{{BOOLEAN(0), Null()}, STRING("false")}}); - check_function( + {{{BOOLEAN(0), Null()}, STRING("false")}})); + static_cast(check_function( "CAST", {Nullable {TypeIndex::Int8}, ConstedNotnull {TypeIndex::JSONB}}, - {{{TINYINT(100), Null()}, STRING("100")}}); - check_function( + {{{TINYINT(100), Null()}, STRING("100")}})); + static_cast(check_function( "CAST", {Nullable {TypeIndex::Int16}, ConstedNotnull {TypeIndex::JSONB}}, - {{{SMALLINT(10000), Null()}, STRING("10000")}}); - check_function( + {{{SMALLINT(10000), Null()}, STRING("10000")}})); + static_cast(check_function( "CAST", {Nullable {TypeIndex::Int32}, ConstedNotnull {TypeIndex::JSONB}}, - {{{INT(1000000000), Null()}, STRING("1000000000")}}); - check_function( + {{{INT(1000000000), Null()}, STRING("1000000000")}})); + static_cast(check_function( "CAST", {Nullable {TypeIndex::Int64}, ConstedNotnull {TypeIndex::JSONB}}, - {{{BIGINT(1152921504606846976), Null()}, STRING("1152921504606846976")}}); - check_function( + {{{BIGINT(1152921504606846976), Null()}, STRING("1152921504606846976")}})); + static_cast(check_function( "CAST", {Nullable {TypeIndex::Float64}, ConstedNotnull {TypeIndex::JSONB}}, - {{{DOUBLE(6.18), Null()}, STRING("6.18")}}); - check_function( + {{{DOUBLE(6.18), Null()}, STRING("6.18")}})); + static_cast(check_function( "CAST", {Nullable {TypeIndex::String}, ConstedNotnull {TypeIndex::JSONB}}, - {{{STRING(R"(abcd)"), Null()}, Null()}}); // should fail - check_function( + {{{STRING(R"(abcd)"), Null()}, Null()}})); // should fail + static_cast(check_function( "CAST", {Nullable {TypeIndex::String}, ConstedNotnull {TypeIndex::JSONB}}, - {{{STRING(R"("abcd")"), Null()}, STRING(R"("abcd")")}}); + {{{STRING(R"("abcd")"), Null()}, STRING(R"("abcd")")}})); // CAST X to JSONB - check_function( + static_cast(check_function( "CAST", {Notnull {TypeIndex::UInt8}, ConstedNotnull {TypeIndex::JSONB}}, - {{{BOOLEAN(1), Null()}, STRING("true")}}); - check_function( + {{{BOOLEAN(1), Null()}, STRING("true")}})); + static_cast(check_function( "CAST", {Notnull {TypeIndex::UInt8}, ConstedNotnull {TypeIndex::JSONB}}, - {{{BOOLEAN(0), Null()}, STRING("false")}}); - check_function( + {{{BOOLEAN(0), Null()}, STRING("false")}})); + static_cast(check_function( "CAST", {Notnull {TypeIndex::Int8}, ConstedNotnull {TypeIndex::JSONB}}, - {{{TINYINT(100), Null()}, STRING("100")}}); - check_function( + {{{TINYINT(100), Null()}, STRING("100")}})); + static_cast(check_function( "CAST", {Notnull {TypeIndex::Int16}, ConstedNotnull {TypeIndex::JSONB}}, - {{{SMALLINT(10000), Null()}, STRING("10000")}}); - check_function( + {{{SMALLINT(10000), Null()}, STRING("10000")}})); + static_cast(check_function( "CAST", {Notnull {TypeIndex::Int32}, ConstedNotnull {TypeIndex::JSONB}}, - {{{INT(1000000000), Null()}, STRING("1000000000")}}); - check_function( + {{{INT(1000000000), Null()}, STRING("1000000000")}})); + static_cast(check_function( "CAST", {Notnull {TypeIndex::Int64}, ConstedNotnull {TypeIndex::JSONB}}, - {{{BIGINT(1152921504606846976), Null()}, STRING("1152921504606846976")}}); - check_function( + {{{BIGINT(1152921504606846976), Null()}, STRING("1152921504606846976")}})); + static_cast(check_function( "CAST", {Notnull {TypeIndex::Float64}, ConstedNotnull {TypeIndex::JSONB}}, - {{{DOUBLE(6.18), Null()}, STRING("6.18")}}); + {{{DOUBLE(6.18), Null()}, STRING("6.18")}})); // String to JSONB should always be Nullable - check_function( + static_cast(check_function( "CAST", {Notnull {TypeIndex::String}, ConstedNotnull {TypeIndex::JSONB}}, - {{{STRING(R"(abcd)"), Null()}, Null()}}); // should fail - check_function( + {{{STRING(R"(abcd)"), Null()}, Null()}})); // should fail + static_cast(check_function( "CAST", {Notnull {TypeIndex::String}, ConstedNotnull {TypeIndex::JSONB}}, - {{{STRING(R"("abcd")"), Null()}, STRING(R"("abcd")")}}); + {{{STRING(R"("abcd")"), Null()}, STRING(R"("abcd")")}})); } TEST(FunctionJsonbTEST, GetJSONSTRINGTest) { @@ -1517,7 +1542,7 @@ TEST(FunctionJsonbTEST, GetJSONSTRINGTest) { STRING(R"([{"k1":"v41","k2":400},1,"a",3.14])")}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json from obejct data_set = { @@ -1542,7 +1567,7 @@ TEST(FunctionJsonbTEST, GetJSONSTRINGTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json from array data_set = { @@ -1604,7 +1629,7 @@ TEST(FunctionJsonbTEST, GetJSONSTRINGTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json with path $[0].k1 data_set = { @@ -1629,7 +1654,7 @@ TEST(FunctionJsonbTEST, GetJSONSTRINGTest) { STRING("v41")}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, GetJsonIntTest) { @@ -1659,7 +1684,7 @@ TEST(FunctionJsonbTEST, GetJsonIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json from obejct data_set = { @@ -1684,7 +1709,7 @@ TEST(FunctionJsonbTEST, GetJsonIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json from array data_set = { @@ -1745,7 +1770,7 @@ TEST(FunctionJsonbTEST, GetJsonIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json with path $[0].k1 data_set = { @@ -1772,7 +1797,7 @@ TEST(FunctionJsonbTEST, GetJsonIntTest) { INT(400)}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, GetJsonBigIntTest) { @@ -1802,7 +1827,7 @@ TEST(FunctionJsonbTEST, GetJsonBigIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json from obejct data_set = { @@ -1827,7 +1852,7 @@ TEST(FunctionJsonbTEST, GetJsonBigIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json from array data_set = { @@ -1888,7 +1913,7 @@ TEST(FunctionJsonbTEST, GetJsonBigIntTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json with path $[0].k1 data_set = { @@ -1915,7 +1940,7 @@ TEST(FunctionJsonbTEST, GetJsonBigIntTest) { BIGINT(400)}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionJsonbTEST, GetJsonDoubleTest) { @@ -1945,7 +1970,7 @@ TEST(FunctionJsonbTEST, GetJsonDoubleTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json from obejct data_set = { @@ -1969,7 +1994,7 @@ TEST(FunctionJsonbTEST, GetJsonDoubleTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json from array data_set = { @@ -2029,7 +2054,7 @@ TEST(FunctionJsonbTEST, GetJsonDoubleTest) { Null()}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); // get json with path $[0].k1 data_set = { @@ -2055,6 +2080,6 @@ TEST(FunctionJsonbTEST, GetJsonDoubleTest) { DOUBLE(400)}, // complex array }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } // namespace doris::vectorized diff --git a/be/test/vec/function/function_like_test.cpp b/be/test/vec/function/function_like_test.cpp index 488fda5eb1..44fcb67f3e 100644 --- a/be/test/vec/function/function_like_test.cpp +++ b/be/test/vec/function/function_like_test.cpp @@ -69,8 +69,8 @@ TEST(FunctionLikeTest, like) { InputTypeSet const_pattern_input_types = {TypeIndex::String, Consted {TypeIndex::String}}; for (const auto& line : data_set) { DataSet const_pattern_dataset = {line}; - check_function(func_name, const_pattern_input_types, - const_pattern_dataset); + static_cast(check_function(func_name, const_pattern_input_types, + const_pattern_dataset)); } } @@ -105,8 +105,8 @@ TEST(FunctionLikeTest, regexp) { InputTypeSet const_pattern_input_types = {TypeIndex::String, Consted {TypeIndex::String}}; for (const auto& line : data_set) { DataSet const_pattern_dataset = {line}; - check_function(func_name, const_pattern_input_types, - const_pattern_dataset); + static_cast(check_function(func_name, const_pattern_input_types, + const_pattern_dataset)); } } @@ -144,8 +144,8 @@ TEST(FunctionLikeTest, regexp_extract) { TypeIndex::Int64}; for (const auto& line : data_set) { DataSet const_pattern_dataset = {line}; - check_function(func_name, const_pattern_input_types, - const_pattern_dataset); + static_cast(check_function(func_name, const_pattern_input_types, + const_pattern_dataset)); } } @@ -175,8 +175,8 @@ TEST(FunctionLikeTest, regexp_extract_all) { InputTypeSet const_pattern_input_types = {TypeIndex::String, Consted {TypeIndex::String}}; for (const auto& line : data_set) { DataSet const_pattern_dataset = {line}; - check_function(func_name, const_pattern_input_types, - const_pattern_dataset); + static_cast(check_function(func_name, const_pattern_input_types, + const_pattern_dataset)); } } @@ -205,8 +205,8 @@ TEST(FunctionLikeTest, regexp_replace) { TypeIndex::String}; for (const auto& line : data_set) { DataSet const_pattern_dataset = {line}; - check_function(func_name, const_pattern_input_types, - const_pattern_dataset); + static_cast(check_function(func_name, const_pattern_input_types, + const_pattern_dataset)); } } @@ -235,8 +235,8 @@ TEST(FunctionLikeTest, regexp_replace_one) { TypeIndex::String}; for (const auto& line : data_set) { DataSet const_pattern_dataset = {line}; - check_function(func_name, const_pattern_input_types, - const_pattern_dataset); + static_cast(check_function(func_name, const_pattern_input_types, + const_pattern_dataset)); } } diff --git a/be/test/vec/function/function_math_test.cpp b/be/test/vec/function/function_math_test.cpp index 3637066eef..4fbee8289b 100644 --- a/be/test/vec/function/function_math_test.cpp +++ b/be/test/vec/function/function_math_test.cpp @@ -48,7 +48,7 @@ TEST(MathFunctionTest, acos_test) { //{{3.14},nan("")}, {{1.0}, 0.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, asin_test) { @@ -59,7 +59,7 @@ TEST(MathFunctionTest, asin_test) { DataSet data_set = { {{-1.0}, -M_PI / 2}, {{0.0}, 0.0}, {{0.5}, 0.52359877559829893}, {{1.0}, M_PI / 2}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, atan_test) { @@ -72,7 +72,7 @@ TEST(MathFunctionTest, atan_test) { {{0.5}, 0.46364760900080609}, {{1.0}, 0.78539816339744828}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, cos_test) { @@ -86,7 +86,7 @@ TEST(MathFunctionTest, cos_test) { {{M_PI}, -1.0}, {{1.0}, 0.54030230586813977}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, sin_test) { @@ -100,7 +100,7 @@ TEST(MathFunctionTest, sin_test) { {{M_PI / 2}, 1.0}, {{1.0}, 0.8414709848078965}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, sqrt_test) { @@ -113,7 +113,7 @@ TEST(MathFunctionTest, sqrt_test) { {{9.0}, 3.0}, {{1000.0}, 31.622776601683793}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, cbrt_test) { @@ -124,7 +124,7 @@ TEST(MathFunctionTest, cbrt_test) { DataSet data_set = { {{0.0}, 0.0}, {{2.0}, 1.2599210498948734}, {{8.0}, 2.0}, {{-1000.0}, -10.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, tan_test) { @@ -137,7 +137,7 @@ TEST(MathFunctionTest, tan_test) { {{-1.0}, -1.5574077246549023}, {{1000.0}, 1.4703241557027185}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, exp_test) { @@ -151,7 +151,7 @@ TEST(MathFunctionTest, exp_test) { {{-800.0}, 0.0}, {{1.0}, 2.7182818284590451}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, ln_test) { @@ -165,7 +165,7 @@ TEST(MathFunctionTest, ln_test) { {{100.0}, 4.6051701859880918}, {{1000.0}, 6.9077552789821368}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, log2_test) { @@ -179,7 +179,7 @@ TEST(MathFunctionTest, log2_test) { {{1000.0}, 9.965784284662087}, {{-1.0}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, log10_test) { @@ -193,7 +193,7 @@ TEST(MathFunctionTest, log10_test) { {{-1.0}, Null()}, {{1000.0}, 3.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, log_test) { @@ -205,7 +205,7 @@ TEST(MathFunctionTest, log_test) { {{10.0, 1.0}, 0.0}, {{10.0, 100.0}, 2.0}, {{0.1, 5.0}, -0.69897000433601886}, {{-2.0, 5.0}, Null()}, {{2.0, -5.0}, Null()}, {{2.0, 0.5}, -1.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, pow_test) { @@ -218,7 +218,7 @@ TEST(MathFunctionTest, pow_test) { {{100.0, -2.0}, 0.0001}, {{2.0, 0.5}, 1.4142135623730951}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, ceil_test) { @@ -228,7 +228,7 @@ TEST(MathFunctionTest, ceil_test) { DataSet data_set = {{{2.3}, 3.0}, {{2.8}, 3.0}, {{-2.3}, -2.0}, {{2.8}, 3.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, floor_test) { @@ -238,7 +238,7 @@ TEST(MathFunctionTest, floor_test) { DataSet data_set = {{{2.3}, 2.0}, {{2.8}, 2.0}, {{-2.3}, -3.0}, {{-2.8}, -3.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, degrees_test) { @@ -251,7 +251,7 @@ TEST(MathFunctionTest, degrees_test) { {{0.0}, 0.0}, {{-2.0}, -114.59155902616465}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, radians_test) { @@ -264,7 +264,7 @@ TEST(MathFunctionTest, radians_test) { {{0.0}, 0.0}, {{-60.0}, -1.0471975511965976}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, abs_test) { @@ -279,7 +279,7 @@ TEST(MathFunctionTest, abs_test) { {{0.0}, 0.0}, {{-60.0}, 60.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -293,7 +293,7 @@ TEST(MathFunctionTest, abs_test) { {{INT(INT_MAX)}, BIGINT(INT_MAX)}, {{INT(INT_MIN)}, BIGINT(-1ll * INT_MIN)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -305,7 +305,7 @@ TEST(MathFunctionTest, positive_test) { DataSet data_set = {{{0.0123}, 0.0123}, {{90.45}, 90.45}, {{0.0}, 0.0}, {{-60.0}, -60.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -316,7 +316,7 @@ TEST(MathFunctionTest, positive_test) { {{(int32_t)0}, (int32_t)0}, {{(int32_t)-60}, (int32_t)-60}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -328,7 +328,7 @@ TEST(MathFunctionTest, negative_test) { DataSet data_set = {{{0.0123}, -0.0123}, {{90.45}, -90.45}, {{0.0}, 0.0}, {{-60.0}, 60.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -339,7 +339,7 @@ TEST(MathFunctionTest, negative_test) { {{(int32_t)0}, (int32_t)0}, {{(int32_t)-60}, (int32_t)60}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -353,14 +353,14 @@ TEST(MathFunctionTest, sign_test) { {{(int32_t)0}, (int8_t)0.0}, {{(int32_t)-10}, (int8_t)-1.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::Float64}; DataSet data_set = {{{30.7}, (int8_t)1.0}, {{0.0}, (int8_t)0.0}, {{-10.6}, (int8_t)-1.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -373,7 +373,7 @@ TEST(MathFunctionTest, round_test) { DataSet data_set = {{{30.1}, 30.0}, {{90.6}, 91.0}, {{Null()}, Null()}, {{0.0}, 0.0}, {{-1.1}, -1.0}, {{-60.7}, -61.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -385,7 +385,7 @@ TEST(MathFunctionTest, round_bankers_test) { DataSet data_set = {{{0.4}, 0.0}, {{-3.5}, -4.0}, {{4.5}, 4.0}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -397,7 +397,7 @@ TEST(MathFunctionTest, least_test) { DataSet data_set = { {{3, 2}, 2}, {{3, 3}, 3}, {{Null(), -2}, Null()}, {{193, -2}, -2}, {{193, -1}, -1}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, greatest_test) { @@ -408,7 +408,7 @@ TEST(MathFunctionTest, greatest_test) { DataSet data_set = { {{3, 2}, 3}, {{3, 3}, 3}, {{Null(), -2}, Null()}, {{193, -2}, 193}, {{193, -1}, 193}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, bin_test) { @@ -421,7 +421,7 @@ TEST(MathFunctionTest, bin_test) { {{(int64_t)0}, std::string("0")}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, hex_test) { @@ -439,7 +439,7 @@ TEST(MathFunctionTest, hex_test) { {{(int64_t)9223372036854775807}, std::string("7FFFFFFFFFFFFFFF")}, {{(int64_t)-7453337203775808}, std::string("FFE5853AB393E6C0")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(MathFunctionTest, random_test) { @@ -454,7 +454,7 @@ TEST(MathFunctionTest, random_test) { for (const auto& data : data_set) { DataSet data_line = {data}; - check_function(func_name, input_types, data_line); + static_cast(check_function(func_name, input_types, data_line)); } } @@ -469,7 +469,8 @@ TEST(MathFunctionTest, conv_test) { for (const auto& data : data_set) { DataSet data_line = {data}; - check_function(func_name, input_types, data_line); + static_cast( + check_function(func_name, input_types, data_line)); } } @@ -480,7 +481,8 @@ TEST(MathFunctionTest, conv_test) { for (const auto& data : data_set) { DataSet data_line = {data}; - check_function(func_name, input_types, data_line); + static_cast( + check_function(func_name, input_types, data_line)); } } } @@ -494,7 +496,7 @@ TEST(MathFunctionTest, money_format_test) { {{BIGINT(17014116)}, VARCHAR("17,014,116.00")}, {{BIGINT(-17014116)}, VARCHAR("-17,014,116.00")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -503,7 +505,7 @@ TEST(MathFunctionTest, money_format_test) { {{LARGEINT(17014116)}, VARCHAR("17,014,116.00")}, {{LARGEINT(-17014116)}, VARCHAR("-17,014,116.00")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::Float64}; @@ -511,7 +513,7 @@ TEST(MathFunctionTest, money_format_test) { {{DOUBLE(17014116.67)}, VARCHAR("17,014,116.67")}, {{DOUBLE(-17014116.67)}, VARCHAR("-17,014,116.67")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::Decimal128}; @@ -519,7 +521,7 @@ TEST(MathFunctionTest, money_format_test) { {{DECIMAL(17014116.67)}, VARCHAR("17,014,116.67")}, {{DECIMAL(-17014116.67)}, VARCHAR("-17,014,116.67")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } diff --git a/be/test/vec/function/function_nullif_test.cpp b/be/test/vec/function/function_nullif_test.cpp index 33586c9ddf..c47aacc129 100644 --- a/be/test/vec/function/function_nullif_test.cpp +++ b/be/test/vec/function/function_nullif_test.cpp @@ -35,7 +35,7 @@ TEST(NullIfTest, Int_Test) { InputTypeSet input_types = {TypeIndex::Int32, TypeIndex::Int32}; DataSet data_set = {{{4, 10}, 4}, {{-4, -4}, Null()}, {{5, Null()}, 5}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(NullIfTest, Float_Test) { @@ -43,7 +43,7 @@ TEST(NullIfTest, Float_Test) { InputTypeSet input_types = {TypeIndex::Float64, TypeIndex::Float64}; DataSet data_set = {{{4.0, 10.0}, 4.0}, {{-4.0, -4.0}, Null()}, {{5.0, Null()}, 5.0}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(NullIfTest, String_Int_Test) { @@ -56,7 +56,7 @@ TEST(NullIfTest, String_Int_Test) { {{std::string("2021-10-24 13:00:01"), Null()}, str_to_date_time("2021-10-24 13:00:01")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } // namespace doris::vectorized diff --git a/be/test/vec/function/function_string_test.cpp b/be/test/vec/function/function_string_test.cpp index aad6a7e6b0..43bfb958cc 100644 --- a/be/test/vec/function/function_string_test.cpp +++ b/be/test/vec/function/function_string_test.cpp @@ -57,7 +57,7 @@ TEST(function_string_test, function_string_substr_test) { {{std::string("123"), 1, 0}, std::string("")}, {{Null(), 5, 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -75,7 +75,7 @@ TEST(function_string_test, function_string_substr_test) { {{std::string("123"), 0}, std::string("")}, {{Null(), 5, 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -90,7 +90,7 @@ TEST(function_string_test, function_string_strright_test) { {{std::string(""), 3}, std::string("")}, {{Null(), 3}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_strleft_test) { @@ -107,7 +107,7 @@ TEST(function_string_test, function_string_strleft_test) { {{std::string("123"), 0}, std::string("")}, {{Null(), 3}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_lower_test) { @@ -119,7 +119,7 @@ TEST(function_string_test, function_string_lower_test) { {{std::string("HELLO,!^%")}, std::string("hello,!^%")}, {{std::string("")}, std::string("")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_upper_test) { @@ -131,7 +131,7 @@ TEST(function_string_test, function_string_upper_test) { {{std::string("MYtestStr")}, std::string("MYTESTSTR")}, {{std::string("")}, std::string("")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_trim_test) { @@ -144,7 +144,7 @@ TEST(function_string_test, function_string_trim_test) { {{Null()}, Null()}, {{std::string("")}, std::string("")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_ltrim_test) { @@ -156,7 +156,7 @@ TEST(function_string_test, function_string_ltrim_test) { {{std::string(" HELLO,!^%")}, std::string("HELLO,!^%")}, {{std::string(" 你好MY test Str你好 ")}, std::string("你好MY test Str你好 ")}, {{std::string("")}, std::string("")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_rtrim_test) { @@ -168,7 +168,7 @@ TEST(function_string_test, function_string_rtrim_test) { {{std::string(" MY test Str你好 ")}, std::string(" MY test Str你好")}, {{std::string("")}, std::string("")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_repeat_test) { std::string func_name = "repeat"; @@ -182,7 +182,7 @@ TEST(function_string_test, function_string_repeat_test) { {{std::string("a"), 1073741825}, std::string("aaaaaaaaaa")}, // ut repeat max num 10 {{std::string("HELLO,!^%"), 2}, std::string("HELLO,!^%HELLO,!^%")}, {{std::string("你"), 2}, std::string("你你")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_reverse_test) { @@ -194,7 +194,7 @@ TEST(function_string_test, function_string_reverse_test) { {{std::string("你好啊")}, std::string("啊好你")}, {{std::string("")}, std::string("")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_string_length_test) { @@ -206,7 +206,7 @@ TEST(function_string_test, function_string_length_test) { {{std::string("你好啊")}, int32_t(9)}, {{std::string("")}, int32_t(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_append_trailing_char_if_absent_test) { @@ -219,7 +219,7 @@ TEST(function_string_test, function_append_trailing_char_if_absent_test) { {{std::string(""), std::string("")}, Null()}, {{std::string(""), std::string("A")}, std::string("A")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_starts_with_test) { @@ -234,7 +234,7 @@ TEST(function_string_test, function_starts_with_test) { {{std::string("你好"), Null()}, Null()}, {{Null(), std::string("")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_ends_with_test) { @@ -249,7 +249,7 @@ TEST(function_string_test, function_ends_with_test) { {{std::string("你好"), Null()}, Null()}, {{Null(), std::string("")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_lpad_test) { @@ -270,7 +270,7 @@ TEST(function_string_test, function_lpad_test) { {{std::string("hi"), 5, std::string("呵呵")}, std::string("呵呵呵hi")}, {{std::string("呵呵"), 5, std::string("hi")}, std::string("hih呵呵")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_rpad_test) { @@ -291,7 +291,7 @@ TEST(function_string_test, function_rpad_test) { {{std::string("hi"), 5, std::string("呵呵")}, std::string("hi呵呵呵")}, {{std::string("呵呵"), 5, std::string("hi")}, std::string("呵呵hih")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_ascii_test) { @@ -304,7 +304,7 @@ TEST(function_string_test, function_ascii_test) { {{std::string("我")}, 230}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_char_length_test) { @@ -317,7 +317,7 @@ TEST(function_string_test, function_char_length_test) { {{std::string("a我")}, 2}, {{std::string("123")}, 3}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_concat_test) { @@ -329,7 +329,7 @@ TEST(function_string_test, function_concat_test) { {{std::string("123")}, std::string("123")}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -339,7 +339,7 @@ TEST(function_string_test, function_concat_test) { {{std::string("123"), std::string("45")}, std::string("12345")}, {{std::string("123"), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -351,7 +351,7 @@ TEST(function_string_test, function_concat_test) { std::string("123456789")}, {{std::string("123"), Null(), std::string("789")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; } @@ -365,7 +365,7 @@ TEST(function_string_test, function_elt_test) { {{1, std::string("你好"), std::string("百度")}, std::string("你好")}, {{1, std::string("hello"), std::string("")}, std::string("hello")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -375,7 +375,7 @@ TEST(function_string_test, function_elt_test) { {{2, std::string("你好"), std::string("百度")}, std::string("百度")}, {{2, std::string("hello"), std::string("")}, std::string("")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -385,7 +385,7 @@ TEST(function_string_test, function_elt_test) { {{0, std::string("你好"), std::string("百度")}, Null()}, {{0, std::string("hello"), std::string("")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -395,7 +395,7 @@ TEST(function_string_test, function_elt_test) { {{3, std::string("你好"), std::string("百度")}, Null()}, {{3, std::string("hello"), std::string("")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; } @@ -410,7 +410,7 @@ TEST(function_string_test, function_concat_ws_test) { {{Null(), std::string("")}, Null()}, {{Null(), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -423,7 +423,7 @@ TEST(function_string_test, function_concat_ws_test) { {{Null(), std::string(""), std::string("")}, Null()}, {{Null(), std::string(""), Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -441,7 +441,7 @@ TEST(function_string_test, function_concat_ws_test) { {{std::string("-"), std::string("123"), Null(), std::string("456")}, std::string("123-456")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; { @@ -458,7 +458,7 @@ TEST(function_string_test, function_concat_ws_test) { {{Null(), vec4}, Null()}, {{std::string("-"), vec5}, std::string("abc-def-ghi")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); }; } @@ -472,7 +472,7 @@ TEST(function_string_test, function_null_or_empty_test) { {{std::string("我")}, uint8(false)}, {{Null()}, uint8(true)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_to_base64_test) { @@ -486,7 +486,7 @@ TEST(function_string_test, function_to_base64_test) { {{std::string("MYtestSTR")}, {std::string("TVl0ZXN0U1RS")}}, {{std::string("ò&ø")}, {std::string("w7Imw7g=")}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_from_base64_test) { @@ -502,7 +502,7 @@ TEST(function_string_test, function_from_base64_test) { {{std::string("ò&ø")}, {Null()}}, {{std::string("你好哈喽")}, {Null()}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_reverse_test) { @@ -517,7 +517,7 @@ TEST(function_string_test, function_reverse_test) { {{std::string("A攀c")}, {std::string("c攀A")}}, {{std::string("NULL")}, {std::string("LLUN")}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_instr_test) { @@ -531,7 +531,7 @@ TEST(function_string_test, function_instr_test) { {{STRING("abcdef"), STRING("")}, INT(1)}, {{STRING(""), STRING("")}, INT(1)}, {{STRING("aaaab"), STRING("bb")}, INT(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_locate_test) { @@ -548,7 +548,7 @@ TEST(function_string_test, function_locate_test) { {{STRING(""), STRING("")}, INT(1)}, {{STRING("bb"), STRING("aaaab")}, INT(0)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -562,7 +562,7 @@ TEST(function_string_test, function_locate_test) { {{STRING("A"), STRING("大A写的A"), INT(2)}, INT(2)}, {{STRING("A"), STRING("大A写的A"), INT(3)}, INT(5)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -579,7 +579,7 @@ TEST(function_string_test, function_find_in_set_test) { {{std::string("a"), std::string("")}, 0}, {{std::string(""), std::string(",,")}, 1}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_md5sum_test) { @@ -597,7 +597,7 @@ TEST(function_string_test, function_md5sum_test) { {{std::string("MYtestSTR")}, {std::string("cd24c90b3fc1192eb1879093029e87d4")}}, {{std::string("ò&ø")}, {std::string("fd157b4cb921fa91acc667380184d59c")}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -610,7 +610,7 @@ TEST(function_string_test, function_md5sum_test) { {std::string("b8e6e34d1cc3dc76b784ddfdfb7df800")}}, {{Null(), std::string("HELLO")}, {Null()}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -623,7 +623,7 @@ TEST(function_string_test, function_md5sum_test) { {std::string("b8e6e34d1cc3dc76b784ddfdfb7df800")}}, {{Null(), std::string("HELLO"), Null()}, {Null()}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -650,7 +650,7 @@ TEST(function_string_test, function_sm3sum_test) { {std::string( "aa47ac31c85aa819d4cc80c932e7900fa26a3073a67aa7eb011bc2ba4924a066")}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -664,7 +664,7 @@ TEST(function_string_test, function_sm3sum_test) { {std::string("1f5866e786ebac9ffed0dbd8f2586e3e99d1d05f7efe7c5915478b57b7423570")}}, {{Null(), std::string("HELLO")}, {Null()}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -678,7 +678,7 @@ TEST(function_string_test, function_sm3sum_test) { {std::string("5fc6e38f40b31a659a59e1daba9b68263615f20c02037b419d9deb3509e6b5c6")}}, {{Null(), std::string("HELLO"), Null()}, {Null()}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -710,7 +710,7 @@ TEST(function_string_test, function_aes_encrypt_test) { {{std::string(src[5]), std::string(key), std::string(mode)}, Null()}, {{Null(), std::string(key), std::string(mode)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::String, TypeIndex::String, TypeIndex::String, @@ -746,7 +746,7 @@ TEST(function_string_test, function_aes_encrypt_test) { Null()}, {{Null(), std::string(key), std::string(iv), std::string(mode)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -777,7 +777,7 @@ TEST(function_string_test, function_aes_decrypt_test) { {{r[4], std::string(key), std::string(mode)}, std::string(src[4])}, {{Null(), std::string(key), std::string(mode)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::String, TypeIndex::String, TypeIndex::String, @@ -810,7 +810,7 @@ TEST(function_string_test, function_aes_decrypt_test) { {{r[4], std::string(key), std::string(iv), std::string(mode)}, std::string(src[4])}, {{Null(), std::string(key), std::string(iv), std::string(mode)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -851,7 +851,7 @@ TEST(function_string_test, function_sm4_encrypt_test) { Null()}, {{Null(), std::string(key), std::string(iv), std::string(mode)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -889,7 +889,7 @@ TEST(function_string_test, function_sm4_encrypt_test) { Null()}, {{Null(), std::string(key), std::string(iv), std::string(mode)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -928,7 +928,7 @@ TEST(function_string_test, function_sm4_decrypt_test) { {{r[4], std::string(key), std::string(iv), std::string(mode)}, std::string(src[4])}, {{Null(), std::string(key), std::string(iv), std::string(mode)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -964,7 +964,7 @@ TEST(function_string_test, function_sm4_decrypt_test) { {{r[4], std::string(key), std::string(iv), std::string(mode)}, std::string(src[4])}, {{Null(), Null(), std::string(iv), std::string(mode)}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -990,7 +990,7 @@ TEST(function_string_test, function_extract_url_parameter_test) { {{VARCHAR("http://doris.apache.org?k1=aa&k2=bb&test=dd#999/"), VARCHAR("test")}, {VARCHAR("dd")}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_parse_url_test) { @@ -1031,7 +1031,7 @@ TEST(function_string_test, function_parse_url_test) { {{std::string("http://fb.com/path/p1.p?q=1#f"), std::string("QUERY")}, {std::string("q=1")}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -1049,7 +1049,7 @@ TEST(function_string_test, function_parse_url_test) { std::string("q")}, {Null()}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1066,7 +1066,7 @@ TEST(function_string_test, function_hex_test) { {{std::string("我")}, std::string("E68891")}, {{std::string("?")}, std::string("3F")}, {{std::string("?")}, std::string("EFBC9F")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_unhex_test) { @@ -1081,7 +1081,7 @@ TEST(function_string_test, function_unhex_test) { {{std::string("41")}, std::string("A")}, {{std::string("313233")}, std::string("123")}, {{std::string("EFBC9F")}, std::string("?")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_coalesce_test) { @@ -1092,7 +1092,7 @@ TEST(function_string_test, function_coalesce_test) { {{Null(), Null(), (int32_t)2}, {(int32_t)2}}, {{Null(), Null(), (int32_t)3}, {(int32_t)3}}, {{Null(), Null(), (int32_t)4}, {(int32_t)4}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -1103,7 +1103,7 @@ TEST(function_string_test, function_coalesce_test) { {{std::string("zxcv"), Null(), (int32_t)3}, {std::string("zxcv")}}, {{std::string("vbnm"), Null(), (int32_t)4}, {std::string("vbnm")}}, }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -1113,7 +1113,7 @@ TEST(function_string_test, function_coalesce_test) { {{Null(), std::string("def"), std::string("klm")}, {std::string("def")}}, {{Null(), std::string(""), std::string("xyz")}, {std::string("")}}, {{Null(), Null(), std::string("uvw")}, {std::string("uvw")}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1133,7 +1133,7 @@ TEST(function_string_test, function_str_to_date_test) { str_to_date_time("2011-11-09", false)}, {{std::string("2020-09-01"), std::string("%Y-%m-%d %H:%i:%s")}, str_to_date_time("2020-09-01 00:00:00", false)}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_replace) { @@ -1149,7 +1149,7 @@ TEST(function_string_test, function_replace) { {{VARCHAR("aaaaa"), VARCHAR("a"), VARCHAR("")}, {VARCHAR("")}}, {{VARCHAR("aaaaa"), VARCHAR("aa"), VARCHAR("")}, {VARCHAR("a")}}, {{VARCHAR("aaaaa"), VARCHAR("aa"), VARCHAR("a")}, {VARCHAR("aaa")}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(function_string_test, function_bit_length_test) { @@ -1164,7 +1164,7 @@ TEST(function_string_test, function_bit_length_test) { {{std::string("hello你好")}, 88}, {{std::string("313233")}, 48}, {{std::string("EFBC9F")}, 48}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } // namespace doris::vectorized diff --git a/be/test/vec/function/function_test_util.cpp b/be/test/vec/function/function_test_util.cpp index c61d272cca..3a9a141b01 100644 --- a/be/test/vec/function/function_test_util.cpp +++ b/be/test/vec/function/function_test_util.cpp @@ -369,7 +369,7 @@ Block* process_table_function(TableFunction* fn, Block* input_block, do { fn->get_value(column); - fn->forward(); + static_cast(fn->forward()); } while (!fn->eos()); } diff --git a/be/test/vec/function/function_test_util.h b/be/test/vec/function/function_test_util.h index f7b72c935f..62e4f6fd00 100644 --- a/be/test/vec/function/function_test_util.h +++ b/be/test/vec/function/function_test_util.h @@ -274,8 +274,8 @@ Status check_function(const std::string& func_name, const InputTypeSet& input_ty FunctionUtils fn_utils(fn_ctx_return, arg_types, 0); auto* fn_ctx = fn_utils.get_fn_ctx(); fn_ctx->set_constant_cols(constant_cols); - func->open(fn_ctx, FunctionContext::FRAGMENT_LOCAL); - func->open(fn_ctx, FunctionContext::THREAD_LOCAL); + static_cast(func->open(fn_ctx, FunctionContext::FRAGMENT_LOCAL)); + static_cast(func->open(fn_ctx, FunctionContext::THREAD_LOCAL)); block.insert({nullptr, return_type, "result"}); @@ -288,8 +288,8 @@ Status check_function(const std::string& func_name, const InputTypeSet& input_ty EXPECT_EQ(Status::OK(), st); } - func->close(fn_ctx, FunctionContext::THREAD_LOCAL); - func->close(fn_ctx, FunctionContext::FRAGMENT_LOCAL); + static_cast(func->close(fn_ctx, FunctionContext::THREAD_LOCAL)); + static_cast(func->close(fn_ctx, FunctionContext::FRAGMENT_LOCAL)); // 3. check the result of function ColumnPtr column = block.get_columns()[result]; diff --git a/be/test/vec/function/function_time_test.cpp b/be/test/vec/function/function_time_test.cpp index 101ba3cc97..56f49ec6c9 100644 --- a/be/test/vec/function/function_time_test.cpp +++ b/be/test/vec/function/function_time_test.cpp @@ -46,7 +46,7 @@ TEST(VTimestampFunctionsTest, day_of_week_test) { {{std::string("2020-00-01 00:00:00")}, Null()}, {{std::string("2020-01-00 00:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, day_of_month_test) { @@ -58,7 +58,7 @@ TEST(VTimestampFunctionsTest, day_of_month_test) { {{std::string("2020-01-01 00:00:00")}, int8_t {1}}, {{std::string("2020-02-29 00:00:00")}, int8_t {29}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, day_of_year_test) { @@ -70,7 +70,7 @@ TEST(VTimestampFunctionsTest, day_of_year_test) { {{std::string("2020-01-00 00:00:00")}, Null()}, {{std::string("2020-02-29 00:00:00")}, int16_t {60}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, week_of_year_test) { @@ -82,7 +82,7 @@ TEST(VTimestampFunctionsTest, week_of_year_test) { {{std::string("2020-01-00 00:00:00")}, Null()}, {{std::string("2020-02-29 00:00:00")}, int8_t {9}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, year_test) { @@ -94,7 +94,7 @@ TEST(VTimestampFunctionsTest, year_test) { {{std::string("2021-01-00 00:00:00")}, Null()}, {{std::string("2025-05-01 00:00:00")}, int16_t {2025}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, quarter_test) { @@ -107,7 +107,7 @@ TEST(VTimestampFunctionsTest, quarter_test) { {{std::string("2021-01-32 00:00:00")}, Null()}, {{std::string("2025-10-23 00:00:00")}, int8_t {4}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, month_test) { @@ -120,7 +120,7 @@ TEST(VTimestampFunctionsTest, month_test) { {{std::string("2021-01-32 00:00:00")}, Null()}, {{std::string("2025-05-23 00:00:00")}, int8_t {5}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, day_test) { @@ -133,7 +133,7 @@ TEST(VTimestampFunctionsTest, day_test) { {{std::string("2021-01-32 00:00:00")}, Null()}, {{std::string("2025-05-23 00:00:00")}, int8_t {23}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, hour_test) { @@ -146,7 +146,7 @@ TEST(VTimestampFunctionsTest, hour_test) { {{std::string("")}, Null()}, {{std::string("2025-05-23 24:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, minute_test) { @@ -159,7 +159,7 @@ TEST(VTimestampFunctionsTest, minute_test) { {{std::string("")}, Null()}, {{std::string("2025-05-23 24:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, second_test) { @@ -172,7 +172,7 @@ TEST(VTimestampFunctionsTest, second_test) { {{std::string("")}, Null()}, {{std::string("2025-05-23 24:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, from_unix_test) { @@ -183,7 +183,7 @@ TEST(VTimestampFunctionsTest, from_unix_test) { DataSet data_set = {{{1565080737}, std::string("2019-08-06 16:38:57")}, {{-123}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, timediff_test) { @@ -198,7 +198,7 @@ TEST(VTimestampFunctionsTest, timediff_test) { {{std::string("2019-00-18 12:00:00"), std::string("2019-07-18 13:01:02")}, Null()}, {{std::string("2019-07-18 12:00:00"), std::string("2019-07-00 13:01:02")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, convert_tz_test) { @@ -213,7 +213,8 @@ TEST(VTimestampFunctionsTest, convert_tz_test) { DataSet data_set = {{{std::string {"2019-08-01 02:18:27"}, std::string {"Asia/SHANGHAI"}, std::string {"america/Los_angeles"}}, Null()}}; - check_function(func_name, input_types, data_set, false); + static_cast( + check_function(func_name, input_types, data_set, false)); } { @@ -229,7 +230,8 @@ TEST(VTimestampFunctionsTest, convert_tz_test) { {{std::string {"2019-08-01 02:18:27"}, std::string {"Asia/SHANGHAI"}, std::string {"america/Los_angeles"}}, Null()}}; - check_function(func_name, input_types, data_set, false); + static_cast( + check_function(func_name, input_types, data_set, false)); } { @@ -247,7 +249,8 @@ TEST(VTimestampFunctionsTest, convert_tz_test) { str_to_datetime_v2("2019-07-31 11:18:27", "%Y-%m-%d %H:%i:%s.%f")}}; TimezoneUtils::load_timezone_names(); TimezoneUtils::load_timezones_to_cache(); - check_function(func_name, input_types, data_set, false); + static_cast( + check_function(func_name, input_types, data_set, false)); } } @@ -259,45 +262,45 @@ TEST(VTimestampFunctionsTest, date_format_test) { DataSet data_set = {{{std::string("2009-10-04 22:23:00"), std::string("%W %M %Y")}, std::string("Sunday October 2009")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { DataSet data_set = {{{std::string("2007-10-04 22:23:00"), std::string("%H:%i:%s")}, std::string("22:23:00")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { DataSet data_set = { {{std::string("1900-10-04 22:23:00"), std::string("%D %y %a %d %m %b %j")}, std::string("4th 00 Thu 04 10 Oct 277")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { DataSet data_set = { {{std::string("1997-10-04 22:23:00"), std::string("%H %k %I %r %T %S %w")}, std::string("22 22 10 10:23:00 PM 22:23:00 00 6")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { DataSet data_set = {{{std::string("1999-01-01 00:00:00"), std::string("%X %V")}, std::string("1998 52")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { DataSet data_set = { {{std::string("2006-06-01 00:00:00"), std::string("%d")}, std::string("01")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { DataSet data_set = { {{std::string("2006-06-01 00:00:00"), std::string("%%%d")}, std::string("%01")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } TEST(VTimestampFunctionsTest, years_add_test) { @@ -312,7 +315,7 @@ TEST(VTimestampFunctionsTest, years_add_test) { {{std::string("2020-05-23 00:00:00"), 8000}, Null()}, {{Null(), 5}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, years_sub_test) { @@ -327,7 +330,7 @@ TEST(VTimestampFunctionsTest, years_sub_test) { {{std::string("2020-05-23 00:00:00"), 3000}, Null()}, {{Null(), 5}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, months_add_test) { @@ -342,7 +345,7 @@ TEST(VTimestampFunctionsTest, months_add_test) { {{std::string("2020-05-23 00:00:00"), 10}, str_to_date_time("2021-03-23 00:00:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, months_sub_test) { @@ -357,7 +360,7 @@ TEST(VTimestampFunctionsTest, months_sub_test) { {{std::string("2020-05-23 00:00:00"), 10}, str_to_date_time("2019-07-23 00:00:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, days_add_test) { @@ -372,7 +375,7 @@ TEST(VTimestampFunctionsTest, days_add_test) { {{std::string("2020-05-23 00:00:00"), 10}, str_to_date_time("2020-06-2 00:00:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, days_sub_test) { @@ -387,7 +390,7 @@ TEST(VTimestampFunctionsTest, days_sub_test) { {{std::string("2020-05-23 00:00:00"), 31}, str_to_date_time("2020-04-22 00:00:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, hours_add_test) { @@ -402,7 +405,7 @@ TEST(VTimestampFunctionsTest, hours_add_test) { {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-27 14:00:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, hours_sub_test) { @@ -417,7 +420,7 @@ TEST(VTimestampFunctionsTest, hours_sub_test) { {{std::string("2020-05-23 10:00:00"), 31}, str_to_date_time("2020-05-22 03:00:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, minutes_add_test) { @@ -432,7 +435,7 @@ TEST(VTimestampFunctionsTest, minutes_add_test) { {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-23 11:40:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, minutes_sub_test) { @@ -447,7 +450,7 @@ TEST(VTimestampFunctionsTest, minutes_sub_test) { {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-23 08:20:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, seconds_add_test) { @@ -462,7 +465,7 @@ TEST(VTimestampFunctionsTest, seconds_add_test) { {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-23 10:01:40")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, seconds_sub_test) { @@ -477,7 +480,7 @@ TEST(VTimestampFunctionsTest, seconds_sub_test) { {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-23 09:58:20")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, weeks_add_test) { @@ -492,7 +495,7 @@ TEST(VTimestampFunctionsTest, weeks_add_test) { {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2022-04-23 10:00:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, weeks_sub_test) { @@ -507,7 +510,7 @@ TEST(VTimestampFunctionsTest, weeks_sub_test) { {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2018-06-23 10:00:00")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, to_days_test) { @@ -519,7 +522,7 @@ TEST(VTimestampFunctionsTest, to_days_test) { {{std::string("")}, Null()}, {{std::string("2021-01-32 00:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, date_test) { @@ -532,7 +535,7 @@ TEST(VTimestampFunctionsTest, date_test) { {{std::string("")}, Null()}, {{Null()}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, week_test) { @@ -544,14 +547,14 @@ TEST(VTimestampFunctionsTest, week_test) { {{std::string("")}, Null()}, {{std::string("9999-12-12 00:00:00")}, int8_t {50}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); InputTypeSet new_input_types = {TypeIndex::Date}; DataSet new_data_set = {{{std::string("1989-03-21")}, int8_t {12}}, {{std::string("")}, Null()}, {{std::string("9999-12-12")}, int8_t {50}}}; - check_function(func_name, new_input_types, new_data_set); + static_cast(check_function(func_name, new_input_types, new_data_set)); } TEST(VTimestampFunctionsTest, yearweek_test) { @@ -563,14 +566,15 @@ TEST(VTimestampFunctionsTest, yearweek_test) { {{std::string("")}, Null()}, {{std::string("9999-12-12 00:00:00")}, 999950}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); InputTypeSet new_input_types = {TypeIndex::Date}; DataSet new_data_set = {{{std::string("1989-03-21")}, 198912}, {{std::string("")}, Null()}, {{std::string("9999-12-12")}, 999950}}; - check_function(func_name, new_input_types, new_data_set); + static_cast( + check_function(func_name, new_input_types, new_data_set)); } TEST(VTimestampFunctionsTest, makedate_test) { @@ -586,7 +590,7 @@ TEST(VTimestampFunctionsTest, makedate_test) { {{-1, 3}, Null()}, {{12345, 3}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, weekday_test) { @@ -600,7 +604,7 @@ TEST(VTimestampFunctionsTest, weekday_test) { {{std::string("2020-00-01 00:00:00")}, Null()}, {{std::string("2020-01-00 00:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } InputTypeSet input_types = {TypeIndex::Date}; @@ -609,7 +613,7 @@ TEST(VTimestampFunctionsTest, weekday_test) { {{std::string("2020-00-01")}, Null()}, {{std::string("2020-01-00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(VTimestampFunctionsTest, day_of_week_v2_test) { @@ -622,7 +626,7 @@ TEST(VTimestampFunctionsTest, day_of_week_v2_test) { {{std::string("2020-00-01")}, Null()}, {{std::string("2020-01-00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -637,7 +641,7 @@ TEST(VTimestampFunctionsTest, day_of_week_v2_test) { {{std::string("2020-00-01 01:00:00")}, Null()}, {{std::string("2020-01-00 01:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -651,7 +655,7 @@ TEST(VTimestampFunctionsTest, day_of_month_v2_test) { {{std::string("2020-01-01")}, int8_t {1}}, {{std::string("2020-02-29")}, int8_t {29}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -660,7 +664,7 @@ TEST(VTimestampFunctionsTest, day_of_month_v2_test) { {{std::string("2020-01-01 01:00:00")}, int8_t {1}}, {{std::string("2020-02-29 01:00:00.123123")}, int8_t {29}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -674,7 +678,7 @@ TEST(VTimestampFunctionsTest, day_of_year_v2_test) { {{std::string("2020-01-00")}, Null()}, {{std::string("2020-02-29")}, int16_t {60}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -683,7 +687,7 @@ TEST(VTimestampFunctionsTest, day_of_year_v2_test) { {{std::string("2020-01-00 01:00:00")}, Null()}, {{std::string("2020-02-29 01:00:00.1232")}, int16_t {60}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -697,7 +701,7 @@ TEST(VTimestampFunctionsTest, week_of_year_v2_test) { {{std::string("2020-01-00")}, Null()}, {{std::string("2020-02-29")}, int8_t {9}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -707,7 +711,7 @@ TEST(VTimestampFunctionsTest, week_of_year_v2_test) { {{std::string("2020-02-29 01:00:00")}, int8_t {9}}, {{std::string("2020-02-29 01:00:00.12312")}, int8_t {9}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -721,7 +725,7 @@ TEST(VTimestampFunctionsTest, year_v2_test) { {{std::string("2021-01-00")}, Null()}, {{std::string("2025-05-01")}, int16_t {2025}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -730,7 +734,7 @@ TEST(VTimestampFunctionsTest, year_v2_test) { {{std::string("2021-01-00 01:00:00")}, Null()}, {{std::string("2025-05-01 01:00:00.123")}, int16_t {2025}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -745,7 +749,7 @@ TEST(VTimestampFunctionsTest, quarter_v2_test) { {{std::string("2021-01-32")}, Null()}, {{std::string("2025-10-23")}, int8_t {4}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -755,7 +759,7 @@ TEST(VTimestampFunctionsTest, quarter_v2_test) { {{std::string("2021-01-32 00:00:00")}, Null()}, {{std::string("2025-10-23 00:00:00")}, int8_t {4}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -770,7 +774,7 @@ TEST(VTimestampFunctionsTest, month_v2_test) { {{std::string("2021-01-32")}, Null()}, {{std::string("2025-05-23")}, int8_t {5}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -780,7 +784,7 @@ TEST(VTimestampFunctionsTest, month_v2_test) { {{std::string("2021-01-32 00:00:00")}, Null()}, {{std::string("2025-05-23 00:00:00")}, int8_t {5}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -795,7 +799,7 @@ TEST(VTimestampFunctionsTest, day_v2_test) { {{std::string("2021-01-32")}, Null()}, {{std::string("2025-05-23")}, int8_t {23}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -805,7 +809,7 @@ TEST(VTimestampFunctionsTest, day_v2_test) { {{std::string("2021-01-32 00:00:00")}, Null()}, {{std::string("2025-05-23 00:00:00")}, int8_t {23}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -819,7 +823,7 @@ TEST(VTimestampFunctionsTest, hour_v2_test) { {{std::string("2021-01-13")}, int8_t {0}}, {{std::string("")}, Null()}, {{std::string("2025-05-23")}, int8_t {0}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -829,7 +833,7 @@ TEST(VTimestampFunctionsTest, hour_v2_test) { {{std::string("")}, Null()}, {{std::string("2025-05-23 23:00:00.123")}, int8_t {23}}, {{std::string("2025-05-23 25:00:00.123")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -844,7 +848,7 @@ TEST(VTimestampFunctionsTest, minute_v2_test) { {{std::string("")}, Null()}, {{std::string("2025-05-23")}, int8_t {0}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -855,7 +859,7 @@ TEST(VTimestampFunctionsTest, minute_v2_test) { {{std::string("2025-05-23 00:22:22.123")}, int8_t {22}}, {{std::string("2025-05-23 00:60:22.123")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -870,7 +874,7 @@ TEST(VTimestampFunctionsTest, second_v2_test) { {{std::string("")}, Null()}, {{std::string("2025-05-23")}, int8_t {0}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -881,7 +885,7 @@ TEST(VTimestampFunctionsTest, second_v2_test) { {{std::string("2025-05-23 00:00:63.123")}, Null()}, {{std::string("2025-05-23 00:00:00.123")}, int8_t {0}}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -896,7 +900,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) { {{std::string("2019-00-18"), std::string("2019-07-18")}, Null()}, {{std::string("2019-07-18"), std::string("2019-07-00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -909,7 +913,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) { {{std::string("2019-00-18 00:00:00"), std::string("2019-07-18 00:00:00")}, Null()}, {{std::string("2019-07-18 00:00:00"), std::string("2019-07-00 00:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -924,7 +928,7 @@ TEST(VTimestampFunctionsTest, datediff_v2_test) { {{std::string("2019-00-18"), std::string("2019-07-18")}, Null()}, {{std::string("2019-07-18"), std::string("2019-07-00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -936,7 +940,7 @@ TEST(VTimestampFunctionsTest, datediff_v2_test) { {{std::string("2019-00-18 00:00:00.123"), std::string("2019-07-18")}, Null()}, {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -948,56 +952,56 @@ TEST(VTimestampFunctionsTest, date_format_v2_test) { DataSet data_set = {{{std::string("2009-10-04"), std::string("%W %M %Y")}, std::string("Sunday October 2009")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("2007-10-04"), std::string("%H:%i:%s")}, std::string("00:00:00")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; DataSet data_set = {{{std::string("1900-10-04"), std::string("%D %y %a %d %m %b %j")}, std::string("4th 00 Thu 04 10 Oct 277")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; DataSet data_set = {{{std::string("1999-01-01 00:00:00"), std::string("%X %V")}, std::string("1998 52")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("2006-06-01 00:00:00"), std::string("%d")}, std::string("01")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("2006-06-01 00:00:00"), std::string("%%%d")}, std::string("%01")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = {{{std::string("2009-10-04 22:23:00"), std::string("%W %M %Y")}, std::string("Sunday October 2009")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = {{{std::string("2007-10-04 22:23:00"), std::string("%H:%i:%s")}, std::string("22:23:00")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; @@ -1005,7 +1009,7 @@ TEST(VTimestampFunctionsTest, date_format_v2_test) { {{std::string("1900-10-04 22:23:00"), std::string("%D %y %a %d %m %b %j")}, std::string("4th 00 Thu 04 10 Oct 277")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; @@ -1013,28 +1017,28 @@ TEST(VTimestampFunctionsTest, date_format_v2_test) { {{std::string("1997-10-04 22:23:00"), std::string("%H %k %I %r %T %S %w")}, std::string("22 22 10 10:23:00 PM 22:23:00 00 6")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = {{{std::string("1999-01-01 00:00:00"), std::string("%X %V")}, std::string("1998 52")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("2006-06-01 00:00:00"), std::string("%d")}, std::string("01")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("2006-06-01 00:00:00"), std::string("%%%d")}, std::string("%01")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1051,7 +1055,7 @@ TEST(VTimestampFunctionsTest, years_add_v2_test) { {{std::string("2020-05-23"), 8000}, Null()}, {{Null(), 5}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -1065,7 +1069,8 @@ TEST(VTimestampFunctionsTest, years_add_v2_test) { {{std::string("2020-05-23 00:00:11.123"), 8000}, Null()}, {{Null(), 5}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1082,7 +1087,7 @@ TEST(VTimestampFunctionsTest, years_sub_v2_test) { {{std::string("2020-05-23"), 3000}, Null()}, {{Null(), 5}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; @@ -1095,7 +1100,8 @@ TEST(VTimestampFunctionsTest, years_sub_v2_test) { {{std::string("2020-05-23 00:00:11.123"), 3000}, Null()}, {{Null(), 5}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1112,7 +1118,7 @@ TEST(VTimestampFunctionsTest, months_add_v2_test) { {{std::string("2020-05-23"), 10}, str_to_date_v2("2021-03-23", "%Y-%m-%d")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; @@ -1126,7 +1132,8 @@ TEST(VTimestampFunctionsTest, months_add_v2_test) { str_to_datetime_v2("2021-03-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1143,7 +1150,7 @@ TEST(VTimestampFunctionsTest, months_sub_v2_test) { {{std::string("2020-05-23"), 10}, str_to_date_v2("2019-07-23", "%Y-%m-%d")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; @@ -1157,7 +1164,8 @@ TEST(VTimestampFunctionsTest, months_sub_v2_test) { str_to_datetime_v2("2019-07-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1174,7 +1182,7 @@ TEST(VTimestampFunctionsTest, days_add_v2_test) { {{std::string("2020-05-23"), 10}, str_to_date_v2("2020-06-02", "%Y-%m-%d")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; @@ -1188,7 +1196,8 @@ TEST(VTimestampFunctionsTest, days_add_v2_test) { str_to_datetime_v2("2020-06-02 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1205,7 +1214,7 @@ TEST(VTimestampFunctionsTest, days_sub_v2_test) { {{std::string("2020-05-23"), 31}, str_to_date_v2("2020-04-22", "%Y-%m-%d")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; @@ -1219,7 +1228,8 @@ TEST(VTimestampFunctionsTest, days_sub_v2_test) { str_to_datetime_v2("2020-04-22 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1236,7 +1246,7 @@ TEST(VTimestampFunctionsTest, weeks_add_v2_test) { {{std::string("2020-05-23"), 100}, str_to_date_v2("2022-04-23", "%Y-%m-%d")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; @@ -1250,7 +1260,8 @@ TEST(VTimestampFunctionsTest, weeks_add_v2_test) { str_to_datetime_v2("2022-04-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1267,7 +1278,7 @@ TEST(VTimestampFunctionsTest, weeks_sub_v2_test) { {{std::string("2020-05-23"), 100}, str_to_date_v2("2018-06-23", "%Y-%m-%d")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; @@ -1281,7 +1292,8 @@ TEST(VTimestampFunctionsTest, weeks_sub_v2_test) { str_to_datetime_v2("2018-06-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1296,7 +1308,7 @@ TEST(VTimestampFunctionsTest, to_days_v2_test) { {{std::string("2021-01-32")}, Null()}, {{std::string("0000-01-01")}, 1}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -1306,7 +1318,7 @@ TEST(VTimestampFunctionsTest, to_days_v2_test) { {{std::string("2021-01-32 00:00:11.123")}, Null()}, {{std::string("0000-01-01 00:00:11.123")}, 1}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1322,7 +1334,7 @@ TEST(VTimestampFunctionsTest, date_v2_test) { {{Null()}, Null()}, {{std::string("0000-01-01")}, str_to_date_v2("0000-01-01", "%Y-%m-%d")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -1334,7 +1346,7 @@ TEST(VTimestampFunctionsTest, date_v2_test) { {{std::string("0000-01-01 00:00:11.123")}, str_to_date_v2("0000-01-01", "%Y-%m-%d")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1347,7 +1359,8 @@ TEST(VTimestampFunctionsTest, week_v2_test) { {{std::string("")}, Null()}, {{std::string("9999-12-12")}, int8_t {50}}}; - check_function(func_name, new_input_types, new_data_set); + static_cast( + check_function(func_name, new_input_types, new_data_set)); } { InputTypeSet new_input_types = {TypeIndex::DateTimeV2}; @@ -1355,7 +1368,8 @@ TEST(VTimestampFunctionsTest, week_v2_test) { {{std::string("")}, Null()}, {{std::string("9999-12-12 00:00:11.123")}, int8_t {50}}}; - check_function(func_name, new_input_types, new_data_set); + static_cast( + check_function(func_name, new_input_types, new_data_set)); } } @@ -1368,7 +1382,8 @@ TEST(VTimestampFunctionsTest, yearweek_v2_test) { {{std::string("")}, Null()}, {{std::string("9999-12-12")}, 999950}}; - check_function(func_name, new_input_types, new_data_set); + static_cast( + check_function(func_name, new_input_types, new_data_set)); } { InputTypeSet new_input_types = {TypeIndex::DateTimeV2}; @@ -1376,7 +1391,8 @@ TEST(VTimestampFunctionsTest, yearweek_v2_test) { {{std::string("")}, Null()}, {{std::string("9999-12-12 00:00:11.123")}, 999950}}; - check_function(func_name, new_input_types, new_data_set); + static_cast( + check_function(func_name, new_input_types, new_data_set)); } } @@ -1393,7 +1409,7 @@ TEST(VTimestampFunctionsTest, str_to_date_test) { {{std::string("2021-00-01"), std::string("%Y-%m-%d")}, Null()}, {{std::string("2021-01-00"), std::string("%Y-%m-%d")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1405,7 +1421,7 @@ TEST(VTimestampFunctionsTest, from_days_test) { { DataSet data_set = {{{730669}, str_to_date_time("2000-07-03", false)}, {{0}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1420,7 +1436,7 @@ TEST(VTimestampFunctionsTest, weekday_v2_test) { {{std::string("2020-00-01")}, Null()}, {{std::string("2020-01-00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateTimeV2}; @@ -1430,7 +1446,7 @@ TEST(VTimestampFunctionsTest, weekday_v2_test) { {{std::string("2020-00-01 00:00:11.123")}, Null()}, {{std::string("2020-01-00 00:00:11.123")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1443,7 +1459,7 @@ TEST(VTimestampFunctionsTest, dayname_test) { DataSet data_set = {{{std::string("2007-02-03")}, std::string("Saturday")}, {{std::string("2020-01-00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -1452,7 +1468,7 @@ TEST(VTimestampFunctionsTest, dayname_test) { DataSet data_set = {{{std::string("2007-02-03 00:00:00")}, std::string("Saturday")}, {{std::string("2020-01-00 00:00:00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -1461,7 +1477,7 @@ TEST(VTimestampFunctionsTest, dayname_test) { DataSet data_set = {{{std::string("2007-02-03")}, std::string("Saturday")}, {{std::string("2020-01-00")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -1470,7 +1486,7 @@ TEST(VTimestampFunctionsTest, dayname_test) { DataSet data_set = {{{std::string("2007-02-03 00:00:11.123")}, std::string("Saturday")}, {{std::string("2020-01-00 00:00:11.123")}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } @@ -1492,7 +1508,7 @@ TEST(VTimestampFunctionsTest, datetrunc_test) { {{std::string("2022-10-08 11:44:23"), std::string("year")}, str_to_date_time("2022-01-01 00:00:00")}}; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } { @@ -1511,7 +1527,8 @@ TEST(VTimestampFunctionsTest, datetrunc_test) { {{std::string("2022-10-08 11:44:23"), std::string("year")}, str_to_datetime_v2("2022-01-01 00:00:00", "%Y-%m-%d %H:%i:%s")}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1530,7 +1547,8 @@ TEST(VTimestampFunctionsTest, hours_add_v2_test) { str_to_datetime_v2("2020-05-27 14:00:00.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; @@ -1544,7 +1562,8 @@ TEST(VTimestampFunctionsTest, hours_add_v2_test) { str_to_datetime_v2("2020-05-27 04:00:00", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1563,7 +1582,8 @@ TEST(VTimestampFunctionsTest, hours_sub_v2_test) { str_to_datetime_v2("2020-05-22 03:00:00.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } { @@ -1578,7 +1598,8 @@ TEST(VTimestampFunctionsTest, hours_sub_v2_test) { str_to_datetime_v2("2020-05-21 17:00:00", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1597,7 +1618,8 @@ TEST(VTimestampFunctionsTest, minutes_add_v2_test) { str_to_datetime_v2("2020-05-23 11:40:00.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; @@ -1611,7 +1633,8 @@ TEST(VTimestampFunctionsTest, minutes_add_v2_test) { str_to_datetime_v2("2020-05-23 01:40:00", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1630,7 +1653,8 @@ TEST(VTimestampFunctionsTest, minutes_sub_v2_test) { str_to_datetime_v2("2020-05-23 08:20:00.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; @@ -1644,7 +1668,8 @@ TEST(VTimestampFunctionsTest, minutes_sub_v2_test) { str_to_datetime_v2("2020-05-22 22:20:00", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1663,7 +1688,8 @@ TEST(VTimestampFunctionsTest, seconds_add_v2_test) { str_to_datetime_v2("2020-05-23 10:01:40.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; @@ -1677,7 +1703,8 @@ TEST(VTimestampFunctionsTest, seconds_add_v2_test) { str_to_datetime_v2("2020-05-23 00:01:40", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } @@ -1696,7 +1723,8 @@ TEST(VTimestampFunctionsTest, seconds_sub_v2_test) { str_to_datetime_v2("2020-05-23 09:58:20.123", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } { InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; @@ -1710,7 +1738,8 @@ TEST(VTimestampFunctionsTest, seconds_sub_v2_test) { str_to_datetime_v2("2020-05-22 23:58:20", "%Y-%m-%d %H:%i:%s.%f")}, {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + static_cast( + check_function(func_name, input_types, data_set)); } } diff --git a/be/test/vec/function/function_url_test.cpp b/be/test/vec/function/function_url_test.cpp index fd814d7262..2d92c54470 100644 --- a/be/test/vec/function/function_url_test.cpp +++ b/be/test/vec/function/function_url_test.cpp @@ -45,7 +45,7 @@ TEST(FunctionUrlTEST, DomainTest) { {{STRING("example.com")}, STRING("example.com")}, }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionUrlTEST, DomainWithoutWWWTest) { @@ -64,7 +64,7 @@ TEST(FunctionUrlTEST, DomainWithoutWWWTest) { {{STRING("example.com")}, STRING("example.com")}, }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } TEST(FunctionUrlTEST, ProtocolTest) { @@ -90,7 +90,7 @@ TEST(FunctionUrlTEST, ProtocolTest) { {{STRING("http!://example.com/")}, STRING("")}, }; - check_function(func_name, input_types, data_set); + static_cast(check_function(func_name, input_types, data_set)); } } // namespace doris::vectorized diff --git a/be/test/vec/olap/vertical_compaction_test.cpp b/be/test/vec/olap/vertical_compaction_test.cpp index 0dfd8786dd..619e3d44a0 100644 --- a/be/test/vec/olap/vertical_compaction_test.cpp +++ b/be/test/vec/olap/vertical_compaction_test.cpp @@ -90,7 +90,7 @@ protected: .ok()); _data_dir = new DataDir(absolute_dir, 100000000); - _data_dir->init(); + static_cast(_data_dir->init()); doris::EngineOptions options; k_engine = new StorageEngine(options); @@ -330,7 +330,7 @@ protected: TCompressionType::LZ4F, 0, enable_unique_key_merge_on_write)); TabletSharedPtr tablet(new Tablet(tablet_meta, _data_dir)); - tablet->init(); + static_cast(tablet->init()); bool exists = false; auto res = io::global_local_filesystem()->exists(tablet->tablet_path(), &exists); EXPECT_TRUE(res.ok() && !exists); @@ -398,8 +398,8 @@ TEST_F(VerticalCompactionTest, TestRowSourcesBuffer) { EXPECT_TRUE(buffer.append(tmp_row_source).ok()); EXPECT_EQ(buffer.total_size(), 6); size_t limit = 10; - buffer.flush(); - buffer.seek_to_begin(); + static_cast(buffer.flush()); + static_cast(buffer.seek_to_begin()); int idx = -1; while (buffer.has_remaining().ok()) { @@ -417,8 +417,8 @@ TEST_F(VerticalCompactionTest, TestRowSourcesBuffer) { EXPECT_TRUE(buffer1.append(tmp_row_source).ok()); buffer1.set_agg_flag(2, false); buffer1.set_agg_flag(4, true); - buffer1.flush(); - buffer1.seek_to_begin(); + static_cast(buffer1.flush()); + static_cast(buffer1.seek_to_begin()); EXPECT_EQ(buffer1.total_size(), 12); idx = -1; while (buffer1.has_remaining().ok()) { diff --git a/be/test/vec/runtime/vdata_stream_test.cpp b/be/test/vec/runtime/vdata_stream_test.cpp index 05c50023b2..80adee7374 100644 --- a/be/test/vec/runtime/vdata_stream_test.cpp +++ b/be/test/vec/runtime/vdata_stream_test.cpp @@ -192,9 +192,9 @@ TEST_F(VDataStreamTest, BasicTest) { VDataStreamSender sender(&runtime_stat, &_object_pool, sender_id, row_desc, tsink.stream_sink, dests, send_query_statistics_with_every_batch); sender.set_query_statistics(std::make_shared()); - sender.init(tsink); - sender.prepare(&runtime_stat); - sender.open(&runtime_stat); + static_cast(sender.init(tsink)); + static_cast(sender.prepare(&runtime_stat)); + static_cast(sender.open(&runtime_stat)); auto vec = vectorized::ColumnVector::create(); auto& data = vec->get_data(); @@ -204,14 +204,14 @@ TEST_F(VDataStreamTest, BasicTest) { vectorized::DataTypePtr data_type(std::make_shared()); vectorized::ColumnWithTypeAndName type_and_name(vec->get_ptr(), data_type, "test_int"); vectorized::Block block({type_and_name}); - sender.send(&runtime_stat, &block); + static_cast(sender.send(&runtime_stat, &block)); Status exec_status; - sender.close(&runtime_stat, exec_status); + static_cast(sender.close(&runtime_stat, exec_status)); Block block_2; bool eos; - recv->get_next(&block_2, &eos); + static_cast(recv->get_next(&block_2, &eos)); EXPECT_EQ(block_2.rows(), 1024);