From 75e0ba32a16272d28f31e4878c71418c781bfdde Mon Sep 17 00:00:00 2001 From: Zhengguo Yang Date: Tue, 13 Oct 2020 09:37:15 +0800 Subject: [PATCH] Fixes some be typo (#4714) --- be/src/agent/agent_server.cpp | 4 +- be/src/agent/agent_server.h | 2 +- be/src/agent/task_worker_pool.cpp | 4 +- be/src/agent/topic_subscriber.cpp | 8 +- be/src/agent/topic_subscriber.h | 2 +- be/src/agent/utils.h | 8 +- be/src/common/atomic.h | 2 +- be/src/common/config.h | 22 +++--- be/src/exec/aggregation_node.cpp | 2 +- be/src/exec/analytic_eval_node.cpp | 6 +- be/src/exec/analytic_eval_node.h | 2 +- be/src/exec/assert_num_rows_node.cpp | 8 +- be/src/exec/base_scanner.cpp | 2 +- be/src/exec/base_scanner.h | 4 +- be/src/exec/blocking_join_node.h | 2 +- be/src/exec/broker_scan_node.cpp | 2 +- be/src/exec/broker_scan_node.h | 2 +- be/src/exec/broker_scanner.cpp | 2 +- be/src/exec/es/es_predicate.cpp | 4 +- be/src/exec/es_scan_node.cpp | 2 +- be/src/exec/olap_scan_node.cpp | 12 +-- be/src/exec/schema_scanner.h | 4 +- .../schema_schemata_scanner.cpp | 2 +- .../schema_scanner/schema_tables_scanner.cpp | 4 +- .../schema_variables_scanner.cpp | 2 +- be/src/exec/set_operation_node.cpp | 2 +- be/src/exec/set_operation_node.h | 2 +- be/src/exec/tablet_sink.cpp | 6 +- be/src/exprs/CMakeLists.txt | 2 +- be/src/exprs/agg_fn.h | 2 +- be/src/exprs/agg_fn_evaluator.cpp | 30 ++++---- be/src/exprs/agg_fn_evaluator.h | 14 ++-- be/src/exprs/aggregate_functions.cpp | 74 +++++++++---------- be/src/exprs/aggregate_functions.h | 8 +- be/src/exprs/anyval_util.h | 20 ++--- be/src/exprs/binary_predicate.cpp | 4 +- be/src/exprs/bitmap_function.cpp | 2 +- be/src/exprs/{hybird_map.h => hybrid_map.h} | 26 +++---- .../exprs/{hybird_set.cpp => hybrid_set.cpp} | 26 +++---- be/src/exprs/{hybird_set.h => hybrid_set.h} | 32 ++++---- be/src/exprs/in_predicate.cpp | 16 ++-- be/src/exprs/in_predicate.h | 8 +- be/src/exprs/new_agg_fn_evaluator.h | 2 +- be/src/exprs/string_functions.cpp | 2 +- be/src/gutil/spinlock_internal.cc | 2 +- be/src/gutil/template_util.h | 2 +- be/src/http/action/compaction_action.cpp | 4 +- be/src/http/utils.cpp | 4 +- be/src/http/utils.h | 2 +- be/src/olap/aggregate_func.h | 6 +- be/src/olap/base_compaction.cpp | 10 +-- be/src/olap/base_compaction.h | 2 +- be/src/olap/bloom_filter.hpp | 2 +- be/src/olap/bloom_filter_reader.h | 2 +- be/src/olap/compaction.cpp | 6 +- be/src/olap/compaction.h | 2 +- be/src/olap/rowset/alpha_rowset.cpp | 2 +- be/src/olap/rowset/alpha_rowset_reader.cpp | 4 +- be/src/olap/rowset/beta_rowset_reader.cpp | 2 +- be/src/olap/rowset/beta_rowset_writer.cpp | 4 +- be/src/olap/rowset/beta_rowset_writer.h | 2 +- be/src/olap/rowset/column_data.cpp | 22 +++--- be/src/olap/rowset/column_data.h | 10 +-- be/src/olap/rowset/column_data_writer.cpp | 4 +- be/src/olap/rowset/column_data_writer.h | 4 +- be/src/olap/rowset/column_reader.cpp | 6 +- be/src/olap/rowset/column_reader.h | 4 +- be/src/olap/rowset/column_writer.cpp | 14 ++-- be/src/olap/rowset/column_writer.h | 2 +- be/src/olap/rowset/segment_group.h | 12 +-- be/src/olap/rowset/segment_reader.h | 10 +-- .../rowset/segment_v2/binary_dict_page.cpp | 2 +- .../olap/rowset/segment_v2/binary_dict_page.h | 2 +- .../rowset/segment_v2/binary_plain_page.h | 2 +- .../rowset/segment_v2/binary_prefix_page.h | 2 +- .../olap/rowset/segment_v2/bitshuffle_page.h | 2 +- be/src/olap/rowset/segment_v2/bloom_filter.h | 6 +- .../olap/rowset/segment_v2/column_reader.cpp | 6 +- be/src/olap/rowset/segment_v2/column_reader.h | 2 +- be/src/olap/selection_vector.h | 2 +- be/src/olap/short_key_index.h | 4 +- be/src/olap/skiplist.h | 6 +- be/src/olap/snapshot_manager.cpp | 2 +- be/src/olap/storage_engine.cpp | 2 +- be/src/olap/storage_engine.h | 4 +- be/src/olap/stream_index_writer.h | 2 +- be/src/olap/tablet_meta_manager.cpp | 2 +- be/src/olap/version_graph.cpp | 6 +- be/src/olap/version_graph.h | 6 +- be/src/runtime/buffer_control_block.cpp | 8 +- be/src/runtime/buffer_control_block.h | 8 +- be/src/runtime/bufferpool/buffer_allocator.cc | 2 +- be/src/runtime/bufferpool/buffer_allocator.h | 2 +- be/src/runtime/exec_env.h | 2 +- be/src/runtime/exec_env_init.cpp | 4 +- be/src/runtime/snapshot_loader.cpp | 2 +- be/src/runtime/snapshot_loader.h | 6 +- be/src/runtime/spill_sorter.cc | 6 +- .../stream_load/stream_load_context.cpp | 2 +- be/src/runtime/tablets_channel.h | 2 +- be/src/runtime/thread_resource_mgr.cpp | 2 +- be/src/service/backend_service.cpp | 4 +- be/src/service/backend_service.h | 2 +- be/src/service/brpc.h | 2 +- be/src/udf/CMakeLists.txt | 2 +- be/src/util/batch_process_thread_pool.hpp | 6 +- be/src/util/bit_util.h | 4 +- be/src/util/bitmap.h | 4 +- be/src/util/broker_load_error_hub.cpp | 2 +- be/src/util/broker_load_error_hub.h | 2 +- be/src/util/coding.h | 2 +- be/src/util/condition_variable.h | 2 +- be/src/util/symbols_util.cpp | 2 +- be/src/util/thread.cpp | 4 +- be/src/util/thread.h | 2 +- be/src/util/thrift_rpc_helper.cpp | 2 +- be/src/util/timezone_utils.cpp | 8 +- be/src/util/trace.cpp | 2 +- be/src/util/uid_util.h | 2 +- be/src/util/utf8_check.h | 4 +- .../schema_schemata_scanner_test.cpp | 2 +- .../schema_table_names_scanner_test.cpp | 2 +- .../schema_tables_scanner_test.cpp | 2 +- .../schema_variables_scanner_test.cpp | 2 +- be/test/exprs/bitmap_function_test.cpp | 10 +-- be/test/olap/delta_writer_test.cpp | 3 +- be/test/olap/short_key_index_test.cpp | 4 +- be/test/runtime/snapshot_loader_test.cpp | 2 +- be/test/runtime/sorter_test.cpp | 2 +- be/test/udf/uda_test.cpp | 2 +- 130 files changed, 367 insertions(+), 366 deletions(-) rename be/src/exprs/{hybird_map.h => hybrid_map.h} (69%) rename be/src/exprs/{hybird_set.cpp => hybrid_set.cpp} (65%) rename be/src/exprs/{hybird_set.h => hybrid_set.h} (88%) diff --git a/be/src/agent/agent_server.cpp b/be/src/agent/agent_server.cpp index e60d9e6b63..1f28825866 100644 --- a/be/src/agent/agent_server.cpp +++ b/be/src/agent/agent_server.cpp @@ -231,7 +231,7 @@ void AgentServer::release_snapshot(TAgentResult& t_agent_result, const std::stri Status ret_st; OLAPStatus err_code = SnapshotManager::instance()->release_snapshot(snapshot_path); if (err_code != OLAP_SUCCESS) { - LOG(WARNING) << "failt to release_snapshot. snapshot_path: " << snapshot_path + LOG(WARNING) << "failed to release_snapshot. snapshot_path: " << snapshot_path << ", err_code: " << err_code; ret_st = Status::RuntimeError(strings::Substitute( "fail to release_snapshot. err_code=$0", err_code)); @@ -289,4 +289,4 @@ void AgentServer::delete_etl_files(TAgentResult& t_agent_result, status.to_thrift(&t_agent_result.status); } -} // namesapce doris +} // namespace doris diff --git a/be/src/agent/agent_server.h b/be/src/agent/agent_server.h index 833de4dbdb..3ed126de45 100644 --- a/be/src/agent/agent_server.h +++ b/be/src/agent/agent_server.h @@ -43,7 +43,7 @@ public: void make_snapshot(TAgentResult& agent_result, const TSnapshotRequest& snapshot_request); void release_snapshot(TAgentResult& agent_result, const std::string& snapshot_path); - // Deprected + // Deprecated // TODO(lingbin): This method is deprecated, should be removed later. void publish_cluster_state(TAgentResult& agent_result, const TAgentPublishRequest& request); diff --git a/be/src/agent/task_worker_pool.cpp b/be/src/agent/task_worker_pool.cpp index d91bb7f169..7e1538afa2 100644 --- a/be/src/agent/task_worker_pool.cpp +++ b/be/src/agent/task_worker_pool.cpp @@ -434,7 +434,7 @@ void TaskWorkerPool::_alter_tablet_worker_thread_callback() { agent_task_req = _tasks.front(); _tasks.pop_front(); } - int64_t signatrue = agent_task_req.signature; + int64_t signature = agent_task_req.signature; LOG(INFO) << "get alter table task, signature: " << agent_task_req.signature; bool is_task_timeout = false; if (agent_task_req.__isset.recv_time) { @@ -450,7 +450,7 @@ void TaskWorkerPool::_alter_tablet_worker_thread_callback() { TTaskType::type task_type = agent_task_req.task_type; switch (task_type) { case TTaskType::ALTER: - _alter_tablet(agent_task_req, signatrue, + _alter_tablet(agent_task_req, signature, task_type, &finish_task_request); break; default: diff --git a/be/src/agent/topic_subscriber.cpp b/be/src/agent/topic_subscriber.cpp index 28b58d1853..0e4c1fe112 100644 --- a/be/src/agent/topic_subscriber.cpp +++ b/be/src/agent/topic_subscriber.cpp @@ -26,8 +26,8 @@ TopicSubscriber::TopicSubscriber() { TopicSubscriber::~TopicSubscriber() { // Delete all listeners in the register std::map>::iterator it - = _registed_listeners.begin(); - for (; it != _registed_listeners.end(); ++it) { + = _registered_listeners.begin(); + for (; it != _registered_listeners.end(); ++it) { std::vector& listeners = it->second; std::vector::iterator listener_it = listeners.begin(); for (; listener_it != listeners.end(); ++listener_it) { @@ -39,7 +39,7 @@ TopicSubscriber::~TopicSubscriber() { void TopicSubscriber::register_listener(TTopicType::type topic_type, TopicListener* listener) { // Unique lock here to prevent access to listeners boost::unique_lock lock(_listener_mtx); - this->_registed_listeners[topic_type].push_back(listener); + this->_registered_listeners[topic_type].push_back(listener); } void TopicSubscriber::handle_updates(const TAgentPublishRequest& agent_publish_request) { @@ -49,7 +49,7 @@ void TopicSubscriber::handle_updates(const TAgentPublishRequest& agent_publish_r const std::vector& topic_updates = agent_publish_request.updates; std::vector::const_iterator topic_update_it = topic_updates.begin(); for (; topic_update_it != topic_updates.end(); ++topic_update_it) { - std::vector& listeners = this->_registed_listeners[topic_update_it->type]; + std::vector& listeners = this->_registered_listeners[topic_update_it->type]; std::vector::iterator listener_it = listeners.begin(); // Send the update to all listeners with protocol version. for (; listener_it != listeners.end(); ++listener_it) { diff --git a/be/src/agent/topic_subscriber.h b/be/src/agent/topic_subscriber.h index b2bc59c743..cfde9a6013 100644 --- a/be/src/agent/topic_subscriber.h +++ b/be/src/agent/topic_subscriber.h @@ -37,7 +37,7 @@ public: void handle_updates(const TAgentPublishRequest& agent_publish_request); private: - std::map> _registed_listeners; + std::map> _registered_listeners; boost::shared_mutex _listener_mtx; }; } // namespace doris diff --git a/be/src/agent/utils.h b/be/src/agent/utils.h index 1bb41a5c87..b3cb6cfb9f 100644 --- a/be/src/agent/utils.h +++ b/be/src/agent/utils.h @@ -31,10 +31,10 @@ public: MasterServerClient(const TMasterInfo& master_info, FrontendServiceClientCache* client_cache); virtual ~MasterServerClient() {}; - // Reprot finished task to the master server + // Report finished task to the master server // // Input parameters: - // * request: The infomation of finished task + // * request: The information of finished task // // Output parameters: // * result: The result of report task @@ -43,7 +43,7 @@ public: // Report tasks/olap tablet/disk state to the master server // // Input parameters: - // * request: The infomation to report + // * request: The information to report // // Output parameters: // * result: The result of report task @@ -52,7 +52,7 @@ public: private: DISALLOW_COPY_AND_ASSIGN(MasterServerClient); - // Not ownder. Reference to the ExecEnv::_master_info + // Not owner. Reference to the ExecEnv::_master_info const TMasterInfo& _master_info; FrontendServiceClientCache* _client_cache; }; diff --git a/be/src/common/atomic.h b/be/src/common/atomic.h index a675c2d604..c270411c44 100644 --- a/be/src/common/atomic.h +++ b/be/src/common/atomic.h @@ -93,7 +93,7 @@ public: return *this; } - // These define the preincrement (i.e. --value) operators. + // These define the preIncrement (i.e. --value) operators. AtomicInt& operator++() { __sync_add_and_fetch(&_value, 1); return *this; diff --git a/be/src/common/config.h b/be/src/common/config.h index 04fcc4f987..064c3408b3 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -201,8 +201,8 @@ namespace config { CONF_mInt32(doris_max_pushdown_conjuncts_return_rate, "90"); // (Advanced) Maximum size of per-query receive-side buffer CONF_mInt32(exchg_node_buffer_size_bytes, "10485760"); - // insert sort threadhold for sorter - // CONF_Int32(insertion_threadhold, "16"); + // insert sort threshold for sorter + // CONF_Int32(insertion_threshold, "16"); // the block_size every block allocate for sorter CONF_Int32(sorter_block_size, "8388608"); // push_write_mbytes_per_sec @@ -256,7 +256,7 @@ namespace config { CONF_Int64(index_stream_cache_capacity, "10737418240"); // CONF_Int64(max_packed_row_block_size, "20971520"); - // Cache for stoage page size + // Cache for storage page size CONF_String(storage_page_cache_limit, "20G"); // whether to disable page cache feature in storage CONF_Bool(disable_storage_page_cache, "false"); @@ -352,7 +352,7 @@ namespace config { // the timeout of a rpc to open the tablet writer in remote BE. // short operation time, can set a short timeout CONF_Int32(tablet_writer_open_rpc_timeout_sec, "60"); - // Deprecated, use query_timeout instread + // Deprecated, use query_timeout instead // the timeout of a rpc to process one batch in tablet writer. // you may need to increase this timeout if using larger 'streaming_load_max_mb', // or encounter 'tablet writer write failed' error when loading. @@ -369,7 +369,7 @@ namespace config { // CONF_Bool(cast, "true"); // Spill to disk when query - // Writable scratch directories, splitted by ";" + // Writable scratch directories, split by ";" CONF_String(query_scratch_dirs, "${DORIS_HOME}"); // Control the number of disks on the machine. If 0, this comes from the system settings. @@ -394,12 +394,12 @@ namespace config { // you can do it as root via "sysctl -w vm.max_map_count=262144" or // "echo 262144 > /proc/sys/vm/max_map_count" // NOTE: When this is set to true, you must set chunk_reserved_bytes_limit - // to a relative large number or the performace is very very bad. + // to a relative large number or the performance is very very bad. CONF_Bool(use_mmap_allocate_chunk, "false"); // Chunk Allocator's reserved bytes limit, // Default value is 2GB, increase this variable can improve performance, but will - // aquire more free memory which can not be used by other modules + // acquire more free memory which can not be used by other modules CONF_Int64(chunk_reserved_bytes_limit, "2147483648"); // The probing algorithm of partitioned hash table. @@ -457,7 +457,7 @@ namespace config { // Sleep time in seconds between memory maintenance iterations CONF_mInt64(memory_maintenance_sleep_time_s, "10"); - // Aligement + // Alignment CONF_Int32(memory_max_alignment, "16"); // write buffer size before flush @@ -466,7 +466,7 @@ namespace config { // following 2 configs limit the memory consumption of load process on a Backend. // eg: memory limit to 80% of mem limit config but up to 100GB(default) // NOTICE(cmy): set these default values very large because we don't want to - // impact the load performace when user upgrading Doris. + // impact the load performance when user upgrading Doris. // user should set these configs properly if necessary. CONF_Int64(load_process_max_memory_limit_bytes, "107374182400"); // 100GB CONF_Int32(load_process_max_memory_limit_percent, "80"); // 80% @@ -480,7 +480,7 @@ namespace config { // the increased frequency of priority for remaining tasks in BlockingPriorityQueue CONF_mInt32(priority_queue_remaining_tasks_increased_frequency, "512"); - // sync tablet_meta when modifing meta + // sync tablet_meta when modifying meta CONF_mBool(sync_tablet_meta, "false"); // default thrift rpc timeout ms @@ -504,7 +504,7 @@ namespace config { // CONF_Bool(auto_recover_index_loading_failure, "false"); // max external scan cache batch count, means cache max_memory_cache_batch_count * batch_size row - // default is 20, batch_size's defualt value is 1024 means 20 * 1024 rows will be cached + // default is 20, batch_size's default value is 1024 means 20 * 1024 rows will be cached CONF_mInt32(max_memory_sink_batch_count, "20"); // This configuration is used for the context gc thread schedule period diff --git a/be/src/exec/aggregation_node.cpp b/be/src/exec/aggregation_node.cpp index 990fb1641e..4768f32655 100644 --- a/be/src/exec/aggregation_node.cpp +++ b/be/src/exec/aggregation_node.cpp @@ -66,7 +66,7 @@ AggregationNode::~AggregationNode() { Status AggregationNode::init(const TPlanNode& tnode, RuntimeState* state) { RETURN_IF_ERROR(ExecNode::init(tnode, state)); - // ignore return status for now , so we need to introduct ExecNode::init() + // ignore return status for now , so we need to introduce ExecNode::init() RETURN_IF_ERROR(Expr::create_expr_trees( _pool, tnode.agg_node.grouping_exprs, &_probe_expr_ctxs)); diff --git a/be/src/exec/analytic_eval_node.cpp b/be/src/exec/analytic_eval_node.cpp index 2ff8c22cfe..099affbb0f 100644 --- a/be/src/exec/analytic_eval_node.cpp +++ b/be/src/exec/analytic_eval_node.cpp @@ -709,11 +709,11 @@ Status AnalyticEvalNode::process_child_batch(RuntimeState* state) { } // Transfer resources to _prev_tuple_pool when enough resources have accumulated - // and the _prev_tuple_pool has already been transfered to an output batch. + // and the _prev_tuple_pool has already been transferred to an output batch. // The memory limit of _curr_tuple_pool is set by the fixed value // The size is specified as 8MB, which is used in the extremely strict memory limit. - // Eg: exec_mem_limit < 100MB may cause memory exeecded limit problem. So change it to half of max block size to prevent the problem. + // Eg: exec_mem_limit < 100MB may cause memory exceeded limit problem. So change it to half of max block size to prevent the problem. // TODO: Should we keep the buffer of _curr_tuple_pool or release the memory occupied ASAP? if (_curr_tuple_pool->total_allocated_bytes() > state->block_mgr2()->max_block_size() / 2 && (_prev_pool_last_result_idx == -1 || _prev_pool_last_window_idx == -1)) { @@ -864,7 +864,7 @@ Status AnalyticEvalNode::close(RuntimeState* state) { if (_block_mgr_client != nullptr) { state->block_mgr2()->clear_reservations(_block_mgr_client); } - // Close all evaluators and fn ctxs. If an error occurred in Init or rrepare there may + // Close all evaluators and fn ctxs. If an error occurred in Init or prepare there may // be fewer ctxs than evaluators. We also need to Finalize if _curr_tuple was created // in Open. DCHECK_LE(_fn_ctxs.size(), _evaluators.size()); diff --git a/be/src/exec/analytic_eval_node.h b/be/src/exec/analytic_eval_node.h index 5e95ce3659..8c0f9f43b9 100644 --- a/be/src/exec/analytic_eval_node.h +++ b/be/src/exec/analytic_eval_node.h @@ -165,7 +165,7 @@ private: // get_next_output_batch(). int64_t num_output_rows_ready() const; - // Resets the slots in current_tuple_ that store the intermedatiate results for lead(). + // Resets the slots in current_tuple_ that store the intermediate results for lead(). // This is necessary to produce the default value (set by Init()). void reset_lead_fn_slots(); diff --git a/be/src/exec/assert_num_rows_node.cpp b/be/src/exec/assert_num_rows_node.cpp index 81aeb1e81e..6c84dfc1f0 100644 --- a/be/src/exec/assert_num_rows_node.cpp +++ b/be/src/exec/assert_num_rows_node.cpp @@ -33,7 +33,7 @@ AssertNumRowsNode::AssertNumRowsNode(ObjectPool* pool, const TPlanNode& tnode, if (tnode.assert_num_rows_node.__isset.assertion) { _assertion = tnode.assert_num_rows_node.assertion; } else { - _assertion = TAssertion::LE; // just comptiable for the previous code + _assertion = TAssertion::LE; // just compatible for the previous code } } @@ -86,7 +86,7 @@ Status AssertNumRowsNode::get_next(RuntimeState* state, RowBatch* output_batch, } if (!assert_res) { - auto to_string_lamba = [](TAssertion::type assertion) { + auto to_string_lambda = [](TAssertion::type assertion) { std::map::const_iterator it = _TAssertion_VALUES_TO_NAMES.find(assertion); @@ -96,10 +96,10 @@ Status AssertNumRowsNode::get_next(RuntimeState* state, RowBatch* output_batch, return it->second; } }; - LOG(INFO) << "Expected " << to_string_lamba(_assertion) << " " << _desired_num_rows + LOG(INFO) << "Expected " << to_string_lambda(_assertion) << " " << _desired_num_rows << " to be returned by expression " << _subquery_string; return Status::Cancelled(strings::Substitute( - "Expected $0 $1 to be returned by expression $2", to_string_lamba(_assertion), + "Expected $0 $1 to be returned by expression $2", to_string_lambda(_assertion), _desired_num_rows, _subquery_string)); } COUNTER_SET(_rows_returned_counter, _num_rows_returned); diff --git a/be/src/exec/base_scanner.cpp b/be/src/exec/base_scanner.cpp index 8acc1c573f..1ed73e249f 100644 --- a/be/src/exec/base_scanner.cpp +++ b/be/src/exec/base_scanner.cpp @@ -63,7 +63,7 @@ Status BaseScanner::open() { } Status BaseScanner::init_expr_ctxes() { - // Constcut _src_slot_descs + // Construct _src_slot_descs const TupleDescriptor* src_tuple_desc = _state->desc_tbl().get_tuple_descriptor(_params.src_tuple_id); if (src_tuple_desc == nullptr) { diff --git a/be/src/exec/base_scanner.h b/be/src/exec/base_scanner.h index 751a0200c2..6be496f76b 100644 --- a/be/src/exec/base_scanner.h +++ b/be/src/exec/base_scanner.h @@ -39,8 +39,8 @@ struct ScannerCounter { num_rows_unselected(0) { } - int64_t num_rows_filtered; // unqualified rows (unmatch the dest schema, or no partition) - int64_t num_rows_unselected; // rows filterd by predicates + int64_t num_rows_filtered; // unqualified rows (unmatched the dest schema, or no partition) + int64_t num_rows_unselected; // rows filtered by predicates }; class BaseScanner { diff --git a/be/src/exec/blocking_join_node.h b/be/src/exec/blocking_join_node.h index 964f996203..e35dde6be4 100644 --- a/be/src/exec/blocking_join_node.h +++ b/be/src/exec/blocking_join_node.h @@ -94,7 +94,7 @@ private: // A NULL ptr for first_left_child_row indicates the left child eos. virtual void init_get_next(TupleRow* first_left_child_row) = 0; - // We parallelize building the build-side with Open'ing the + // We parallelize building the build-side with Opening the // left child. If, for example, the left child is another // join node, it can start to build its own build-side at the // same time. diff --git a/be/src/exec/broker_scan_node.cpp b/be/src/exec/broker_scan_node.cpp index 86bb31816f..1acf4a144a 100644 --- a/be/src/exec/broker_scan_node.cpp +++ b/be/src/exec/broker_scan_node.cpp @@ -48,7 +48,7 @@ BrokerScanNode::BrokerScanNode( BrokerScanNode::~BrokerScanNode() { } -// We use the ParttitionRange to compare here. It should not be a member function of PartitionInfo +// We use the PartitionRange to compare here. It should not be a member function of PartitionInfo // class because there are some other member in it. static bool compare_part_use_range(const PartitionInfo* v1, const PartitionInfo* v2) { return v1->range() < v2->range(); diff --git a/be/src/exec/broker_scan_node.h b/be/src/exec/broker_scan_node.h index ae9cb746e7..9f37d31073 100644 --- a/be/src/exec/broker_scan_node.h +++ b/be/src/exec/broker_scan_node.h @@ -124,7 +124,7 @@ private: int _max_buffered_batches; - // Partition informations + // Partition information std::vector _partition_expr_ctxs; std::vector _partition_infos; diff --git a/be/src/exec/broker_scanner.cpp b/be/src/exec/broker_scanner.cpp index 6a2b23bc97..39bbaa23f9 100644 --- a/be/src/exec/broker_scanner.cpp +++ b/be/src/exec/broker_scanner.cpp @@ -288,7 +288,7 @@ void BrokerScanner::close() { void BrokerScanner::split_line( const Slice& line, std::vector* values) { - // line-begin char and line-end char are considered to be 'delimeter' + // line-begin char and line-end char are considered to be 'delimiter' const char* value = line.data; const char* ptr = line.data; for (size_t i = 0; i < line.size; ++i, ++ptr) { diff --git a/be/src/exec/es/es_predicate.cpp b/be/src/exec/es/es_predicate.cpp index 4c799e1b8d..c38fab9ebf 100644 --- a/be/src/exec/es/es_predicate.cpp +++ b/be/src/exec/es/es_predicate.cpp @@ -401,10 +401,10 @@ Status EsPredicate::build_disjuncts_list(const Expr* conjunct) { } } - HybirdSetBase::IteratorBase* iter = pred->hybird_set()->begin(); + HybridSetBase::IteratorBase* iter = pred->hybrid_set()->begin(); while (iter->has_next()) { if (nullptr == iter->get_value()) { - return Status::InternalError("build disjuncts failed: hybird set has a null value"); + return Status::InternalError("build disjuncts failed: hybrid set has a null value"); } ExtLiteral literal(slot_desc->type().type, const_cast(iter->get_value())); diff --git a/be/src/exec/es_scan_node.cpp b/be/src/exec/es_scan_node.cpp index 1acfefbaab..d4d68d3940 100644 --- a/be/src/exec/es_scan_node.cpp +++ b/be/src/exec/es_scan_node.cpp @@ -497,7 +497,7 @@ bool EsScanNode::get_disjuncts(ExprContext* context, Expr* conjunct, } } - HybirdSetBase::IteratorBase* iter = pred->hybird_set()->begin(); + HybridSetBase::IteratorBase* iter = pred->hybrid_set()->begin(); while (iter->has_next()) { if (nullptr == iter->get_value()) { return false; diff --git a/be/src/exec/olap_scan_node.cpp b/be/src/exec/olap_scan_node.cpp index 914dc2f40e..43acfa82cb 100644 --- a/be/src/exec/olap_scan_node.cpp +++ b/be/src/exec/olap_scan_node.cpp @@ -773,7 +773,7 @@ Status OlapScanNode::normalize_in_and_eq_predicate(SlotDescriptor* slot, ColumnV } VLOG(1) << slot->col_name() << " fixed_values add num: " - << pred->hybird_set()->size(); + << pred->hybrid_set()->size(); // if there are too many elements in InPredicate, exceed the limit, // we will not push any condition of this column to storage engine. @@ -781,16 +781,16 @@ Status OlapScanNode::normalize_in_and_eq_predicate(SlotDescriptor* slot, ColumnV // slow down the query process. // ATTN: This is just an experience value. You may need to try // different thresholds to improve performance. - if (pred->hybird_set()->size() > _max_pushdown_conditions_per_column) { - VLOG(3) << "Predicate value num " << pred->hybird_set()->size() - << " excede limit " << _max_pushdown_conditions_per_column; + if (pred->hybrid_set()->size() > _max_pushdown_conditions_per_column) { + VLOG(3) << "Predicate value num " << pred->hybrid_set()->size() + << " exceed limit " << _max_pushdown_conditions_per_column; continue; } // begin to push InPredicate value into ColumnValueRange - HybirdSetBase::IteratorBase* iter = pred->hybird_set()->begin(); + HybridSetBase::IteratorBase* iter = pred->hybrid_set()->begin(); while (iter->has_next()) { - // column in (NULL,...) counldn't push down to StorageEngine + // column in (NULL,...) couldn't push down to StorageEngine // so that discard whole ColumnValueRange if (NULL == iter->get_value()) { range->clear(); diff --git a/be/src/exec/schema_scanner.h b/be/src/exec/schema_scanner.h index c3f562e5dc..8ee2004e9b 100644 --- a/be/src/exec/schema_scanner.h +++ b/be/src/exec/schema_scanner.h @@ -29,7 +29,7 @@ namespace doris { -// forehead declar class, because jni function init in DorisServer. +// forehead declare class, because jni function init in DorisServer. class DorisServer; class RuntimeState; @@ -61,7 +61,7 @@ public: SchemaScanner(ColumnDesc* columns, int column_num); virtual ~SchemaScanner(); - // init object need infomation, schema etc. + // init object need information, schema etc. virtual Status init(SchemaScannerParam* param, ObjectPool* pool); // Start to work virtual Status start(RuntimeState* state); diff --git a/be/src/exec/schema_scanner/schema_schemata_scanner.cpp b/be/src/exec/schema_scanner/schema_schemata_scanner.cpp index d8f2081a75..820f06e037 100644 --- a/be/src/exec/schema_scanner/schema_schemata_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_schemata_scanner.cpp @@ -62,7 +62,7 @@ Status SchemaSchemataScanner::start(RuntimeState *state) { RETURN_IF_ERROR(SchemaHelper::get_db_names(*(_param->ip), _param->port, db_params, &_db_result)); } else { - return Status::InternalError("IP or port dosn't exists"); + return Status::InternalError("IP or port doesn't exists"); } 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 b6bb961035..51dd3f8618 100644 --- a/be/src/exec/schema_scanner/schema_tables_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_tables_scanner.cpp @@ -82,7 +82,7 @@ Status SchemaTablesScanner::start(RuntimeState *state) { RETURN_IF_ERROR(SchemaHelper::get_db_names(*(_param->ip), _param->port, db_params, &_db_result)); } else { - return Status::InternalError("IP or port dosn't exists"); + return Status::InternalError("IP or port doesn't exists"); } return Status::OK(); } @@ -260,7 +260,7 @@ Status SchemaTablesScanner::get_new_table() { RETURN_IF_ERROR(SchemaHelper::list_table_status(*(_param->ip), _param->port, table_params, &_table_result)); } else { - return Status::InternalError("IP or port dosn't exists"); + return Status::InternalError("IP or port doesn't exists"); } _table_index = 0; 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 13e24e1cb7..7fe508954e 100644 --- a/be/src/exec/schema_scanner/schema_variables_scanner.cpp +++ b/be/src/exec/schema_scanner/schema_variables_scanner.cpp @@ -56,7 +56,7 @@ Status SchemaVariablesScanner::start(RuntimeState *state) { RETURN_IF_ERROR(SchemaHelper::show_varialbes(*(_param->ip), _param->port, var_params, &_var_result)); } else { - return Status::InternalError("IP or port dosn't exists"); + return Status::InternalError("IP or port doesn't exists"); } _begin = _var_result.variables.begin(); return Status::OK(); diff --git a/be/src/exec/set_operation_node.cpp b/be/src/exec/set_operation_node.cpp index f5552f12c1..c3fd056f65 100644 --- a/be/src/exec/set_operation_node.cpp +++ b/be/src/exec/set_operation_node.cpp @@ -139,7 +139,7 @@ Status SetOperationNode::open(RuntimeState* state) { for (const vector& exprs : _child_expr_lists) { RETURN_IF_ERROR(Expr::open(exprs, state)); } - // initial build hash table used for remove duplicted + // initial build hash table used for remove duplicated _hash_tbl.reset(new HashTable(_child_expr_lists[0], _child_expr_lists[1], _build_tuple_size, true, _find_nulls, id(), mem_tracker(), 1024)); RowBatch build_batch(child(0)->row_desc(), state->batch_size(), mem_tracker().get()); diff --git a/be/src/exec/set_operation_node.h b/be/src/exec/set_operation_node.h index 38c5def2d0..52d178cdda 100644 --- a/be/src/exec/set_operation_node.h +++ b/be/src/exec/set_operation_node.h @@ -26,7 +26,7 @@ class MemPool; class RowBatch; class TupleRow; -// Node that calulate the set operation results of its children by either materializing their +// Node that calculate the set operation results of its children by either materializing their // evaluated expressions into row batches or passing through (forwarding) the // batches if the input tuple layout is identical to the output tuple layout // and expressions don't need to be evaluated. The children should be ordered diff --git a/be/src/exec/tablet_sink.cpp b/be/src/exec/tablet_sink.cpp index cd27ad7968..7f166eb5ea 100644 --- a/be/src/exec/tablet_sink.cpp +++ b/be/src/exec/tablet_sink.cpp @@ -240,7 +240,7 @@ Status NodeChannel::close_wait(RuntimeState* state) { return st.clone_and_prepend("already stopped, skip waiting for close. cancelled/!eos: "); } - // waiting for finished, it may take a long time, so we could't set a timeout + // waiting for finished, it may take a long time, so we couldn't set a timeout MonotonicStopWatch timer; timer.start(); while (!_add_batches_finished && !_cancelled) { @@ -362,7 +362,7 @@ Status IndexChannel::init(RuntimeState* state, const std::vector_location->find_tablet(tablet.tablet_id); if (location == nullptr) { - LOG(WARNING) << "unknow tablet, tablet_id=" << tablet.tablet_id; + LOG(WARNING) << "unknown tablet, tablet_id=" << tablet.tablet_id; return Status::InternalError("unknown tablet"); } std::vector channels; @@ -399,7 +399,7 @@ Status IndexChannel::add_row(Tuple* tuple, int64_t tablet_id) { } if (has_intolerable_failure()) { - return Status::InternalError("index channel has intoleralbe failure"); + return Status::InternalError("index channel has intolerable failure"); } return Status::OK(); diff --git a/be/src/exprs/CMakeLists.txt b/be/src/exprs/CMakeLists.txt index a11c786085..91947245c1 100644 --- a/be/src/exprs/CMakeLists.txt +++ b/be/src/exprs/CMakeLists.txt @@ -57,7 +57,7 @@ add_library(Exprs udf_builtins.cpp utility_functions.cpp info_func.cpp - hybird_set.cpp + hybrid_set.cpp json_functions.cpp operators.cpp hll_hash_function.cpp diff --git a/be/src/exprs/agg_fn.h b/be/src/exprs/agg_fn.h index e3a7107acf..97abd20f1a 100644 --- a/be/src/exprs/agg_fn.h +++ b/be/src/exprs/agg_fn.h @@ -55,7 +55,7 @@ class TExprNode; /// update_fn_ : An update function that processes the arguments for each row in the /// query result set and accumulates an intermediate result. For example, /// this function might increment a counter, append to a string buffer or -/// add the input to a culmulative sum. +/// add the input to a cumulative sum. /// /// merge_fn_ : A merge function that combines multiple intermediate results into a /// single value. diff --git a/be/src/exprs/agg_fn_evaluator.cpp b/be/src/exprs/agg_fn_evaluator.cpp index 12405526b4..e3e68e0ee5 100755 --- a/be/src/exprs/agg_fn_evaluator.cpp +++ b/be/src/exprs/agg_fn_evaluator.cpp @@ -180,12 +180,12 @@ Status AggFnEvaluator::prepare( _is_multi_distinct = false; if (_agg_op == AggregationOp::COUNT_DISTINCT) { - _hybird_map.reset(new HybirdMap(TYPE_VARCHAR)); + _hybrid_map.reset(new HybridMap(TYPE_VARCHAR)); _is_multi_distinct = true; _string_buffer.reset(new char[1024]); _string_buffer_len = 1024; } else if (_agg_op == AggregationOp::SUM_DISTINCT) { - _hybird_map.reset(new HybirdMap(input_expr_ctxs()[0]->root()->type().type)); + _hybrid_map.reset(new HybridMap(input_expr_ctxs()[0]->root()->type().type)); _is_multi_distinct = true; } // TODO: this should be made identical for the builtin and UDA case by @@ -432,10 +432,10 @@ inline void AggFnEvaluator::set_output_slot(const AnyVal* src, } } -bool AggFnEvaluator::is_in_hybirdmap(void* input_val, Tuple* dst, bool* is_add_buckets) { +bool AggFnEvaluator::is_in_hybridmap(void* input_val, Tuple* dst, bool* is_add_buckets) { bool is_in_hashset = false; - HybirdSetBase* _set_ptr = NULL; - _set_ptr = _hybird_map->find_or_insert_set(reinterpret_cast(dst), is_add_buckets); + HybridSetBase* _set_ptr = NULL; + _set_ptr = _hybrid_map->find_or_insert_set(reinterpret_cast(dst), is_add_buckets); is_in_hashset = _set_ptr->find(input_val); if (!is_in_hashset) { @@ -484,7 +484,7 @@ bool AggFnEvaluator::count_distinct_data_filter(TupleRow* row, Tuple* dst) { std::vector vec_string_len; int total_len = 0; - // 1. cacluate the total_len of all input parameters + // 1. calculate the total_len of all input parameters for (int i = 0; i < input_expr_ctxs().size(); ++i) { void* src_slot = input_expr_ctxs()[i]->get_value(row); set_any_val(src_slot, input_expr_ctxs()[i]->root()->type(), _staging_input_vals[i]); @@ -619,9 +619,9 @@ bool AggFnEvaluator::count_distinct_data_filter(TupleRow* row, Tuple* dst) { } DCHECK(begin == string_val.ptr + string_val.len) - << "COUNT_DISTINCT: StringVal's len dosn't match"; + << "COUNT_DISTINCT: StringVal's len doesn't match"; bool is_add_buckets = false; - bool is_filter = is_in_hybirdmap(&string_val, dst, &is_add_buckets); + bool is_filter = is_in_hybridmap(&string_val, dst, &is_add_buckets); update_mem_trackers(is_filter, is_add_buckets, string_val.len); return is_filter; } @@ -646,21 +646,21 @@ bool AggFnEvaluator::sum_distinct_data_filter(TupleRow* row, Tuple* dst) { case TYPE_BIGINT: { const BigIntVal* value = reinterpret_cast(_staging_input_vals[0]); - is_filter = is_in_hybirdmap((void*) & (value->val), dst, &is_add_buckets); + is_filter = is_in_hybridmap((void*) & (value->val), dst, &is_add_buckets); update_mem_trackers(is_filter, is_add_buckets, BIGINT_SIZE); return is_filter; } case TYPE_FLOAT: { const FloatVal* value = reinterpret_cast(_staging_input_vals[0]); - is_filter = is_in_hybirdmap((void*) & (value->val), dst, &is_add_buckets); + is_filter = is_in_hybridmap((void*) & (value->val), dst, &is_add_buckets); update_mem_trackers(is_filter, is_add_buckets, FLOAT_SIZE); return is_filter; } case TYPE_DOUBLE: { const DoubleVal* value = reinterpret_cast(_staging_input_vals[0]); - is_filter = is_in_hybirdmap((void*) & (value->val), dst, &is_add_buckets); + is_filter = is_in_hybridmap((void*) & (value->val), dst, &is_add_buckets); update_mem_trackers(is_filter, is_add_buckets, DOUBLE_SIZE); return is_filter; } @@ -668,7 +668,7 @@ bool AggFnEvaluator::sum_distinct_data_filter(TupleRow* row, Tuple* dst) { case TYPE_DECIMAL: { const DecimalVal* value = reinterpret_cast(_staging_input_vals[0]); DecimalValue temp_value = DecimalValue::from_decimal_val(*value); - is_filter = is_in_hybirdmap((void*) & (temp_value), dst, &is_add_buckets); + is_filter = is_in_hybridmap((void*) & (temp_value), dst, &is_add_buckets); update_mem_trackers(is_filter, is_add_buckets, DECIMAL_SIZE); return is_filter; } @@ -676,14 +676,14 @@ bool AggFnEvaluator::sum_distinct_data_filter(TupleRow* row, Tuple* dst) { case TYPE_DECIMALV2: { const DecimalV2Val* value = reinterpret_cast(_staging_input_vals[0]); DecimalV2Value temp_value = DecimalV2Value::from_decimal_val(*value); - is_filter = is_in_hybirdmap((void*) & (temp_value), dst, &is_add_buckets); + is_filter = is_in_hybridmap((void*) & (temp_value), dst, &is_add_buckets); update_mem_trackers(is_filter, is_add_buckets, DECIMALV2_SIZE); return is_filter; } case TYPE_LARGEINT: { const LargeIntVal* value = reinterpret_cast(_staging_input_vals[0]); - is_filter = is_in_hybirdmap((void*) & (value->val), dst, &is_add_buckets); + is_filter = is_in_hybridmap((void*) & (value->val), dst, &is_add_buckets); update_mem_trackers(is_filter, is_add_buckets, LARGEINT_SIZE); return is_filter; } @@ -739,7 +739,7 @@ void AggFnEvaluator::update_or_merge(FunctionContext* agg_fn_ctx, TupleRow* row, // debugging. // if _agg_op is TAggregationOp::COUNT_DISTINCT, it has only one - // input parameter, we consider the first parameter as the only input paremeter + // input parameter, we consider the first parameter as the only input parameter if (_is_multi_distinct && _agg_op == AggregationOp::COUNT_DISTINCT) { reinterpret_cast(fn)(agg_fn_ctx, *_staging_input_vals[0], _staging_intermediate_val); diff --git a/be/src/exprs/agg_fn_evaluator.h b/be/src/exprs/agg_fn_evaluator.h index 0f76aa763a..1c9bd598a2 100755 --- a/be/src/exprs/agg_fn_evaluator.h +++ b/be/src/exprs/agg_fn_evaluator.h @@ -26,7 +26,7 @@ #include "gen_cpp/Exprs_types.h" //#include "exprs/opcode_registry.h" #include "util/hash_util.hpp" -#include "exprs/hybird_map.h" +#include "exprs/hybrid_map.h" #include "runtime/runtime_state.h" #include "runtime/descriptors.h" #include "exprs/expr_context.h" @@ -37,7 +37,7 @@ namespace doris { class AggregationNode; class TExprNode; -// This class evaluates aggregate functions. Aggregate funtions can either be +// This class evaluates aggregate functions. Aggregate functions can either be // builtins or external UDAs. For both of types types, they can either use codegen // or not. // This class provides an interface that's 1:1 with the UDA interface and serves @@ -76,7 +76,7 @@ public: // It is used to get the input values in the Update() and Merge() functions. // 'output_slot_desc' is the slot that this aggregator should write to. // The underlying aggregate function allocates memory from the 'pool'. This is - // either string data for intemerdiate results or whatever memory the UDA might + // either string data for intermediate results or whatever memory the UDA might // need. // TODO: should we give them their own pool? Status prepare( @@ -139,7 +139,7 @@ public: void update(FunctionContext* agg_fn_ctx, TupleRow* src, Tuple* dst, void* fn, MemPool* pool); void merge(FunctionContext* agg_fn_ctx, TupleRow* src, Tuple* dst, MemPool* pool); - // Explicitly does a merge, even if this evalutor is not marked as merging. + // Explicitly does a merge, even if this evaluator is not marked as merging. // This is used by the partitioned agg node when it needs to merge spill results. // In the non-spilling case, this node would normally not merge. void merge(FunctionContext* agg_fn_ctx, Tuple* src, Tuple* dst); @@ -176,7 +176,7 @@ public: bool is_multi_distinct() { return _is_multi_distinct; } - bool is_in_hybirdmap(void* input_val, Tuple* dst, bool* is_add_buckets); + bool is_in_hybridmap(void* input_val, Tuple* dst, bool* is_add_buckets); void choose_update_or_merge(FunctionContext* agg_fn_ctx, TupleRow* row, Tuple* dst); static void add(const std::vector& evaluators, @@ -208,7 +208,7 @@ private: const bool _is_merge; /// Indicates which functions must be loaded. const bool _is_analytic_fn; - boost::scoped_ptr _hybird_map; + boost::scoped_ptr _hybrid_map; bool _is_multi_distinct; std::vector _input_exprs_ctxs; boost::scoped_array _string_buffer; //for count distinct @@ -272,7 +272,7 @@ private: } } - // TODO: these funtions below are not extensible and we need to use codegen to + // TODO: these functions below are not extensible and we need to use codegen to // generate the calls into the UDA functions (like for UDFs). // Remove these functions when this is supported. diff --git a/be/src/exprs/aggregate_functions.cpp b/be/src/exprs/aggregate_functions.cpp index eb9b8d7f34..8d14a830d4 100644 --- a/be/src/exprs/aggregate_functions.cpp +++ b/be/src/exprs/aggregate_functions.cpp @@ -27,7 +27,7 @@ #include "runtime/datetime_value.h" #include "runtime/runtime_state.h" #include "exprs/anyval_util.h" -#include "exprs/hybird_set.h" +#include "exprs/hybrid_set.h" #include "util/tdigest.h" #include "util/debug_util.h" @@ -309,7 +309,7 @@ void AggregateFunctions::decimal_avg_init(FunctionContext* ctx, StringVal* dst) void AggregateFunctions::decimalv2_avg_init(FunctionContext* ctx, StringVal* dst) { dst->is_null = false; dst->len = sizeof(DecimalV2AvgState); - // The memroy for int128 need to be aligned by 16. + // The memory for int128 need to be aligned by 16. // So the constructor has been used instead of allocating memory. // Also, it will be release in finalize. dst->ptr = (uint8_t*) new DecimalV2AvgState; @@ -1085,7 +1085,7 @@ void AggregateFunctions::pc_merge(FunctionContext* c, << distinct_estimate_bitmap_to_string(dst->ptr); } -double distince_estimate_finalize(const StringVal& src) { +double distinct_estimate_finalize(const StringVal& src) { DCHECK(!src.is_null); DCHECK_EQ(src.len, NUM_PC_BITMAPS * PC_BITMAP_LENGTH / 8); VLOG_ROW << "FinalizeEstimateSlot Bit map:\n" @@ -1135,7 +1135,7 @@ double distince_estimate_finalize(const StringVal& src) { } StringVal AggregateFunctions::pc_finalize(FunctionContext* c, const StringVal& src) { - double estimate = distince_estimate_finalize(src); + double estimate = distinct_estimate_finalize(src); int64_t result = estimate; // TODO: this should return bigint. this is a hack std::stringstream ss; @@ -1149,7 +1149,7 @@ StringVal AggregateFunctions::pc_finalize(FunctionContext* c, const StringVal& s StringVal AggregateFunctions::pcsa_finalize(FunctionContext* c, const StringVal& src) { // When using stochastic averaging, the result has to be multiplied by NUM_PC_BITMAPS. - double estimate = distince_estimate_finalize(src) * NUM_PC_BITMAPS; + double estimate = distinct_estimate_finalize(src) * NUM_PC_BITMAPS; int64_t result = estimate; // TODO: this should return bigint. this is a hack std::stringstream ss; @@ -1270,16 +1270,16 @@ int64_t AggregateFunctions::hll_algorithm(uint8_t *pdata, int data_len) { harmonic_mean = 1.0f / harmonic_mean; double estimate = alpha * num_streams * num_streams * harmonic_mean; - // according to HerperLogLog current correction, if E is cardinal + // according to HyperLogLog current correction, if E is cardinal // E =< num_streams * 2.5 , LC has higher accuracy. - // num_streams * 2.5 < E , HerperLogLog has higher accuracy. - // Generally , we can use HerperLogLog to produce value as E. + // num_streams * 2.5 < E , HyperLogLog has higher accuracy. + // Generally , we can use HyperLogLog to produce value as E. if (estimate <= num_streams * 2.5 && num_zero_registers != 0) { // Estimated cardinality is too low. Hll is too inaccurate here, instead use // linear counting. estimate = num_streams * log(static_cast(num_streams) / num_zero_registers); } else if (num_streams == 16384 && estimate < 72000) { - // when Linear Couint change to HerperLoglog according to HerperLogLog Correction, + // when Linear Count change to HyperLoglog according to HyperLogLog Correction, // there are relatively large fluctuations, we fixed the problem refer to redis. double bias = 5.9119 * 1.0e-18 * (estimate * estimate * estimate * estimate) - 1.4253 * 1.0e-12 * (estimate * estimate * estimate) + @@ -1324,7 +1324,7 @@ doris_udf::HllVal AggregateFunctions::hll_raw_agg_finalize( } // TODO chenhao , reduce memory copy -// multi distinct state for numertic +// multi distinct state for numeric // serialize order type:value:value:value ... template class MultiDistinctNumericState { @@ -1355,7 +1355,7 @@ public: dst->ptr = (uint8_t*)state; } - static void destory(const StringVal& dst) { + static void destroy(const StringVal& dst) { delete (MultiDistinctNumericState*)dst.ptr; } @@ -1451,7 +1451,7 @@ private: std::unordered_set _set; // Because Anyval does not provide the hash function, in order // to adopt the type different from the template, the pointer is used - // HybirdSetBase* _set; + // HybridSetBase* _set; // _type is serialized into buffer by one byte FunctionContext::Type _type; }; @@ -1471,7 +1471,7 @@ public: dst->ptr = (uint8_t*)state; } - static void destory(const StringVal& dst) { + static void destroy(const StringVal& dst) { delete (MultiDistinctStringCountState*)dst.ptr; } @@ -1482,7 +1482,7 @@ public: StringVal serialize(FunctionContext* ctx) { // calculate total serialize buffer length int total_serialized_set_length = 1; - HybirdSetBase::IteratorBase* iterator = _set.begin(); + HybridSetBase::IteratorBase* iterator = _set.begin(); while (iterator->has_next()) { const StringValue* value = reinterpret_cast(iterator->get_value()); @@ -1562,7 +1562,7 @@ public: dst->ptr = (uint8_t*)state; } - static void destory(const StringVal& dst) { + static void destroy(const StringVal& dst) { delete (MultiDistinctDecimalState*)dst.ptr; } @@ -1664,7 +1664,7 @@ public: dst->ptr = (uint8_t*)state; } - static void destory(const StringVal& dst) { + static void destroy(const StringVal& dst) { delete (MultiDistinctDecimalV2State*)dst.ptr; } @@ -1750,7 +1750,7 @@ public: dst->ptr = (uint8_t*)state; } - static void destory(const StringVal& dst) { + static void destroy(const StringVal& dst) { delete (MultiDistinctCountDateState*)dst.ptr; } @@ -1906,7 +1906,7 @@ void AggregateFunctions::count_or_sum_distinct_numeric_merge(FunctionContext* ct src_state->unserialize(src); DCHECK(dst_state->set_type() == src_state->set_type()); dst_state->merge(*src_state); - MultiDistinctNumericState::destory(src_state_val); + MultiDistinctNumericState::destroy(src_state_val); } void AggregateFunctions::count_distinct_string_merge(FunctionContext* ctx, StringVal& src, @@ -1921,7 +1921,7 @@ void AggregateFunctions::count_distinct_string_merge(FunctionContext* ctx, Strin src_state->unserialize(src); DCHECK(dst_state->set_type() == src_state->set_type()); dst_state->merge(*src_state); - MultiDistinctStringCountState::destory(src_state_val); + MultiDistinctStringCountState::destroy(src_state_val); } @@ -1937,7 +1937,7 @@ void AggregateFunctions::count_or_sum_distinct_decimal_merge(FunctionContext* ct src_state->unserialize(src); DCHECK(dst_state->set_type() == src_state->set_type()); dst_state->merge(*src_state); - MultiDistinctDecimalState::destory(src_state_val); + MultiDistinctDecimalState::destroy(src_state_val); } void AggregateFunctions::count_or_sum_distinct_decimalv2_merge(FunctionContext* ctx, StringVal& src, @@ -1952,7 +1952,7 @@ void AggregateFunctions::count_or_sum_distinct_decimalv2_merge(FunctionContext* src_state->unserialize(src); DCHECK(dst_state->set_type() == src_state->set_type()); dst_state->merge(*src_state); - MultiDistinctDecimalV2State::destory(src_state_val); + MultiDistinctDecimalV2State::destroy(src_state_val); } void AggregateFunctions::count_distinct_date_merge(FunctionContext* ctx, StringVal& src, @@ -1967,7 +1967,7 @@ void AggregateFunctions::count_distinct_date_merge(FunctionContext* ctx, StringV src_state->unserialize(src); DCHECK(dst_state->set_type() == src_state->set_type()); dst_state->merge(*src_state); - MultiDistinctCountDateState::destory(src_state_val); + MultiDistinctCountDateState::destroy(src_state_val); } template @@ -1976,7 +1976,7 @@ StringVal AggregateFunctions::count_or_sum_distinct_numeric_serialize(FunctionCo MultiDistinctNumericState* state = reinterpret_cast*>(state_sv.ptr); StringVal result = state->serialize(ctx); // release original object - MultiDistinctNumericState::destory(state_sv); + MultiDistinctNumericState::destroy(state_sv); return result; } @@ -1985,7 +1985,7 @@ StringVal AggregateFunctions::count_distinct_string_serialize(FunctionContext* c MultiDistinctStringCountState* state = reinterpret_cast(state_sv.ptr); StringVal result = state->serialize(ctx); // release original object - MultiDistinctStringCountState::destory(state_sv); + MultiDistinctStringCountState::destroy(state_sv); return result; } @@ -1994,7 +1994,7 @@ StringVal AggregateFunctions::count_or_sum_distinct_decimal_serialize(FunctionCo MultiDistinctDecimalState* state = reinterpret_cast(state_sv.ptr); StringVal result = state->serialize(ctx); // release original object - MultiDistinctDecimalState::destory(state_sv); + MultiDistinctDecimalState::destroy(state_sv); return result; } @@ -2003,7 +2003,7 @@ StringVal AggregateFunctions::count_or_sum_distinct_decimalv2_serialize(Function MultiDistinctDecimalV2State* state = reinterpret_cast(state_sv.ptr); StringVal result = state->serialize(ctx); // release original object - MultiDistinctDecimalV2State::destory(state_sv); + MultiDistinctDecimalV2State::destroy(state_sv); return result; } @@ -2012,7 +2012,7 @@ StringVal AggregateFunctions::count_distinct_date_serialize(FunctionContext* ctx MultiDistinctCountDateState* state = reinterpret_cast(state_sv.ptr); StringVal result = state->serialize(ctx); // release original object - MultiDistinctCountDateState::destory(state_sv); + MultiDistinctCountDateState::destroy(state_sv); return result; } @@ -2021,7 +2021,7 @@ BigIntVal AggregateFunctions::count_or_sum_distinct_numeric_finalize(FunctionCon DCHECK(!state_sv.is_null); MultiDistinctNumericState* state = reinterpret_cast*>(state_sv.ptr); BigIntVal result = state->count_finalize(); - MultiDistinctNumericState::destory(state_sv); + MultiDistinctNumericState::destroy(state_sv); return result; } @@ -2029,7 +2029,7 @@ BigIntVal AggregateFunctions::count_distinct_string_finalize(FunctionContext* ct DCHECK(!state_sv.is_null); MultiDistinctStringCountState* state = reinterpret_cast(state_sv.ptr); BigIntVal result = state->finalize(); - MultiDistinctStringCountState::destory(state_sv); + MultiDistinctStringCountState::destroy(state_sv); return result; } @@ -2038,7 +2038,7 @@ DoubleVal AggregateFunctions::sum_distinct_double_finalize(FunctionContext* ctx, DCHECK(!state_sv.is_null); MultiDistinctNumericState* state = reinterpret_cast*>(state_sv.ptr); DoubleVal result = state->sum_finalize_double(); - MultiDistinctNumericState::destory(state_sv); + MultiDistinctNumericState::destroy(state_sv); return result; } @@ -2047,7 +2047,7 @@ LargeIntVal AggregateFunctions::sum_distinct_largeint_finalize(FunctionContext* DCHECK(!state_sv.is_null); MultiDistinctNumericState* state = reinterpret_cast*>(state_sv.ptr); LargeIntVal result = state->sum_finalize_largeint(); - MultiDistinctNumericState::destory(state_sv); + MultiDistinctNumericState::destroy(state_sv); return result; } @@ -2056,7 +2056,7 @@ BigIntVal AggregateFunctions::sum_distinct_bigint_finalize(FunctionContext* ctx, DCHECK(!state_sv.is_null); MultiDistinctNumericState* state = reinterpret_cast*>(state_sv.ptr); BigIntVal result = state->sum_finalize_bigint(); - MultiDistinctNumericState::destory(state_sv); + MultiDistinctNumericState::destroy(state_sv); return result; } @@ -2064,7 +2064,7 @@ BigIntVal AggregateFunctions::count_distinct_decimal_finalize(FunctionContext* c DCHECK(!state_sv.is_null); MultiDistinctDecimalState* state = reinterpret_cast(state_sv.ptr); BigIntVal result = state->count_finalize(); - MultiDistinctDecimalState::destory(state_sv); + MultiDistinctDecimalState::destroy(state_sv); return result; } @@ -2072,7 +2072,7 @@ BigIntVal AggregateFunctions::count_distinct_decimalv2_finalize(FunctionContext* DCHECK(!state_sv.is_null); MultiDistinctDecimalV2State* state = reinterpret_cast(state_sv.ptr); BigIntVal result = state->count_finalize(); - MultiDistinctDecimalV2State::destory(state_sv); + MultiDistinctDecimalV2State::destroy(state_sv); return result; } @@ -2080,7 +2080,7 @@ DecimalVal AggregateFunctions::sum_distinct_decimal_finalize(FunctionContext* ct DCHECK(!state_sv.is_null); MultiDistinctDecimalState* state = reinterpret_cast(state_sv.ptr); DecimalVal result = state->sum_finalize(); - MultiDistinctDecimalState::destory(state_sv); + MultiDistinctDecimalState::destroy(state_sv); return result; } @@ -2088,7 +2088,7 @@ DecimalV2Val AggregateFunctions::sum_distinct_decimalv2_finalize(FunctionContext DCHECK(!state_sv.is_null); MultiDistinctDecimalV2State* state = reinterpret_cast(state_sv.ptr); DecimalV2Val result = state->sum_finalize(); - MultiDistinctDecimalV2State::destory(state_sv); + MultiDistinctDecimalV2State::destroy(state_sv); return result; } @@ -2096,7 +2096,7 @@ BigIntVal AggregateFunctions::count_distinct_date_finalize(FunctionContext* ctx, DCHECK(!state_sv.is_null); MultiDistinctCountDateState* state = reinterpret_cast(state_sv.ptr); BigIntVal result = state->count_finalize(); - MultiDistinctCountDateState::destory(state_sv); + MultiDistinctCountDateState::destroy(state_sv); return result; } diff --git a/be/src/exprs/aggregate_functions.h b/be/src/exprs/aggregate_functions.h index d9a0590808..3264beff59 100644 --- a/be/src/exprs/aggregate_functions.h +++ b/be/src/exprs/aggregate_functions.h @@ -26,7 +26,7 @@ namespace doris { class HllSetResolver; -class HybirdSetBase; +class HybridSetBase; // Collection of builtin aggregate functions. Aggregate functions implement // the various phases of the aggregation: Init(), Update(), Serialize(), Merge(), @@ -65,7 +65,7 @@ public: static void count_star_remove(FunctionContext*, BigIntVal* dst); - // Impementation of percentile_approx + // Implementation of percentile_approx static void percentile_approx_init(doris_udf::FunctionContext* ctx, doris_udf::StringVal* dst); template @@ -225,7 +225,7 @@ dst); static DecimalVal sum_distinct_decimal_finalize(FunctionContext* ctx, const StringVal& state_sv); static DecimalV2Val sum_distinct_decimalv2_finalize(FunctionContext* ctx, const StringVal& state_sv); - // count distinct in multi disticnt for Date + // count distinct in multi distinct for Date static void count_distinct_date_init(doris_udf::FunctionContext* ctx, doris_udf::StringVal* dst); static void count_distinct_date_update(FunctionContext* ctx, DateTimeVal& src, StringVal* dst); static void count_distinct_date_merge(FunctionContext* ctx, StringVal& src, StringVal* dst); @@ -331,7 +331,7 @@ dst); const doris_udf::StringVal& src); static void hll_union_agg_init(doris_udf::FunctionContext*, doris_udf::HllVal* slot); - // fill all register accroading to hll set type + // fill all register according to hll set type static void hll_union_agg_update(doris_udf::FunctionContext*, const doris_udf::HllVal& src, doris_udf::HllVal* dst); // merge the register value diff --git a/be/src/exprs/anyval_util.h b/be/src/exprs/anyval_util.h index 07aa95d616..d6d96fcf87 100755 --- a/be/src/exprs/anyval_util.h +++ b/be/src/exprs/anyval_util.h @@ -369,40 +369,40 @@ public: /// Templated equality functions. These assume the input values are not NULL. template static inline bool equals(const PrimitiveType& type, const T& x, const T& y) { - return equals_intenal(x, y); + return equals_internal(x, y); } /// Templated equality functions. These assume the input values are not NULL. template static inline bool equals(const T& x, const T& y) { - return equals_intenal(x, y); + return equals_internal(x, y); } template static inline bool equals(const TypeDescriptor& type, const T& x, const T& y) { - return equals_intenal(x, y); + return equals_internal(x, y); } template static inline bool equals(const FunctionContext::TypeDesc& type, const T& x, const T& y) { - return equals_intenal(x, y); + return equals_internal(x, y); } private: /// Implementations of Equals(). template - static inline bool equals_intenal(const T& x, const T& y); + static inline bool equals_internal(const T& x, const T& y); }; template -inline bool AnyValUtil::equals_intenal(const T& x, const T& y) { +inline bool AnyValUtil::equals_internal(const T& x, const T& y) { DCHECK(!x.is_null); DCHECK(!y.is_null); return x.val == y.val; } template<> -inline bool AnyValUtil::equals_intenal(const StringVal& x, const StringVal& y) { +inline bool AnyValUtil::equals_internal(const StringVal& x, const StringVal& y) { DCHECK(!x.is_null); DCHECK(!y.is_null); StringValue x_sv = StringValue::from_string_val(x); @@ -411,7 +411,7 @@ inline bool AnyValUtil::equals_intenal(const StringVal& x, const StringVal& y) { } template<> -inline bool AnyValUtil::equals_intenal(const DateTimeVal& x, const DateTimeVal& y) { +inline bool AnyValUtil::equals_internal(const DateTimeVal& x, const DateTimeVal& y) { DCHECK(!x.is_null); DCHECK(!y.is_null); DateTimeValue x_tv = DateTimeValue::from_datetime_val(x); @@ -420,14 +420,14 @@ inline bool AnyValUtil::equals_intenal(const DateTimeVal& x, const DateTimeVal& } template<> -inline bool AnyValUtil::equals_intenal(const DecimalVal& x, const DecimalVal& y) { +inline bool AnyValUtil::equals_internal(const DecimalVal& x, const DecimalVal& y) { DCHECK(!x.is_null); DCHECK(!y.is_null); return x == y; } template<> -inline bool AnyValUtil::equals_intenal(const DecimalV2Val& x, const DecimalV2Val& y) { +inline bool AnyValUtil::equals_internal(const DecimalV2Val& x, const DecimalV2Val& y) { DCHECK(!x.is_null); DCHECK(!y.is_null); return x == y; diff --git a/be/src/exprs/binary_predicate.cpp b/be/src/exprs/binary_predicate.cpp index d2808cb3fa..3e3187e8a2 100644 --- a/be/src/exprs/binary_predicate.cpp +++ b/be/src/exprs/binary_predicate.cpp @@ -280,7 +280,7 @@ std::string BinaryPredicate::debug_string() const { return BooleanVal(v1.val OP v2.val); \ } -// add '/**/' to pass codestyle check of cooder +// add '/**/' to pass code style check of cooder #define BINARY_PRED_INT_FNS(TYPE, FN) \ BINARY_PRED_FN(Eq##TYPE##Pred, TYPE, FN, /**/ == /**/, CmpInst::ICMP_EQ) \ BINARY_PRED_FN(Ne##TYPE##Pred, TYPE, FN, /**/ != /**/, CmpInst::ICMP_NE) \ @@ -408,7 +408,7 @@ BooleanVal EqStringValPred::get_boolean_val(ExprContext* ctx, TupleRow* row) { return BooleanVal(v1.val OP v2.val); \ } -// add '/**/' to pass codestyle check of cooder +// add '/**/' to pass code style check of cooder #define BINARY_PRED_FOR_NULL_INT_FNS(TYPE, FN) \ BINARY_PRED_FOR_NULL_FN(EqForNull##TYPE##Pred, TYPE, FN, /**/ == /**/, CmpInst::ICMP_EQ) diff --git a/be/src/exprs/bitmap_function.cpp b/be/src/exprs/bitmap_function.cpp index 6f0f02bfe6..4b0a307f65 100644 --- a/be/src/exprs/bitmap_function.cpp +++ b/be/src/exprs/bitmap_function.cpp @@ -488,7 +488,7 @@ StringVal BitmapFunctions::bitmap_from_string(FunctionContext* ctx, const String } std::vector bits; - // The contructor of `stringpiece` only support int type. + // The constructor of `stringPiece` only support int type. if ((input.len > INT32_MAX) || !SplitStringAndParse({(const char*)input.ptr, (int)input.len}, ",", &safe_strtou64, &bits)) { return StringVal::null(); diff --git a/be/src/exprs/hybird_map.h b/be/src/exprs/hybrid_map.h similarity index 69% rename from be/src/exprs/hybird_map.h rename to be/src/exprs/hybrid_map.h index c49aef1dad..433ba17e3d 100644 --- a/be/src/exprs/hybird_map.h +++ b/be/src/exprs/hybrid_map.h @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#ifndef DORIS_BE_SRC_QUERY_EXPRS_HYBIRD_MAP_H -#define DORIS_BE_SRC_QUERY_EXPRS_HYBIRD_MAP_H +#ifndef DORIS_BE_SRC_QUERY_EXPRS_HYBRID_MAP_H +#define DORIS_BE_SRC_QUERY_EXPRS_HYBRID_MAP_H #include #include "common/status.h" @@ -24,25 +24,25 @@ #include "runtime/string_value.h" #include "runtime/datetime_value.h" #include "common/object_pool.h" -#include "exprs/hybird_set.h" +#include "exprs/hybrid_set.h" namespace doris { -class HybirdMap { +class HybridMap { public: - HybirdMap(PrimitiveType type) : _type(type) { + HybridMap(PrimitiveType type) : _type(type) { } - virtual ~HybirdMap() { + virtual ~HybridMap() { } - virtual HybirdSetBase* find_or_insert_set(uint64_t dst, bool* is_add_buckets) { - HybirdSetBase* _set_ptr; - typename std::unordered_map::const_iterator it = _map.find(dst); + virtual HybridSetBase* find_or_insert_set(uint64_t dst, bool* is_add_buckets) { + HybridSetBase* _set_ptr; + typename std::unordered_map::const_iterator it = _map.find(dst); if (it == _map.end()) { - _set_ptr = _pool.add(HybirdSetBase::create_set(_type)); - std::pair insert_pair(dst, _set_ptr); + _set_ptr = _pool.add(HybridSetBase::create_set(_type)); + std::pair insert_pair(dst, _set_ptr); _map.insert(insert_pair); *is_add_buckets = true; } else { @@ -54,10 +54,10 @@ public: } private: - std::unordered_map _map; + std::unordered_map _map; PrimitiveType _type; ObjectPool _pool; }; } -#endif // DORIS_BE_SRC_QUERY_EXPRS_HYBIRD_MAP_H +#endif // DORIS_BE_SRC_QUERY_EXPRS_HYBRID_MAP_H diff --git a/be/src/exprs/hybird_set.cpp b/be/src/exprs/hybrid_set.cpp similarity index 65% rename from be/src/exprs/hybird_set.cpp rename to be/src/exprs/hybrid_set.cpp index b485b09f7b..562ed25008 100644 --- a/be/src/exprs/hybird_set.cpp +++ b/be/src/exprs/hybrid_set.cpp @@ -15,45 +15,45 @@ // specific language governing permissions and limitations // under the License. -#include "exprs/hybird_set.h" +#include "exprs/hybrid_set.h" namespace doris { -HybirdSetBase* HybirdSetBase::create_set(PrimitiveType type) { +HybridSetBase* HybridSetBase::create_set(PrimitiveType type) { switch (type) { case TYPE_BOOLEAN: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_TINYINT: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_SMALLINT: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_INT: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_BIGINT: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_FLOAT: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_DOUBLE: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_DATE: case TYPE_DATETIME: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_DECIMAL: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_DECIMALV2: - return new(std::nothrow) HybirdSet(); + return new(std::nothrow) HybridSet(); case TYPE_LARGEINT: - return new(std::nothrow) HybirdSet<__int128>(); + return new(std::nothrow) HybridSet<__int128>(); case TYPE_CHAR: case TYPE_VARCHAR: diff --git a/be/src/exprs/hybird_set.h b/be/src/exprs/hybrid_set.h similarity index 88% rename from be/src/exprs/hybird_set.h rename to be/src/exprs/hybrid_set.h index 54e3d38f65..5ed8ab9029 100644 --- a/be/src/exprs/hybird_set.h +++ b/be/src/exprs/hybrid_set.h @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#ifndef DORIS_BE_SRC_QUERY_EXPRS_HYBIRD_SET_H -#define DORIS_BE_SRC_QUERY_EXPRS_HYBIRD_SET_H +#ifndef DORIS_BE_SRC_QUERY_EXPRS_HYBRID_SET_H +#define DORIS_BE_SRC_QUERY_EXPRS_HYBRID_SET_H #include #include @@ -30,20 +30,20 @@ namespace doris { -class HybirdSetBase { +class HybridSetBase { public: - HybirdSetBase() { + HybridSetBase() { } - virtual ~HybirdSetBase() { + virtual ~HybridSetBase() { } virtual void insert(void* data) = 0; - virtual void insert(HybirdSetBase* set) = 0; + virtual void insert(HybridSetBase* set) = 0; virtual int size() = 0; virtual bool find(void* data) = 0; - static HybirdSetBase* create_set(PrimitiveType type); + static HybridSetBase* create_set(PrimitiveType type); class IteratorBase { public: IteratorBase() { @@ -59,12 +59,12 @@ public: }; template -class HybirdSet : public HybirdSetBase { +class HybridSet : public HybridSetBase { public: - HybirdSet() { + HybridSet() { } - virtual ~HybirdSet() { + virtual ~HybridSet() { } virtual void insert(void* data) { @@ -78,9 +78,9 @@ public: } } - virtual void insert(HybirdSetBase* set) { - HybirdSet* hybird_set = reinterpret_cast*>(set); - _set.insert(hybird_set->_set.begin(), hybird_set->_set.end()); + virtual void insert(HybridSetBase* set) { + HybridSet* hybrid_set = reinterpret_cast*>(set); + _set.insert(hybrid_set->_set.begin(), hybrid_set->_set.end()); } virtual int size() { @@ -133,7 +133,7 @@ private: ObjectPool _pool; }; -class StringValueSet : public HybirdSetBase { +class StringValueSet : public HybridSetBase { public: StringValueSet() { } @@ -147,7 +147,7 @@ public: _set.insert(str_value); } - void insert(HybirdSetBase* set) { + void insert(HybridSetBase* set) { StringValueSet* string_set = reinterpret_cast(set); _set.insert(string_set->_set.begin(), string_set->_set.end()); } @@ -207,4 +207,4 @@ private: } -#endif // DORIS_BE_SRC_QUERY_EXPRS_HYBIRD_SET_H +#endif // DORIS_BE_SRC_QUERY_EXPRS_HYBRID_SET_H diff --git a/be/src/exprs/in_predicate.cpp b/be/src/exprs/in_predicate.cpp index 862f01006f..1265f14d25 100644 --- a/be/src/exprs/in_predicate.cpp +++ b/be/src/exprs/in_predicate.cpp @@ -32,7 +32,7 @@ InPredicate::InPredicate(const TExprNode& node) : _is_not_in(node.in_predicate.is_not_in), _is_prepare(false), _null_in_set(false), - _hybird_set() { + _hybrid_set() { } InPredicate::~InPredicate() { @@ -42,8 +42,8 @@ Status InPredicate::prepare(RuntimeState* state, const TypeDescriptor& type) { if (_is_prepare) { return Status::OK(); } - _hybird_set.reset(HybirdSetBase::create_set(type.type)); - if (NULL == _hybird_set.get()) { + _hybrid_set.reset(HybridSetBase::create_set(type.type)); + if (NULL == _hybrid_set.get()) { return Status::InternalError("Unknown column type."); } _is_prepare = true; @@ -73,7 +73,7 @@ Status InPredicate::open( _null_in_set = true; continue; } - _hybird_set->insert(value); + _hybrid_set->insert(value); } return Status::OK(); } @@ -89,8 +89,8 @@ Status InPredicate::prepare( if (_children.size() < 1) { return Status::InternalError("no Function operator in."); } - _hybird_set.reset(HybirdSetBase::create_set(_children[0]->type().type)); - if (NULL == _hybird_set.get()) { + _hybrid_set.reset(HybridSetBase::create_set(_children[0]->type().type)); + if (NULL == _hybrid_set.get()) { return Status::InternalError("Unknown column type."); } @@ -103,7 +103,7 @@ void InPredicate::insert(void* value) { if (NULL == value) { _null_in_set = true; } else { - _hybird_set->insert(value); + _hybrid_set->insert(value); } } @@ -129,7 +129,7 @@ BooleanVal InPredicate::get_boolean_val(ExprContext* ctx, TupleRow* row) { return BooleanVal::null(); } // if find in const set, return true - if (_hybird_set->find(lhs_slot)) { + if (_hybrid_set->find(lhs_slot)) { return BooleanVal(!_is_not_in); } if (_null_in_set) { diff --git a/be/src/exprs/in_predicate.h b/be/src/exprs/in_predicate.h index 742e35a61e..ef826153ff 100644 --- a/be/src/exprs/in_predicate.h +++ b/be/src/exprs/in_predicate.h @@ -23,7 +23,7 @@ #include #include "exprs/predicate.h" #include "runtime/raw_value.h" -#include "exprs/hybird_set.h" +#include "exprs/hybrid_set.h" namespace doris { @@ -51,8 +51,8 @@ public: // if add to children, when List is long, copy is a expensive op. void insert(void* value); - HybirdSetBase* hybird_set() const { - return _hybird_set.get(); + HybridSetBase* hybrid_set() const { + return _hybrid_set.get(); } bool is_not_in() const { @@ -72,7 +72,7 @@ private: const bool _is_not_in; bool _is_prepare; bool _null_in_set; - boost::shared_ptr _hybird_set; + boost::shared_ptr _hybrid_set; }; diff --git a/be/src/exprs/new_agg_fn_evaluator.h b/be/src/exprs/new_agg_fn_evaluator.h index 7be1c3d825..203701dfb1 100644 --- a/be/src/exprs/new_agg_fn_evaluator.h +++ b/be/src/exprs/new_agg_fn_evaluator.h @@ -26,7 +26,7 @@ #include "common/compiler_util.h" #include "common/status.h" #include "exprs/agg_fn.h" -#include "exprs/hybird_map.h" +#include "exprs/hybrid_map.h" #include "runtime/descriptors.h" #include "runtime/tuple_row.h" #include "runtime/types.h" diff --git a/be/src/exprs/string_functions.cpp b/be/src/exprs/string_functions.cpp index 6a5abaa3c6..3cbec0f43c 100644 --- a/be/src/exprs/string_functions.cpp +++ b/be/src/exprs/string_functions.cpp @@ -77,7 +77,7 @@ StringVal StringFunctions::substring( // create index indicate every char start byte // e.g. "hello word 你好" => [0,1,2,3,4,5,6,7,8,9,10,11,14] 你 and 好 are 3 bytes // why use a vector as index? It is unnecessary if there is no negative pos val, - // but if has pos is negative it is not easy to determin where to start, so need a + // but if has pos is negative it is not easy to determine where to start, so need a // index save every character's length size_t byte_pos = 0; std::vector index; diff --git a/be/src/gutil/spinlock_internal.cc b/be/src/gutil/spinlock_internal.cc index 0850cf1905..958bc4df4a 100644 --- a/be/src/gutil/spinlock_internal.cc +++ b/be/src/gutil/spinlock_internal.cc @@ -34,7 +34,7 @@ // See spinlock_internal.h for the spec of SpinLockWake(). // void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop) -// SpinLockDelay() generates an apprproate spin delay on iteration "loop" of a +// SpinLockDelay() generates an appropriate spin delay on iteration "loop" of a // spin loop on location *w, whose previously observed value was "value". // SpinLockDelay() may do nothing, may yield the CPU, may sleep a clock tick, // or may wait for a delay that can be truncated by a call to SpinlockWake(w). diff --git a/be/src/gutil/template_util.h b/be/src/gutil/template_util.h index aebfa163bb..a16a991c82 100644 --- a/be/src/gutil/template_util.h +++ b/be/src/gutil/template_util.h @@ -36,7 +36,7 @@ // any changes here, make sure that you're not breaking any platforms. // // -// The names choosen here reflect those used in tr1 and the boost::mpl +// The names chosen here reflect those used in tr1 and the boost::mpl // library, there are similar operations used in the Loki library as // well. I prefer the boost names for 2 reasons: // 1. I think that portions of the Boost libraries are more likely to diff --git a/be/src/http/action/compaction_action.cpp b/be/src/http/action/compaction_action.cpp index 6b8e2ffedc..a2a3460c99 100644 --- a/be/src/http/action/compaction_action.cpp +++ b/be/src/http/action/compaction_action.cpp @@ -181,8 +181,8 @@ Status CompactionAction::_handle_run_status_compaction(HttpRequest *req, std::st { // use try lock to check this tablet is running cumulative compaction - MutexLock lock_cumulativie(tablet->get_cumulative_lock(), TRY_LOCK); - if (!lock_cumulativie.own_lock()) { + MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK); + if (!lock_cumulative.own_lock()) { msg = "this tablet_id is running"; compaction_type = "cumulative"; run_status = 1; diff --git a/be/src/http/utils.cpp b/be/src/http/utils.cpp index bc8bfbfcce..3883f35b50 100644 --- a/be/src/http/utils.cpp +++ b/be/src/http/utils.cpp @@ -161,11 +161,11 @@ void do_dir_response(const std::string& dir_path, HttpRequest *req) { HttpChannel::send_error(req, HttpStatus::INTERNAL_SERVER_ERROR); } - const std::string FILE_DELIMETER_IN_DIR_RESPONSE = "\n"; + const std::string FILE_DELIMITER_IN_DIR_RESPONSE = "\n"; std::stringstream result; for (const std::string& file_name : files) { - result << file_name << FILE_DELIMETER_IN_DIR_RESPONSE; + result << file_name << FILE_DELIMITER_IN_DIR_RESPONSE; } std::string result_str = result.str(); diff --git a/be/src/http/utils.h b/be/src/http/utils.h index 0a1a50b0d5..7938591228 100644 --- a/be/src/http/utils.h +++ b/be/src/http/utils.h @@ -30,7 +30,7 @@ class HttpRequest; std::string encode_basic_auth(const std::string& user, const std::string& passwd); // parse Basic authorization // return true, if request contain valid basic authorization. -// Otherwise return fasle +// Otherwise return false bool parse_basic_auth(const HttpRequest& req, std::string* user, std::string* passwd); bool parse_basic_auth(const HttpRequest& req, AuthInfo* auth); diff --git a/be/src/olap/aggregate_func.h b/be/src/olap/aggregate_func.h index ecd46e0ce0..e2946cd621 100644 --- a/be/src/olap/aggregate_func.h +++ b/be/src/olap/aggregate_func.h @@ -44,7 +44,7 @@ public: // // Memory Note: For plain memory can be allocated from *mem_pool, whose lifetime // will last util finalize function is called. Memory allocated from heap should - // be freed in finalize functioin to avoid memory leak. + // be freed in finalize function to avoid memory leak. inline void init(RowCursorCell* dst, const char* src, bool src_null, MemPool* mem_pool, ObjectPool* agg_pool) const { _init_fn(dst, src, src_null, mem_pool, agg_pool); } @@ -444,7 +444,7 @@ template <> struct AggregateFuncTraits : public AggregateFuncTraits { }; -// when data load, after hll_hash fucntion, hll_union column won't be null +// when data load, after hll_hash function, hll_union column won't be null // so when init, update hll, the src is not null template <> struct AggregateFuncTraits { @@ -491,7 +491,7 @@ struct AggregateFuncTraitssize = hll->serialize((uint8_t*)slice->data); } }; -// when data load, after bitmap_init fucntion, bitmap_union column won't be null +// when data load, after bitmap_init function, bitmap_union column won't be null // so when init, update bitmap, the src is not null template <> struct AggregateFuncTraits { diff --git a/be/src/olap/base_compaction.cpp b/be/src/olap/base_compaction.cpp index a38c244f47..85b3363cad 100644 --- a/be/src/olap/base_compaction.cpp +++ b/be/src/olap/base_compaction.cpp @@ -85,7 +85,7 @@ OLAPStatus BaseCompaction::pick_rowsets_to_compact() { return OLAP_SUCCESS; } - // 2. the ratio between base rowset and all input cumulative rowsets reachs the threshold + // 2. the ratio between base rowset and all input cumulative rowsets reaches the threshold int64_t base_size = 0; int64_t cumulative_total_size = 0; for (auto& rowset : _input_rowsets) { @@ -99,21 +99,21 @@ OLAPStatus BaseCompaction::pick_rowsets_to_compact() { double base_cumulative_delta_ratio = config::base_cumulative_delta_ratio; if (base_size == 0) { // base_size == 0 means this may be a base version [0-1], which has no data. - // set to 1 to void devide by zero + // set to 1 to void divide by zero base_size = 1; } double cumulative_base_ratio = static_cast(cumulative_total_size) / base_size; if (cumulative_base_ratio > base_cumulative_delta_ratio) { LOG(INFO) << "satisfy the base compaction policy. tablet=" << _tablet->full_name() - << ", cumualtive_total_size=" << cumulative_total_size + << ", cumulative_total_size=" << cumulative_total_size << ", base_size=" << base_size << ", cumulative_base_ratio=" << cumulative_base_ratio << ", policy_ratio=" << base_cumulative_delta_ratio; return OLAP_SUCCESS; } - // 3. the interval since last base compaction reachs the threshold + // 3. the interval since last base compaction reaches the threshold int64_t base_creation_time = _input_rowsets[0]->creation_time(); int64_t interval_threshold = config::base_compaction_interval_seconds_since_last_operation; int64_t interval_since_last_base_compaction = time(NULL) - base_creation_time; @@ -135,7 +135,7 @@ OLAPStatus BaseCompaction::_check_rowset_overlapping(const vectorrowset_meta()->is_segments_overlapping()) { LOG(WARNING) << "There is overlapping rowset before cumulative point, " - << "rowset verison=" << rs->start_version() + << "rowset version=" << rs->start_version() << "-" << rs->end_version() << ", cumulative point=" << _tablet->cumulative_layer_point() << ", tablet=" << _tablet->full_name(); diff --git a/be/src/olap/base_compaction.h b/be/src/olap/base_compaction.h index 58d662def2..e93a7516d6 100644 --- a/be/src/olap/base_compaction.h +++ b/be/src/olap/base_compaction.h @@ -24,7 +24,7 @@ namespace doris { // BaseCompaction is derived from Compaction. // BaseCompaction will implements -// 1. its policy to pick rowsests +// 1. its policy to pick rowsets // 2. do compaction to produce new rowset. class BaseCompaction : public Compaction { diff --git a/be/src/olap/bloom_filter.hpp b/be/src/olap/bloom_filter.hpp index a3a04442b3..21662a5ce6 100644 --- a/be/src/olap/bloom_filter.hpp +++ b/be/src/olap/bloom_filter.hpp @@ -169,7 +169,7 @@ public: add_hash(hash); } - // Generate mutiple hash value according to following rule: + // Generate multiple hash value according to following rule: // new_hash_value = hash_high_part + (i * hash_low_part) void add_hash(uint64_t hash) { uint32_t hash1 = (uint32_t) hash; diff --git a/be/src/olap/bloom_filter_reader.h b/be/src/olap/bloom_filter_reader.h index 10d581a474..dcb6da2c41 100644 --- a/be/src/olap/bloom_filter_reader.h +++ b/be/src/olap/bloom_filter_reader.h @@ -25,7 +25,7 @@ namespace doris { -// Each bloom filter index contains mutiple bloom filter entries, +// Each bloom filter index contains multiple bloom filter entries, // each of which is related to a data block. // BloomFilterIndexReader allow caller to get specified bloom filter entry // by parsing bloom filter index buffer. diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index aa0f0b4523..c5526314b6 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -183,7 +183,7 @@ OLAPStatus Compaction::check_version_continuity(const vector& r RowsetSharedPtr rowset = rowsets[i]; if (rowset->start_version() != prev_rowset->end_version() + 1) { LOG(WARNING) << "There are missed versions among rowsets. " - << "prev_rowset verison=" << prev_rowset->start_version() + << "prev_rowset version=" << prev_rowset->start_version() << "-" << prev_rowset->end_version() << ", rowset version=" << rowset->start_version() << "-" << rowset->end_version(); @@ -201,7 +201,7 @@ OLAPStatus Compaction::check_correctness(const Merger::Statistics& stats) { LOG(WARNING) << "row_num does not match between cumulative input and output! " << "input_row_num=" << _input_row_num << ", merged_row_num=" << stats.merged_rows - << ", filted_row_num=" << stats.filtered_rows + << ", filtered_row_num=" << stats.filtered_rows << ", output_row_num=" << _output_rowset->num_rows(); // ATTN(cmy): We found that the num_rows in some rowset meta may be set to the wrong value, @@ -219,7 +219,7 @@ OLAPStatus Compaction::check_correctness(const Merger::Statistics& stats) { LOG(WARNING) << "row_num got from seg groups does not match between cumulative input and output! " << "input_row_num=" << num_rows << ", merged_row_num=" << stats.merged_rows - << ", filted_row_num=" << stats.filtered_rows + << ", filtered_row_num=" << stats.filtered_rows << ", output_row_num=" << _output_rowset->num_rows(); return OLAP_ERR_CHECK_LINES_ERROR; diff --git a/be/src/olap/compaction.h b/be/src/olap/compaction.h index f43bc6f1dc..12adbd481e 100644 --- a/be/src/olap/compaction.h +++ b/be/src/olap/compaction.h @@ -41,7 +41,7 @@ class Merger; // 1. pick rowsets satisfied to compact // 2. do compaction // 3. modify rowsets -// 4. gc unused rowstes +// 4. gc unused rowsets class Compaction { public: Compaction(TabletSharedPtr tablet, const std::string& label, const std::shared_ptr& parent_tracker); diff --git a/be/src/olap/rowset/alpha_rowset.cpp b/be/src/olap/rowset/alpha_rowset.cpp index 138b9dbd3a..bb9e6a994f 100644 --- a/be/src/olap/rowset/alpha_rowset.cpp +++ b/be/src/olap/rowset/alpha_rowset.cpp @@ -322,7 +322,7 @@ OLAPStatus AlphaRowset::init() { } // Before 0.12.10, the zone map columns number in duplicate table is the same with the key column numbers, // but after 0.12.10 we build zone map for the value column, so when first start the two number is not the same, - // it cuases start failed. When `expect_zone_maps_num > zone_maps_size` it may be the first start afer upgrade + // it causes start failed. When `expect_zone_maps_num > zone_maps_size` it may be the first start after upgrade if (expect_zone_maps_num > zone_maps_size) { LOG(WARNING) << "tablet: " << _rowset_meta->tablet_id() << " expect zone map size is " << expect_zone_maps_num << ", actual num is " << zone_maps_size diff --git a/be/src/olap/rowset/alpha_rowset_reader.cpp b/be/src/olap/rowset/alpha_rowset_reader.cpp index e38bd2cd28..dd9be208b4 100644 --- a/be/src/olap/rowset/alpha_rowset_reader.cpp +++ b/be/src/olap/rowset/alpha_rowset_reader.cpp @@ -217,7 +217,7 @@ OLAPStatus AlphaRowsetReader::_update_merge_ctx_and_build_merge_heap(AlphaMergeC OLAPStatus AlphaRowsetReader::_pull_next_row_for_merge_rowset_v2(RowCursor** row) { // if _merge_heap is not empty, return the row at top, and insert a new row - // from conresponding merge_ctx + // from corresponding merge_ctx if (!_merge_heap.empty()) { AlphaMergeContext* merge_ctx = _merge_heap.top(); *row = merge_ctx->row_cursor.get(); @@ -385,7 +385,7 @@ OLAPStatus AlphaRowsetReader::_init_merge_ctxs(RowsetReaderContext* read_context } if (!_is_segments_overlapping && _merge_ctxs.size() > 1) { - LOG(WARNING) << "invalid column_datas for cumulative rowset. column_datas size:" + LOG(WARNING) << "invalid column_data for cumulative rowset. column_data size:" << _merge_ctxs.size(); return OLAP_ERR_READER_READING_ERROR; } diff --git a/be/src/olap/rowset/beta_rowset_reader.cpp b/be/src/olap/rowset/beta_rowset_reader.cpp index ebe1b3113a..9ebb3106aa 100644 --- a/be/src/olap/rowset/beta_rowset_reader.cpp +++ b/be/src/olap/rowset/beta_rowset_reader.cpp @@ -104,7 +104,7 @@ OLAPStatus BetaRowsetReader::init(RowsetReaderContext* read_context) { RowBlockInfo output_block_info; output_block_info.row_num = 1024; output_block_info.null_supported = true; - // the output block's schema should be seek_columns to comform to v1 + // the output block's schema should be seek_columns to conform to v1 // TODO(hkp): this should be optimized to use return_columns output_block_info.column_ids = *(_context->seek_columns); _output_block->init(output_block_info); diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp b/be/src/olap/rowset/beta_rowset_writer.cpp index c75f056c42..c218bfb795 100644 --- a/be/src/olap/rowset/beta_rowset_writer.cpp +++ b/be/src/olap/rowset/beta_rowset_writer.cpp @@ -92,7 +92,7 @@ OLAPStatus BetaRowsetWriter::_add_row(const RowType& row) { if (PREDICT_FALSE(_segment_writer == nullptr)) { RETURN_NOT_OK(_create_segment_writer()); } - // TODO update rowset's zonemap + // TODO update rowset zonemap auto s = _segment_writer->append_row(row); if (PREDICT_FALSE(!s.ok())) { LOG(WARNING) << "failed to append row: " << s.to_string(); @@ -142,7 +142,7 @@ RowsetSharedPtr BetaRowsetWriter::build() { wblock->close(); } // When building a rowset, we must ensure that the current _segment_writer has been - // flushed, that is, the current _segment_wirter is nullptr + // flushed, that is, the current _segment_writer is nullptr DCHECK(_segment_writer == nullptr) << "segment must be null when build rowset"; _rowset_meta->set_num_rows(_num_rows_written); _rowset_meta->set_total_disk_size(_total_data_size); diff --git a/be/src/olap/rowset/beta_rowset_writer.h b/be/src/olap/rowset/beta_rowset_writer.h index e8edac242b..28b433a80d 100644 --- a/be/src/olap/rowset/beta_rowset_writer.h +++ b/be/src/olap/rowset/beta_rowset_writer.h @@ -85,7 +85,7 @@ private: int64_t _num_rows_written; int64_t _total_data_size; int64_t _total_index_size; - // TODO rowset's Zonemap + // TODO rowset Zonemap bool _is_pending = false; bool _already_built = false; diff --git a/be/src/olap/rowset/column_data.cpp b/be/src/olap/rowset/column_data.cpp index b1b15cba5a..ff6e5329ce 100644 --- a/be/src/olap/rowset/column_data.cpp +++ b/be/src/olap/rowset/column_data.cpp @@ -528,32 +528,32 @@ int ColumnData::delete_pruning_filter() { /* * the relationship between delete condition A and B is A || B. * if any delete condition is satisfied, the data can be filtered. - * elseif all delete condition is not satifsified, the data can't be filtered. + * elseif all delete condition is not satisfied, the data can't be filtered. * else is the partial satisfied. */ int ret = DEL_PARTIAL_SATISFIED; - bool del_partial_stastified = false; - bool del_stastified = false; - for (auto& delete_condtion : _delete_handler->get_delete_conditions()) { - if (delete_condtion.filter_version <= _segment_group->version().first) { + bool del_partial_satisfied = false; + bool del_satisfied = false; + for (auto& delete_condition : _delete_handler->get_delete_conditions()) { + if (delete_condition.filter_version <= _segment_group->version().first) { continue; } - Conditions* del_cond = delete_condtion.del_cond; + Conditions* del_cond = delete_condition.del_cond; int del_ret = del_cond->delete_pruning_filter(_segment_group->get_zone_maps()); if (DEL_SATISFIED == del_ret) { - del_stastified = true; + del_satisfied = true; break; } else if (DEL_PARTIAL_SATISFIED == del_ret) { - del_partial_stastified = true; + del_partial_satisfied = true; } else { continue; } } - if (del_stastified) { + if (del_satisfied) { ret = DEL_SATISFIED; - } else if (del_partial_stastified) { + } else if (del_partial_satisfied) { ret = DEL_PARTIAL_SATISFIED; } else { ret = DEL_NOT_SATISFIED; @@ -562,7 +562,7 @@ int ColumnData::delete_pruning_filter() { return ret; } -uint64_t ColumnData::get_filted_rows() { +uint64_t ColumnData::get_filtered_rows() { return _stats->rows_del_filtered; } diff --git a/be/src/olap/rowset/column_data.h b/be/src/olap/rowset/column_data.h index 7124dda140..332777b6a3 100644 --- a/be/src/olap/rowset/column_data.h +++ b/be/src/olap/rowset/column_data.h @@ -110,23 +110,23 @@ public: bool rowset_pruning_filter(); int delete_pruning_filter(); - uint64_t get_filted_rows(); + uint64_t get_filtered_rows(); SegmentGroup* segment_group() const { return _segment_group; } void set_segment_group(SegmentGroup* segment_group) { _segment_group = segment_group; } int64_t num_rows() const { return _segment_group->num_rows(); } - // To compatable with schmea change read, use this function to init column data + // To compatible with schema change read, use this function to init column data // for schema change read. Only called in get_first_row_block OLAPStatus schema_change_init(); private: DISALLOW_COPY_AND_ASSIGN(ColumnData); - // Try to seek to 'key'. If this funciton returned with OLAP_SUCCESS, current_row() + // Try to seek to 'key'. If this function returned with OLAP_SUCCESS, current_row() // point to the first row meet the requirement. // If there is no such row, OLAP_ERR_DATA_EOF will return. - // If error happend, other code will return + // If error happened, other code will return OLAPStatus _seek_to_row(const RowCursor& key, bool find_key, bool is_end_key); // seek to block_pos without load that block, caller must call _get_block() @@ -139,7 +139,7 @@ private: OLAPStatus _find_position_by_full_key( const RowCursor& key, bool find_last_key, RowBlockPosition *position); - // Used in _seek_to_row, this function will goto next row that vaild for this + // Used in _seek_to_row, this function will goto next row that valid for this // ColumnData OLAPStatus _next_row(const RowCursor** row, bool without_filter); diff --git a/be/src/olap/rowset/column_data_writer.cpp b/be/src/olap/rowset/column_data_writer.cpp index 3bfe298e92..f7e62a594c 100644 --- a/be/src/olap/rowset/column_data_writer.cpp +++ b/be/src/olap/rowset/column_data_writer.cpp @@ -129,7 +129,7 @@ OLAPStatus ColumnDataWriter::write(const RowType& row) { LOG(WARNING) << "failed to flush data while attaching row cursor."; return OLAP_ERR_OTHER_ERROR; } - RETURN_NOT_OK(_flush_segment_with_verfication()); + RETURN_NOT_OK(_flush_segment_with_verification()); } return OLAP_SUCCESS; } @@ -266,7 +266,7 @@ OLAPStatus ColumnDataWriter::_add_segment() { return OLAP_SUCCESS; } -OLAPStatus ColumnDataWriter::_flush_segment_with_verfication() { +OLAPStatus ColumnDataWriter::_flush_segment_with_verification() { uint64_t segment_size = _segment_writer->estimate_segment_size(); if (UNLIKELY(segment_size < _max_segment_size)) { return OLAP_SUCCESS; diff --git a/be/src/olap/rowset/column_data_writer.h b/be/src/olap/rowset/column_data_writer.h index 6f80afb284..1dd160755a 100644 --- a/be/src/olap/rowset/column_data_writer.h +++ b/be/src/olap/rowset/column_data_writer.h @@ -52,7 +52,7 @@ public: private: OLAPStatus _add_segment(); - OLAPStatus _flush_segment_with_verfication(); + OLAPStatus _flush_segment_with_verification(); OLAPStatus _finalize_segment(); OLAPStatus _flush_row_block(bool finalize); OLAPStatus _init_segment(); @@ -66,7 +66,7 @@ private: std::vector> _zone_maps; uint32_t _row_index; - RowBlock* _row_block; // 使用RowBlcok缓存要写入的数据 + RowBlock* _row_block; // 使用RowBlock缓存要写入的数据 RowCursor _cursor; SegmentWriter* _segment_writer; int64_t _num_rows; diff --git a/be/src/olap/rowset/column_reader.cpp b/be/src/olap/rowset/column_reader.cpp index 464b91a074..4921869aea 100644 --- a/be/src/olap/rowset/column_reader.cpp +++ b/be/src/olap/rowset/column_reader.cpp @@ -114,7 +114,7 @@ OLAPStatus StringColumnDirectReader::init( streams); if (NULL == length_stream) { - OLAP_LOG_WARNING("specifiedstream not found. [unique_id = %u]", + OLAP_LOG_WARNING("specified stream not found. [unique_id = %u]", _column_unique_id); return OLAP_ERR_COLUMN_STREAM_NOT_EXIST; } @@ -189,7 +189,7 @@ OLAPStatus StringColumnDirectReader::next_vector( * 1. MemPool is created by VectorizedRowBatch, * and reset when load row batch * 2. MemPool in init function is created by SegmentReader, - * and free by SegmentReader deconstructor. + * and free by SegmentReader deconstruction. */ OLAPStatus res = OLAP_SUCCESS; int64_t length = 0; @@ -678,7 +678,7 @@ ColumnReader* ColumnReader::create(uint32_t column_id, case OLAP_FIELD_TYPE_LIST: case OLAP_FIELD_TYPE_MAP: default: { - LOG(WARNING) << "unspported field type. field=" << column.name() + LOG(WARNING) << "unsupported field type. field=" << column.name() << ", type=" << column.type(); break; } diff --git a/be/src/olap/rowset/column_reader.h b/be/src/olap/rowset/column_reader.h index e608d57911..a102d83021 100644 --- a/be/src/olap/rowset/column_reader.h +++ b/be/src/olap/rowset/column_reader.h @@ -54,7 +54,7 @@ inline ReadOnlyFileStream* extract_stream(uint32_t column_unique_id, // Unique id -> PositionProvider typedef std::unordered_map UniqueIdPositionProviderMap; -// Unqiue id -> ColumnEncodingMessage +// Unique id -> ColumnEncodingMessage typedef std::map UniqueIdEncodingMap; // Integer和String的读取器。 @@ -240,7 +240,7 @@ protected: bool* _is_null; uint32_t _column_id; // column在schema内的id uint32_t _column_unique_id; // column的唯一id - BitFieldReader* _present_reader; // NULLable的字段的NULL值 + BitFieldReader* _present_reader; // NULLabel的字段的NULL值 std::vector _sub_readers; OlapReaderStatistics* _stats = nullptr; }; diff --git a/be/src/olap/rowset/column_writer.cpp b/be/src/olap/rowset/column_writer.cpp index 30ed92f3e7..d2a13e7412 100755 --- a/be/src/olap/rowset/column_writer.cpp +++ b/be/src/olap/rowset/column_writer.cpp @@ -122,7 +122,7 @@ ColumnWriter* ColumnWriter::create(uint32_t column_id, case OLAP_FIELD_TYPE_LIST: case OLAP_FIELD_TYPE_MAP: default: { - LOG(WARNING) << "Unspported field type. field=" << column.name() + LOG(WARNING) << "Unsupported field type. field=" << column.name() << ", type=" << column.type(); break; } @@ -165,7 +165,7 @@ OLAPStatus ColumnWriter::init() { unique_column_id(), StreamInfoMessage::PRESENT); if (NULL == _is_present_stream) { - OLAP_LOG_WARNING("fail to allocate IS PRESENT STERAM"); + OLAP_LOG_WARNING("fail to allocate IS PRESENT STREAM"); return OLAP_ERR_MALLOC_ERROR; } @@ -200,7 +200,7 @@ OLAPStatus ColumnWriter::init() { unique_column_id(), StreamInfoMessage::ROW_INDEX); if (NULL == _index_stream) { - OLAP_LOG_WARNING("fail to allocate Index STERAM"); + OLAP_LOG_WARNING("fail to allocate Index STREAM"); return OLAP_ERR_MALLOC_ERROR; } @@ -461,7 +461,7 @@ OLAPStatus ByteColumnWriter::init() { unique_column_id(), StreamInfoMessage::DATA); if (NULL == stream) { - OLAP_LOG_WARNING("fail to allocate DATA STERAM"); + OLAP_LOG_WARNING("fail to allocate DATA STREAM"); return OLAP_ERR_MALLOC_ERROR; } @@ -519,7 +519,7 @@ OLAPStatus IntegerColumnWriter::init() { _unique_column_id, StreamInfoMessage::DATA); if (NULL == stream) { - OLAP_LOG_WARNING("fail to allocate DATA STERAM"); + OLAP_LOG_WARNING("fail to allocate DATA STREAM"); return OLAP_ERR_MALLOC_ERROR; } @@ -707,13 +707,13 @@ OLAPStatus VarStringColumnWriter::finalize(ColumnDataHeaderMessage* header) { if (_use_dictionary_encoding) { res = _finalize_dict_encoding(); if (OLAP_SUCCESS != res) { - OLAP_LOG_WARNING("fail to finalize dict enconding."); + OLAP_LOG_WARNING("fail to finalize dict encoding."); return res; } } else { res = _finalize_direct_encoding(); if (OLAP_SUCCESS != res) { - OLAP_LOG_WARNING("fail to finalize direct enconding."); + OLAP_LOG_WARNING("fail to finalize direct encoding."); return res; } } diff --git a/be/src/olap/rowset/column_writer.h b/be/src/olap/rowset/column_writer.h index a6e029827f..136efc3852 100644 --- a/be/src/olap/rowset/column_writer.h +++ b/be/src/olap/rowset/column_writer.h @@ -343,7 +343,7 @@ public: unique_column_id(), StreamInfoMessage::DATA); if (NULL == _stream) { - OLAP_LOG_WARNING("fail to allocate DATA STERAM"); + OLAP_LOG_WARNING("fail to allocate DATA STREAM"); return OLAP_ERR_MALLOC_ERROR; } diff --git a/be/src/olap/rowset/segment_group.h b/be/src/olap/rowset/segment_group.h index 7f79a48981..de31bcecde 100644 --- a/be/src/olap/rowset/segment_group.h +++ b/be/src/olap/rowset/segment_group.h @@ -261,7 +261,7 @@ public: OLAPStatus convert_to_old_files(const std::string& snapshot_path, std::vector* success_links); - OLAPStatus remove_old_files(std::vector* linkes_to_remove); + OLAPStatus remove_old_files(std::vector* links_to_remove); OLAPStatus copy_files_to(const std::string& dir); @@ -288,12 +288,12 @@ private: const TabletSchema* _schema; std::string _rowset_path_prefix; // path of rowset Version _version; // version of associated data file - VersionHash _version_hash; // version hash for this segmentgroup + VersionHash _version_hash; // version hash for this segment group bool _delete_flag; - int32_t _segment_group_id; // segmentgroup id of segmentgroup - PUniqueId _load_id; // load id for segmentgroup - int32_t _num_segments; // number of segments in this segmentgroup - bool _index_loaded; // whether the segmentgroup has been read + int32_t _segment_group_id; // segment group id of segment group + PUniqueId _load_id; // load id for segment group + int32_t _num_segments; // number of segments in this segment group + bool _index_loaded; // whether the segment group has been read std::atomic _ref_count; // reference count MemIndex _index; bool _is_pending; diff --git a/be/src/olap/rowset/segment_reader.h b/be/src/olap/rowset/segment_reader.h index f2b723792d..a4dbc687f7 100644 --- a/be/src/olap/rowset/segment_reader.h +++ b/be/src/olap/rowset/segment_reader.h @@ -100,7 +100,7 @@ public: return _block_count; } - // 返回当前semgnet中,每块的行数 + // 返回当前segment中,每块的行数 uint32_t num_rows_in_block() { return _num_rows_in_block; } @@ -189,7 +189,7 @@ private: // 创建reader OLAPStatus _create_reader(size_t* buffer_size); - // we impelete seek to block in two phase. first, we just only move _next_block_id + // we implement seek to block in two phase. first, we just only move _next_block_id // to the position that we want goto; second, we seek the column streams to the // position we going to read. void _seek_to_block(int64_t block_id, bool without_filter); @@ -310,7 +310,7 @@ private: UniqueIdSet _include_bf_columns; UniqueIdToColumnIdMap _tablet_id_to_unique_id_map; // tablet id到unique id的映射 UniqueIdToColumnIdMap _unique_id_to_tablet_id_map; // unique id到tablet id的映射 - UniqueIdToColumnIdMap _unique_id_to_segment_id_map; // uniqid到segment id的映射 + UniqueIdToColumnIdMap _unique_id_to_segment_id_map; // unique id到segment id的映射 std::map _indices; std::map _streams; //需要读取的流 @@ -321,8 +321,8 @@ private: /* * _include_blocks is used for saving the state of block when encountering delete conditions, - * in this place the delete condition include the delete condtion, the query filter condition - * and the bloom filter condtion. + * in this place the delete condition include the delete condition, the query filter condition + * and the bloom filter condition. * DEL_SATISFIED is for block meet the delete condition, should be filtered. * but it is not stored, it reflect in _include_blocks. * DEL_NOT_SATISFIED is for block not meet the delete condition, should be held to read. diff --git a/be/src/olap/rowset/segment_v2/binary_dict_page.cpp b/be/src/olap/rowset/segment_v2/binary_dict_page.cpp index 961adfc76e..ad0efe0d10 100644 --- a/be/src/olap/rowset/segment_v2/binary_dict_page.cpp +++ b/be/src/olap/rowset/segment_v2/binary_dict_page.cpp @@ -202,7 +202,7 @@ Status BinaryDictPageDecoder::init() { DCHECK_EQ(_encoding_type, PLAIN_ENCODING); _data_page_decoder.reset(new BinaryPlainPageDecoder(_data, _options)); } else { - LOG(WARNING) << "invalide encoding type:" << _encoding_type; + LOG(WARNING) << "invalid encoding type:" << _encoding_type; return Status::Corruption(Substitute("invalid encoding type:$0", _encoding_type)); } diff --git a/be/src/olap/rowset/segment_v2/binary_dict_page.h b/be/src/olap/rowset/segment_v2/binary_dict_page.h index 635fe590c0..cb3b5e265e 100644 --- a/be/src/olap/rowset/segment_v2/binary_dict_page.h +++ b/be/src/olap/rowset/segment_v2/binary_dict_page.h @@ -46,7 +46,7 @@ enum { // Layout for dictionary encoded page: // Either header + embedded codeword page, which can be encoded with any // int PageBuilder, when mode_ = DICT_ENCODING. -// Or header + embedded BinaryPlainPage, when mode_ = PLAIN_ENCOING. +// Or header + embedded BinaryPlainPage, when mode_ = PLAIN_ENCODING. // Data pages start with mode_ = DICT_ENCODING, when the the size of dictionary // page go beyond the option_->dict_page_size, the subsequent data pages will switch // to string plain page automatically. diff --git a/be/src/olap/rowset/segment_v2/binary_plain_page.h b/be/src/olap/rowset/segment_v2/binary_plain_page.h index 6aad282f36..989ffdc5ad 100644 --- a/be/src/olap/rowset/segment_v2/binary_plain_page.h +++ b/be/src/olap/rowset/segment_v2/binary_plain_page.h @@ -172,7 +172,7 @@ public: if (_data.size < sizeof(uint32_t)) { std::stringstream ss; - ss << "file corrupton: not enough bytes for trailer in BinaryPlainPageDecoder ." + ss << "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ." "invalid data size:" << _data.size << ", trailer size:" << sizeof(uint32_t); return Status::Corruption(ss.str()); } diff --git a/be/src/olap/rowset/segment_v2/binary_prefix_page.h b/be/src/olap/rowset/segment_v2/binary_prefix_page.h index d19ac2b8de..7bb327c0f3 100644 --- a/be/src/olap/rowset/segment_v2/binary_prefix_page.h +++ b/be/src/olap/rowset/segment_v2/binary_prefix_page.h @@ -153,7 +153,7 @@ private: // seek to the first value at the given restart point Status _seek_to_restart_point(size_t restart_point_index); - // like _read_next_value, but derictly copy next value to output, not _current_value + // like _read_next_value, but directly copy next value to output, not _current_value Status _read_next_value_to_output(Slice prev, MemPool* mem_pool, Slice* output); // copy `_current_value` into `output`. diff --git a/be/src/olap/rowset/segment_v2/bitshuffle_page.h b/be/src/olap/rowset/segment_v2/bitshuffle_page.h index 1a17cca3b3..233fc2120d 100644 --- a/be/src/olap/rowset/segment_v2/bitshuffle_page.h +++ b/be/src/olap/rowset/segment_v2/bitshuffle_page.h @@ -227,7 +227,7 @@ public: CHECK(!_parsed); if (_data.size < BITSHUFFLE_PAGE_HEADER_SIZE) { std::stringstream ss; - ss << "file corrupton: invalid data size:" << _data.size << ", header size:" << BITSHUFFLE_PAGE_HEADER_SIZE; + ss << "file corruption: invalid data size:" << _data.size << ", header size:" << BITSHUFFLE_PAGE_HEADER_SIZE; return Status::InternalError(ss.str()); } _num_elements = decode_fixed32_le((const uint8_t*)&_data[0]); diff --git a/be/src/olap/rowset/segment_v2/bloom_filter.h b/be/src/olap/rowset/segment_v2/bloom_filter.h index d744301f49..4c77a5d285 100644 --- a/be/src/olap/rowset/segment_v2/bloom_filter.h +++ b/be/src/olap/rowset/segment_v2/bloom_filter.h @@ -31,7 +31,7 @@ namespace doris { namespace segment_v2 { struct BloomFilterOptions { - // false positive probablity + // false positive probability double fpp = 0.05; HashStrategyPB strategy = HASH_MURMUR3_X64_64; }; @@ -79,7 +79,7 @@ public: } // for read - // use deep copy to aquire the data + // use deep copy to acquire the data Status init(char* buf, uint32_t size, HashStrategyPB strategy) { DCHECK(size > 1); if (strategy == HASH_MURMUR3_X64_64) { @@ -146,7 +146,7 @@ private: // Compute the optimal bit number according to the following rule: // m = -n * ln(fpp) / (ln(2) ^ 2) // n: expected distinct record number - // fpp: false positive probablity + // fpp: false positive probability // the result will be power of 2 uint32_t _optimal_bit_num(uint64_t n, double fpp); diff --git a/be/src/olap/rowset/segment_v2/column_reader.cpp b/be/src/olap/rowset/segment_v2/column_reader.cpp index 64f1512e9b..fd5015c490 100644 --- a/be/src/olap/rowset/segment_v2/column_reader.cpp +++ b/be/src/olap/rowset/segment_v2/column_reader.cpp @@ -360,8 +360,8 @@ Status FileColumnIterator::next_batch(size_t* n, ColumnBlockView* dst) { } } - auto iter = _delete_partial_statisfied_pages.find(_page->page_index); - bool is_partial = iter != _delete_partial_statisfied_pages.end(); + auto iter = _delete_partial_satisfied_pages.find(_page->page_index); + bool is_partial = iter != _delete_partial_satisfied_pages.end(); if (is_partial) { dst->column_block()->set_delete_state(DEL_PARTIAL_SATISFIED); } else { @@ -470,7 +470,7 @@ Status FileColumnIterator::get_row_ranges_by_zone_map(CondColumn* cond_column, RowRanges* row_ranges) { if (_reader->has_zone_map()) { RETURN_IF_ERROR(_reader->get_row_ranges_by_zone_map(cond_column, delete_condition, - &_delete_partial_statisfied_pages, row_ranges)); + &_delete_partial_satisfied_pages, row_ranges)); } return Status::OK(); } diff --git a/be/src/olap/rowset/segment_v2/column_reader.h b/be/src/olap/rowset/segment_v2/column_reader.h index 65d4d4945a..39ae159e72 100644 --- a/be/src/olap/rowset/segment_v2/column_reader.h +++ b/be/src/olap/rowset/segment_v2/column_reader.h @@ -302,7 +302,7 @@ private: ordinal_t _current_ordinal = 0; // page indexes those are DEL_PARTIAL_SATISFIED - std::unordered_set _delete_partial_statisfied_pages; + std::unordered_set _delete_partial_satisfied_pages; }; // This iterator is used to read default value column diff --git a/be/src/olap/selection_vector.h b/be/src/olap/selection_vector.h index 772fa0fd66..00a4ec5542 100644 --- a/be/src/olap/selection_vector.h +++ b/be/src/olap/selection_vector.h @@ -39,7 +39,7 @@ public: set_all_false(); } - // returen the number of selected rows. + // return the number of selected rows. size_t count_selected() const { return Bits::Count(_bitmap.get(), _n_bytes); } diff --git a/be/src/olap/short_key_index.h b/be/src/olap/short_key_index.h index 2716920d65..86505eb5a0 100644 --- a/be/src/olap/short_key_index.h +++ b/be/src/olap/short_key_index.h @@ -33,7 +33,7 @@ namespace doris { // In our system, we have more complicated situation. // First, our keys can be NULL. -// Second, when key columns are not complete we want to distinguish GT and GE. For examle, +// Second, when key columns are not complete we want to distinguish GT and GE. For example, // there are two key columns a and b, we have only one condition a > 1. We can only encode // a prefix key 1, which is less than 1|2. This will make our read more data than // we actually need. So we want to add more marker. @@ -230,7 +230,7 @@ public: // Return an iterator which locates at the first item who is // equal with or greater than the given key. - // NOTE: If one key is the prefix of other key, this funciton thinks + // NOTE: If one key is the prefix of other key, this function thinks // that longer key is greater than the shorter key. ShortKeyIndexIterator lower_bound(const Slice& key) const { DCHECK(_parsed); diff --git a/be/src/olap/skiplist.h b/be/src/olap/skiplist.h index a019032f38..014053b8e4 100644 --- a/be/src/olap/skiplist.h +++ b/be/src/olap/skiplist.h @@ -50,9 +50,9 @@ public: // bool is_exist = skiplist->Find(key, &hint); // // 2. Do something separately based on the value of is_exist // if (is_exist) { - //     do_something1 (); + // do_something1 (); // } else { - //     do_something2 (); + // do_something2 (); // skiplist->InsertWithHint(key, is_exist, hint); // } // @@ -366,7 +366,7 @@ void SkipList::Insert(const Key& key, bool* overwritten) { Node* x = FindGreaterOrEqual(key, prev); #ifndef BE_TEST - // The key already exists and duplicate keys are not allowed, so we need to aggreage them + // The key already exists and duplicate keys are not allowed, so we need to aggregate them if (!_can_dup && x != nullptr && Equal(key, x->key)) { *overwritten = true; return; diff --git a/be/src/olap/snapshot_manager.cpp b/be/src/olap/snapshot_manager.cpp index 7d5f74ee3e..6dc5496592 100644 --- a/be/src/olap/snapshot_manager.cpp +++ b/be/src/olap/snapshot_manager.cpp @@ -476,7 +476,7 @@ OLAPStatus SnapshotManager::_create_snapshot_files( // A need to clone 900 from B, but B's last version is 901, and 901 is not a visible version // and 901 will be reverted // since 900 is not the last version in B, 900 maybe compacted with other versions - // if A only get 900, then A's last version will be a comulative delta + // if A only get 900, then A's last version will be a cumulative delta // many codes in be assumes that the last version is a single delta // both clone and backup restore depend on this logic // TODO (yiguolei) fix it in the future diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp index 163cae49aa..72ea4c78f0 100644 --- a/be/src/olap/storage_engine.cpp +++ b/be/src/olap/storage_engine.cpp @@ -381,7 +381,7 @@ Status StorageEngine::_check_all_root_path_cluster_id() { if (tmp_cluster_id == -1) { _is_all_cluster_id_exist = false; } else if (tmp_cluster_id == cluster_id) { - // both hava right cluster id, do nothing + // both have right cluster id, do nothing } else if (cluster_id == -1) { cluster_id = tmp_cluster_id; } else { diff --git a/be/src/olap/storage_engine.h b/be/src/olap/storage_engine.h index f5707239d7..fcc6721569 100644 --- a/be/src/olap/storage_engine.h +++ b/be/src/olap/storage_engine.h @@ -178,7 +178,7 @@ public: _heartbeat_flags = heartbeat_flags; } - // start all backgroud threads. This should be call after env is ready. + // start all background threads. This should be call after env is ready. Status start_bg_threads(); void stop(); @@ -289,7 +289,7 @@ private: // _file_cache is a lru_cache for file descriptors of files opened by doris, // which can be shared by others. Why we need to share cache with others? - // Beacuse a unique memory space is easier for management. For example, + // Because a unique memory space is easier for management. For example, // we can deal with segment v1's cache and segment v2's cache at same time. // Note that, we must create _file_cache before sharing it with other. // (e.g. the storage engine's open function must be called earlier than diff --git a/be/src/olap/stream_index_writer.h b/be/src/olap/stream_index_writer.h index ec289e0231..18eb1885fb 100755 --- a/be/src/olap/stream_index_writer.h +++ b/be/src/olap/stream_index_writer.h @@ -32,7 +32,7 @@ public: PositionEntryWriter(); // 获取指定位置的position信息 int64_t positions(size_t index) const; - // 获取pisition的个数 + // 获取position的个数 int32_t positions_count() const; // 设置统计信息 OLAPStatus set_statistic(ColumnStatistics* statistic); diff --git a/be/src/olap/tablet_meta_manager.cpp b/be/src/olap/tablet_meta_manager.cpp index 74fdc1653c..6935c2581e 100755 --- a/be/src/olap/tablet_meta_manager.cpp +++ b/be/src/olap/tablet_meta_manager.cpp @@ -141,7 +141,7 @@ OLAPStatus TabletMetaManager::traverse_headers(OlapMeta* meta, // new format key format: "tabletmata_" + tablet_id + "_" + schema_hash 0.10 split_string(key, '_', &parts); if (parts.size() != 3) { - LOG(WARNING) << "invalid tablet_meta key:" << key << ", splitted size:" << parts.size(); + LOG(WARNING) << "invalid tablet_meta key:" << key << ", split size:" << parts.size(); return true; } TTabletId tablet_id = std::stol(parts[1].c_str(), nullptr, 10); diff --git a/be/src/olap/version_graph.cpp b/be/src/olap/version_graph.cpp index f7b27b2fa7..6207e988e5 100644 --- a/be/src/olap/version_graph.cpp +++ b/be/src/olap/version_graph.cpp @@ -86,7 +86,7 @@ void TimestampedVersionTracker::_init_stale_version_path_map( else if (diff > 0) { return false; } - // when the version diff is equal, compare rowset createtime + // when the version diff is equal, compare rowset create time return a->creation_time() < b->creation_time(); }); @@ -493,7 +493,7 @@ OLAPStatus VersionGraph::delete_version_from_graph(const Version& version) { int64_t start_vertex_index = _vertex_index_map[start_vertex_value]; int64_t end_vertex_index = _vertex_index_map[end_vertex_value]; // Remove edge and its reverse edge. - // When there are same versions in edges, just remove the frist version. + // When there are same versions in edges, just remove the first version. auto start_edges_iter = _version_graph[start_vertex_index].edges.begin(); while (start_edges_iter != _version_graph[start_vertex_index].edges.end()) { if (*start_edges_iter == end_vertex_index) { @@ -529,7 +529,7 @@ void VersionGraph::_add_vertex_to_graph(int64_t vertex_value) { OLAPStatus VersionGraph::capture_consistent_versions(const Version& spec_version, std::vector* version_path) const { if (spec_version.first > spec_version.second) { - LOG(WARNING) << "invalid specfied version. " + LOG(WARNING) << "invalid specified version. " << "spec_version=" << spec_version.first << "-" << spec_version.second; return OLAP_ERR_INPUT_PARAMETER_ERROR; } diff --git a/be/src/olap/version_graph.h b/be/src/olap/version_graph.h index e051fbc4c5..f516fe8bf7 100644 --- a/be/src/olap/version_graph.h +++ b/be/src/olap/version_graph.h @@ -41,7 +41,7 @@ public: /// Reconstruct the graph, begin construction the vertex vec and edges list will be cleared. void reconstruct_version_graph(const std::vector& rs_metas, int64_t* max_version); - /// Add a version to this graph, graph will add the vesion and edge in version. + /// Add a version to this graph, graph will add the version and edge in version. void add_version_to_graph(const Version& version); /// Delete a version from graph. Notice that this del operation only remove this edges and /// remain the vertex. @@ -110,7 +110,7 @@ using TimestampedVersionSharedPtr = std::shared_ptr; class TimestampedVersionPathContainer { public: - /// TimestampedVersionPathContainer construction function, max_create_time is assgined to 0. + /// TimestampedVersionPathContainer construction function, max_create_time is assigned to 0. TimestampedVersionPathContainer():_max_create_time(0) { } @@ -163,7 +163,7 @@ public: std::vector* version_path) const; /// Capture all expired path version. - /// When the last rowset createtime of a path greater than expired time which can be expressed + /// When the last rowset create time of a path greater than expired time which can be expressed /// "now() - tablet_rowset_stale_sweep_time_sec" , this path will be remained. /// Otherwise, this path will be added to path_version. void capture_expired_paths(int64_t stale_sweep_endtime, diff --git a/be/src/runtime/buffer_control_block.cpp b/be/src/runtime/buffer_control_block.cpp index 61f45a19ca..a664ff298e 100644 --- a/be/src/runtime/buffer_control_block.cpp +++ b/be/src/runtime/buffer_control_block.cpp @@ -104,7 +104,7 @@ Status BufferControlBlock::add_batch(TFetchDataResult* result) { if (_waiting_rpc.empty()) { _buffer_rows += num_rows; _batch_queue.push_back(result); - _data_arriaval.notify_one(); + _data_arrival.notify_one(); } else { auto ctx = _waiting_rpc.front(); _waiting_rpc.pop_front(); @@ -121,7 +121,7 @@ Status BufferControlBlock::get_batch(TFetchDataResult* result) { boost::unique_lock l(_lock); while (_batch_queue.empty() && !_is_close && !_is_cancelled) { - _data_arriaval.wait(l); + _data_arrival.wait(l); } // if Status has been set, return fail; @@ -200,7 +200,7 @@ Status BufferControlBlock::close(Status exec_status) { _status = exec_status; // notify blocked get thread - _data_arriaval.notify_all(); + _data_arrival.notify_all(); if (!_waiting_rpc.empty()) { if (_status.ok()) { for (auto& ctx : _waiting_rpc) { @@ -220,7 +220,7 @@ Status BufferControlBlock::cancel() { boost::unique_lock l(_lock); _is_cancelled = true; _data_removal.notify_all(); - _data_arriaval.notify_all(); + _data_arrival.notify_all(); for (auto& ctx : _waiting_rpc) { ctx->on_failure(Status::Cancelled("Cancelled")); } diff --git a/be/src/runtime/buffer_control_block.h b/be/src/runtime/buffer_control_block.h index cd3f80f7fb..5872b5db26 100644 --- a/be/src/runtime/buffer_control_block.h +++ b/be/src/runtime/buffer_control_block.h @@ -57,7 +57,7 @@ struct GetResultBatchCtx { void on_data(TFetchDataResult* t_result, int64_t packet_seq, bool eos = false); }; -// buffer used for result customer and productor +// buffer used for result customer and producer class BufferControlBlock { public: BufferControlBlock(const TUniqueId& id, int buffer_size); @@ -72,7 +72,7 @@ public: void get_batch(GetResultBatchCtx* ctx); // close buffer block, set _status to exec_status and set _is_close to true; - // called because data has been read or error happend. + // called because data has been read or error happened. Status close(Status exec_status); // this is called by RPC, called from coordinator Status cancel(); @@ -110,7 +110,7 @@ private: // protects all subsequent data in this block boost::mutex _lock; // signal arrival of new batch or the eos/cancelled condition - boost::condition_variable _data_arriaval; + boost::condition_variable _data_arrival; // signal removal of data by stream consumer boost::condition_variable _data_removal; @@ -118,7 +118,7 @@ private: // It is shared with PlanFragmentExecutor and will be called in two different // threads. But their calls are all at different time, there is no problem of - // multithreaded access. + // multithreading access. std::shared_ptr _query_statistics; }; diff --git a/be/src/runtime/bufferpool/buffer_allocator.cc b/be/src/runtime/bufferpool/buffer_allocator.cc index 0f0f31fa59..22fe25500c 100644 --- a/be/src/runtime/bufferpool/buffer_allocator.cc +++ b/be/src/runtime/bufferpool/buffer_allocator.cc @@ -334,7 +334,7 @@ int64_t BufferPool::BufferAllocator::ScavengeBuffers( // threads can't take the memory that we need from an arena that we haven't yet // examined (or from 'system_bytes_available_') because in order to do so, it would // have had to return the equivalent amount of memory to an earlier arena or added - // it back into 'systems_bytes_reamining_'. The former can't happen since we're + // it back into 'systems_bytes_remaining_'. The former can't happen since we're // still holding those locks, and the latter is solved by trying to decrease // system_bytes_remaining_ with DecreaseBytesRemaining() at the end. DCHECK_GT(target_bytes, 0); diff --git a/be/src/runtime/bufferpool/buffer_allocator.h b/be/src/runtime/bufferpool/buffer_allocator.h index 644d4a5828..5a8b4bf7e4 100644 --- a/be/src/runtime/bufferpool/buffer_allocator.h +++ b/be/src/runtime/bufferpool/buffer_allocator.h @@ -45,7 +45,7 @@ namespace doris { /// guaranteed to succeed unless an unexpected system error occurs (e.g. we can't allocate /// all of the required memory from the OS). Reservations must be set up so that the total /// of all reservations does not exceed 'system_bytes_limit', thus ensuring that -/// BufferAllocator can alway find memory to fulfill reservations. +/// BufferAllocator can always find memory to fulfill reservations. /// /// +========================+ /// | IMPLEMENTATION NOTES | diff --git a/be/src/runtime/exec_env.h b/be/src/runtime/exec_env.h index 1f973489e1..8563cd83aa 100644 --- a/be/src/runtime/exec_env.h +++ b/be/src/runtime/exec_env.h @@ -143,7 +143,7 @@ public: private: Status _init(const std::vector& store_paths); - void _destory(); + void _destroy(); Status _init_mem_tracker(); /// Initialise 'buffer_pool_' and 'buffer_reservation_' with given capacity. diff --git a/be/src/runtime/exec_env_init.cpp b/be/src/runtime/exec_env_init.cpp index 36bac1433a..e96a3b565e 100644 --- a/be/src/runtime/exec_env_init.cpp +++ b/be/src/runtime/exec_env_init.cpp @@ -213,7 +213,7 @@ void ExecEnv::_init_buffer_pool(int64_t min_page_size, _buffer_reservation->InitRootTracker(nullptr, capacity); } -void ExecEnv::_destory() { +void ExecEnv::_destroy() { //Only destroy once after init if (!_is_init) { return; @@ -249,7 +249,7 @@ void ExecEnv::_destory() { } void ExecEnv::destroy(ExecEnv* env) { - env->_destory(); + env->_destroy(); } } diff --git a/be/src/runtime/snapshot_loader.cpp b/be/src/runtime/snapshot_loader.cpp index 4da8dbd78b..1ea51efaec 100644 --- a/be/src/runtime/snapshot_loader.cpp +++ b/be/src/runtime/snapshot_loader.cpp @@ -582,7 +582,7 @@ Status SnapshotLoader::move( // 1. simply delete the old dir and replace it with the snapshot dir try { - // This remove seems saft enough, because we already get + // This remove seems soft enough, because we already get // tablet id and schema hash from this path, which // means this path is a valid path. boost::filesystem::remove_all(tablet_dir); diff --git a/be/src/runtime/snapshot_loader.h b/be/src/runtime/snapshot_loader.h index 9c046f87f8..e3091eccba 100644 --- a/be/src/runtime/snapshot_loader.h +++ b/be/src/runtime/snapshot_loader.h @@ -44,13 +44,13 @@ struct FileStat { * Upload: * upload() will upload the specified snapshot * to remote storage via broker. - * Each call of upload() is reponsible for severval tablet snapshots. + * Each call of upload() is responsible for several tablet snapshots. * * It will try to get the existing files in remote storage, * and only upload the incremental part of files. * * Download: - * download() will download the romote tablet snapshot files + * download() will download the remote tablet snapshot files * to local snapshot dir via broker. * It will also only download files which does not exist in local dir. * @@ -117,7 +117,7 @@ private: const std::string& tablet_path, int64_t tablet_id, int64_t start_version, int64_t end_version, - int64_t vesion_hash, int32_t seg_num, + int64_t version_hash, int32_t seg_num, const std::string suffix, std::string* snapshot_file, std::string* tablet_file); diff --git a/be/src/runtime/spill_sorter.cc b/be/src/runtime/spill_sorter.cc index a658aafd77..104839a625 100644 --- a/be/src/runtime/spill_sorter.cc +++ b/be/src/runtime/spill_sorter.cc @@ -44,7 +44,7 @@ namespace doris { const int BLOCKS_REQUIRED_FOR_MERGE = 3; // Error message when pinning fixed or variable length blocks failed. -// TODO: Add the node id that iniated the sort +// TODO: Add the node id that initiated the sort const string PIN_FAILED_ERROR_MSG_1 = "Failed to pin block for "; const string PIN_FAILED_ERROR_MSG_2 = "-length data needed " "for sorting. Reducing query concurrency or increasing the memory limit may help " @@ -252,7 +252,7 @@ public: // Performs a quicksort for tuples in 'run' followed by an insertion sort to // finish smaller blocks. - // Returns early if _stste->is_cancelled() is true. No status + // Returns early if _state->is_cancelled() is true. No status // is returned - the caller must check for cancellation. void sort(Run* run); @@ -1253,7 +1253,7 @@ Status SpillSorter::merge_intermediate_runs() { scoped_ptr intermediate_merge_batch; while (_sorted_runs.size() > max_runs_per_final_merge) { // An intermediate merge adds one merge to _unmerged_sorted_runs. - // Merging 'runs - (_max_runs_final - 1)' number of runs is sifficient to guarantee + // Merging 'runs - (_max_runs_final - 1)' number of runs is sufficient to guarantee // that the final merge can be performed. int num_runs_to_merge = std::min(max_runs_per_intermediate_merge, _sorted_runs.size() - max_runs_per_intermediate_merge); diff --git a/be/src/runtime/stream_load/stream_load_context.cpp b/be/src/runtime/stream_load/stream_load_context.cpp index 3dbe2718e6..a8f5d86a5f 100644 --- a/be/src/runtime/stream_load/stream_load_context.cpp +++ b/be/src/runtime/stream_load/stream_load_context.cpp @@ -90,7 +90,7 @@ std::string StreamLoadContext::to_json() const { } /* - * The old mini load result format is as followes: + * The old mini load result format is as follows: * (which defined in src/util/json_util.cpp) * * { diff --git a/be/src/runtime/tablets_channel.h b/be/src/runtime/tablets_channel.h index 6e7851152b..d2426b7b24 100644 --- a/be/src/runtime/tablets_channel.h +++ b/be/src/runtime/tablets_channel.h @@ -92,7 +92,7 @@ private: // id of this load channel TabletsChannelKey _key; - // make execute sequece + // make execute sequence std::mutex _lock; enum State { diff --git a/be/src/runtime/thread_resource_mgr.cpp b/be/src/runtime/thread_resource_mgr.cpp index 4cc862759c..b50645334e 100644 --- a/be/src/runtime/thread_resource_mgr.cpp +++ b/be/src/runtime/thread_resource_mgr.cpp @@ -93,7 +93,7 @@ ThreadResourceMgr::ResourcePool* ThreadResourceMgr::register_pool() { void ThreadResourceMgr::unregister_pool(ResourcePool* pool) { DCHECK(pool != NULL); boost::unique_lock< boost::mutex> l(_lock); - // this may be double unregisted after pr #3326 by LaiYingChun, so check if the pool is already unregisted + // this may be double unregistered after pr #3326 by LaiYingChun, so check if the pool is already unregisted if (_pools.find(pool) != _pools.end()) { _pools.erase(pool); _free_pool_objs.push_back(pool); diff --git a/be/src/service/backend_service.cpp b/be/src/service/backend_service.cpp index 09f22dd114..90baf814d8 100644 --- a/be/src/service/backend_service.cpp +++ b/be/src/service/backend_service.cpp @@ -171,7 +171,7 @@ void BackendService::submit_export_task(TStatus& t_status, const TExportTaskRequ // // Status status = _exec_env->export_task_mgr()->start_task(request); // if (status.ok()) { -// VLOG_RPC << "start export task successfull id=" +// VLOG_RPC << "start export task successful id=" // << request.params.params.fragment_instance_id; // } else { // VLOG_RPC << "start export task failed id=" @@ -259,7 +259,7 @@ void BackendService::open_scanner(TScanOpenResult& result_, const TScanOpenParam result_.__set_selected_columns(selected_columns); } -// fetch result from polling the queue, should always maintaince the context offset, otherwise inconsistent result +// fetch result from polling the queue, should always maintain the context offset, otherwise inconsistent result void BackendService::get_next(TScanBatchResult& result_, const TScanNextBatchParams& params) { std::string context_id = params.context_id; u_int64_t offset = params.offset; diff --git a/be/src/service/backend_service.h b/be/src/service/backend_service.h index a2b9f3a60b..1a0c8498a7 100644 --- a/be/src/service/backend_service.h +++ b/be/src/service/backend_service.h @@ -61,7 +61,7 @@ class TExportTaskRequest; class TExportStatusResult; -// This class just forword rpc for actual handler +// This class just forward rpc for actual handler // make this class because we can bind multiple service on single point class BackendService : public BackendServiceIf { public: diff --git a/be/src/service/brpc.h b/be/src/service/brpc.h index d3fa30f481..1d90e413b7 100644 --- a/be/src/service/brpc.h +++ b/be/src/service/brpc.h @@ -20,7 +20,7 @@ // This file is used to fixed macro conflict between butil and gutil // all header need by brpc is contain in this file. // include this file instead of include -// and this file must put the first include in soure file +// and this file must put the first include in source file #include "gutil/macros.h" // Macros in the guti/macros.h, use butil's define diff --git a/be/src/udf/CMakeLists.txt b/be/src/udf/CMakeLists.txt index c8a5b05d67..21fcd5dbd2 100755 --- a/be/src/udf/CMakeLists.txt +++ b/be/src/udf/CMakeLists.txt @@ -31,7 +31,7 @@ add_library(DorisUdf udf.cpp udf_ir.cpp) set_target_properties(DorisUdf PROPERTIES COMPILE_FLAGS "-DDORIS_UDF_SDK_BUILD") # We can't use the normal link list since we want to pick up libDorisUdf (the external -# library) rather than the interal libUdf. +# library) rather than the internal libUdf. set (UDF_TEST_LINK_LIBS -Wl,--start-group Common diff --git a/be/src/util/batch_process_thread_pool.hpp b/be/src/util/batch_process_thread_pool.hpp index e4148b556d..ad8d1970b2 100644 --- a/be/src/util/batch_process_thread_pool.hpp +++ b/be/src/util/batch_process_thread_pool.hpp @@ -71,7 +71,7 @@ public: // future. Therefore the caller needs to ensure that any data referenced by work (if T // is, e.g., a pointer type) remains valid until work has been processed, and it's up to // the caller to provide their own signalling mechanism to detect this (or to wait until - // after DrainAndshutdown returns). + // after DrainAndShutdown returns). // // Returns true if the work item was successfully added to the queue, false otherwise // (which typically means that the thread pool has already been shut down). @@ -103,7 +103,7 @@ public: // Blocks until the work queue is empty, and then calls shutdown to stop the worker // threads and Join to wait until they are finished. - // Any work Offer()'ed during DrainAndshutdown may or may not be processed. + // Any work Offer()'ed during DrainAndShutdown may or may not be processed. void drain_and_shutdown() { { boost::unique_lock l(_lock); @@ -129,7 +129,7 @@ private: // the first task should blocking, or the tasks queue is empty has_task = _work_queue.blocking_get(&task); } else { - // the 2rd, 3rd... task shoudl non blocking get + // the 2rd, 3rd... task should non blocking get has_task = _work_queue.non_blocking_get(&task); if (!has_task) { break; diff --git a/be/src/util/bit_util.h b/be/src/util/bit_util.h index d8b867984d..56d87ae5b0 100644 --- a/be/src/util/bit_util.h +++ b/be/src/util/bit_util.h @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#ifndef DORIS_BE_SRC_COMMON_UITL_BIT_UTIL_H -#define DORIS_BE_SRC_COMMON_UITL_BIT_UTIL_H +#ifndef DORIS_BE_SRC_COMMON_UTIL_BIT_UTIL_H +#define DORIS_BE_SRC_COMMON_UTIL_BIT_UTIL_H #include diff --git a/be/src/util/bitmap.h b/be/src/util/bitmap.h index edc1a96f0a..52cccce29f 100644 --- a/be/src/util/bitmap.h +++ b/be/src/util/bitmap.h @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#ifndef DORIS_BE_SRC_COMMON_UITL_BITMAP_H -#define DORIS_BE_SRC_COMMON_UITL_BITMAP_H +#ifndef DORIS_BE_SRC_COMMON_UTIL_BITMAP_H +#define DORIS_BE_SRC_COMMON_UTIL_BITMAP_H #include "util/bit_util.h" #include "gutil/strings/fastmem.h" diff --git a/be/src/util/broker_load_error_hub.cpp b/be/src/util/broker_load_error_hub.cpp index 831d3b3fd9..492e33c2ce 100644 --- a/be/src/util/broker_load_error_hub.cpp +++ b/be/src/util/broker_load_error_hub.cpp @@ -96,7 +96,7 @@ Status BrokerLoadErrorHub::write_to_broker() { std::string BrokerLoadErrorHub::debug_string() const { std::stringstream out; - out << "(tatal_error_num=" << _total_error_num << ")"; + out << "(total_error_num=" << _total_error_num << ")"; return out.str(); } diff --git a/be/src/util/broker_load_error_hub.h b/be/src/util/broker_load_error_hub.h index 593844047e..eb7e470a2b 100644 --- a/be/src/util/broker_load_error_hub.h +++ b/be/src/util/broker_load_error_hub.h @@ -32,7 +32,7 @@ namespace doris { class BrokerWriter; class ExecEnv; -// Broker load error hub will write load error info to the sepcified +// Broker load error hub will write load error info to the specified // remote storage via broker. // We should only open this error hub if there are error line. // Because open the writer via broker may cost several seconds. diff --git a/be/src/util/coding.h b/be/src/util/coding.h index 57e839f6d1..2361441d8d 100644 --- a/be/src/util/coding.h +++ b/be/src/util/coding.h @@ -144,7 +144,7 @@ inline uint8_t* encode_varint64(uint8_t* dst, uint64_t v) { static const unsigned int B = 128; while (v >= B) { // Fetch low seven bits from current v, and the eight bit is marked as compression mark. - // v | B is optimsed from (v & (B-1)) | B, because result is assgined to uint8_t and other bits + // v | B is optimised from (v & (B-1)) | B, because result is assigned to uint8_t and other bits // is cleared by implicit conversion. *(dst++) = v | B; v >>= 7; diff --git a/be/src/util/condition_variable.h b/be/src/util/condition_variable.h index 18df7c254e..c637f6d388 100755 --- a/be/src/util/condition_variable.h +++ b/be/src/util/condition_variable.h @@ -36,7 +36,7 @@ // called wait(). This results in POOR performance. A much better // approach to getting a lot of threads out of wait() is to have each // thread (upon exiting wait()) call notify_one() to free up another -// Wait'ing thread. Look at condition_variable_unittest.cc for +// Waiting thread. Look at condition_variable_unittest.cc for // both examples. // // notify_all() can be used nicely during teardown, as it gets the job diff --git a/be/src/util/symbols_util.cpp b/be/src/util/symbols_util.cpp index eb623a7605..0d29625c59 100644 --- a/be/src/util/symbols_util.cpp +++ b/be/src/util/symbols_util.cpp @@ -28,7 +28,7 @@ using boost::regex; namespace doris { // For the rules about gcc-compatible name mangling, see: // http://mentorembedded.github.io/cxx-abi/abi.html#mangling -// This implementation *is* not generally compatible. It is harded coded to +// This implementation *is* not generally compatible. It is hard coded to // only work with functions that implement the UDF or UDA signature. That is, // functions of the form: // namespace::Function(doris_udf::FunctionContext*, const doris_udf::AnyVal&, etc) diff --git a/be/src/util/thread.cpp b/be/src/util/thread.cpp index 128896d128..b7cb63192c 100644 --- a/be/src/util/thread.cpp +++ b/be/src/util/thread.cpp @@ -107,13 +107,13 @@ private: // efficient here. typedef std::map ThreadCategory; - // All thread categorys, keyed on the category name. + // All thread categories, keyed on the category name. typedef std::map ThreadCategoryMap; // Protects _thread_categories and thread metrics. mutable Mutex _lock; - // All thread categorys that ever contained a thread, even if empty + // All thread categories that ever contained a thread, even if empty ThreadCategoryMap _thread_categories; // Counters to track all-time total number of threads, and the diff --git a/be/src/util/thread.h b/be/src/util/thread.h index 2f587e6a98..184f51893f 100644 --- a/be/src/util/thread.h +++ b/be/src/util/thread.h @@ -130,7 +130,7 @@ public: // Thread object, so will be faster to call. // // Thread::unique_thread_id() (or Thread::tid()) should be preferred for - // performance sensistive code, however it is only guaranteed to return a + // performance sensitive code, however it is only guaranteed to return a // unique and stable thread ID, not necessarily the system thread ID. static int64_t current_thread_id(); diff --git a/be/src/util/thrift_rpc_helper.cpp b/be/src/util/thrift_rpc_helper.cpp index 6bd750bb1f..d4b9249a3f 100644 --- a/be/src/util/thrift_rpc_helper.cpp +++ b/be/src/util/thrift_rpc_helper.cpp @@ -61,7 +61,7 @@ Status ThriftRpcHelper::rpc( ClientConnection client( _s_exec_env->get_client_cache(), address, timeout_ms, &status); if (!status.ok()) { - LOG(WARNING) << "Connect frontent failed, address=" << address + LOG(WARNING) << "Connect frontend failed, address=" << address << ", status=" << status.get_error_msg(); return status; } diff --git a/be/src/util/timezone_utils.cpp b/be/src/util/timezone_utils.cpp index 9bc70e6a83..5a61b18fdb 100644 --- a/be/src/util/timezone_utils.cpp +++ b/be/src/util/timezone_utils.cpp @@ -27,20 +27,20 @@ const std::string TimezoneUtils::default_time_zone = "+08:00"; bool TimezoneUtils::find_cctz_time_zone(const std::string& timezone, cctz::time_zone& ctz) { re2::StringPiece value; if (time_zone_offset_format_reg.Match(timezone, 0, timezone.size(), RE2::UNANCHORED, &value, 1)) { - bool postive = value[0] != '-'; + bool positive = value[0] != '-'; //Regular expression guarantees hour and minute mush be int int hour = std::stoi(value.substr(1, 2).as_string()); int minute = std::stoi(value.substr(4, 2).as_string()); // timezone offsets around the world extended from -12:00 to +14:00 - if (!postive && hour > 12) { + if (!positive && hour > 12) { return false; - } else if (postive && hour > 14) { + } else if (positive && hour > 14) { return false; } int offset = hour * 60 * 60 + minute * 60; - offset *= postive ? 1 : -1; + offset *= positive ? 1 : -1; ctz = cctz::fixed_time_zone(cctz::seconds(offset)); return true; } else if (timezone == "CST"){ diff --git a/be/src/util/trace.cpp b/be/src/util/trace.cpp index f104f90e31..6033a1bbe1 100644 --- a/be/src/util/trace.cpp +++ b/be/src/util/trace.cpp @@ -200,7 +200,7 @@ string Trace::DumpToString(int flags) const { } string Trace::MetricsAsJSON() const { - // TODO(yingchun): simplily implement here, we could import JsonWriter in the future. + // TODO(yingchun): simplify implement here, we could import JsonWriter in the future. rapidjson::StringBuffer buf; rapidjson::Writer jw(buf); MetricsToJSON(&jw); diff --git a/be/src/util/uid_util.h b/be/src/util/uid_util.h index c5c085906f..e45bc60236 100644 --- a/be/src/util/uid_util.h +++ b/be/src/util/uid_util.h @@ -31,7 +31,7 @@ namespace doris { -// convert int to a hex format string, buf must enough to hold coverted hex string +// convert int to a hex format string, buf must enough to hold converted hex string template inline void to_hex(T val, char* buf) { static const char* digits = "0123456789abcdef"; diff --git a/be/src/util/utf8_check.h b/be/src/util/utf8_check.h index 57841bf5fc..62d18b068f 100644 --- a/be/src/util/utf8_check.h +++ b/be/src/util/utf8_check.h @@ -25,8 +25,8 @@ namespace doris { // check utf8 code using simd instructions // Return true - success, false fail bool validate_utf8(const char *src, size_t len); -// chech utf8 use naive c++ +// check utf8 use naive c++ bool validate_utf8_naive(const char *data, size_t len); -} // namespce doris +} // namespace doris #endif // DORIS_BE_SRC_UTIL_UTF8_CHECK_H diff --git a/be/test/exec/schema_scanner/schema_schemata_scanner_test.cpp b/be/test/exec/schema_scanner/schema_schemata_scanner_test.cpp index cd787b57d6..2ca06796bd 100644 --- a/be/test/exec/schema_scanner/schema_schemata_scanner_test.cpp +++ b/be/test/exec/schema_scanner/schema_schemata_scanner_test.cpp @@ -91,7 +91,7 @@ private: std::string _wild; }; -char g_tuple_buf[10000];// enougth for tuple +char g_tuple_buf[10000];// enough for tuple TEST_F(SchemaSchemataScannerTest, normal_use) { SchemaSchemataScanner scanner; Status status = scanner.init(&_param, &_obj_pool); diff --git a/be/test/exec/schema_scanner/schema_table_names_scanner_test.cpp b/be/test/exec/schema_scanner/schema_table_names_scanner_test.cpp index d5660a7fe7..406346affa 100644 --- a/be/test/exec/schema_scanner/schema_table_names_scanner_test.cpp +++ b/be/test/exec/schema_scanner/schema_table_names_scanner_test.cpp @@ -91,7 +91,7 @@ private: std::string _wild; }; -char g_tuple_buf[10000];// enougth for tuple +char g_tuple_buf[10000];// enough for tuple TEST_F(SchemaTableNamesScannerTest, normal_use) { SchemaTableNamesScanner scanner; Status status = scanner.init(&_param, &_obj_pool); diff --git a/be/test/exec/schema_scanner/schema_tables_scanner_test.cpp b/be/test/exec/schema_scanner/schema_tables_scanner_test.cpp index 6f9b0c9bbd..b3713427fc 100644 --- a/be/test/exec/schema_scanner/schema_tables_scanner_test.cpp +++ b/be/test/exec/schema_scanner/schema_tables_scanner_test.cpp @@ -91,7 +91,7 @@ private: std::string _wild; }; -char g_tuple_buf[10000];// enougth for tuple +char g_tuple_buf[10000];// enough for tuple TEST_F(SchemaTablesScannerTest, normal_use) { SchemaTablesScanner scanner; Status status = scanner.init(&_param, &_obj_pool); diff --git a/be/test/exec/schema_scanner/schema_variables_scanner_test.cpp b/be/test/exec/schema_scanner/schema_variables_scanner_test.cpp index 1da952d0af..8768a4a95d 100644 --- a/be/test/exec/schema_scanner/schema_variables_scanner_test.cpp +++ b/be/test/exec/schema_scanner/schema_variables_scanner_test.cpp @@ -46,7 +46,7 @@ private: std::string _wild; }; -char g_tuple_buf[10000];// enougth for tuple +char g_tuple_buf[10000];// enough for tuple TEST_F(SchemaVariablesScannerTest, normal_use) { SchemaVariablesScanner scanner; Status status = scanner.init(&_param, &_obj_pool); diff --git a/be/test/exprs/bitmap_function_test.cpp b/be/test/exprs/bitmap_function_test.cpp index cc9492e04c..d62d4239d9 100644 --- a/be/test/exprs/bitmap_function_test.cpp +++ b/be/test/exprs/bitmap_function_test.cpp @@ -291,15 +291,15 @@ TEST_F(BitmapFunctionsTest, test_bitmap_intersect) { test_bitmap_intersect( ctx, v1, v2); - DateTimeVal datatime1; + DateTimeVal datetime1; DateTimeValue date_time_value; date_time_value.from_date_int64(19880201); - date_time_value.to_datetime_val(&datatime1); - DateTimeVal datatime2; + date_time_value.to_datetime_val(&datetime1); + DateTimeVal datetime2; date_time_value.from_date_int64(19880202); - date_time_value.to_datetime_val(&datatime2); + date_time_value.to_datetime_val(&datetime2); test_bitmap_intersect( - ctx, datatime1, datatime2); + ctx, datetime1, datetime2); test_bitmap_intersect( ctx, StringVal("20191211"), StringVal("20191212")); diff --git a/be/test/olap/delta_writer_test.cpp b/be/test/olap/delta_writer_test.cpp index 1a6418e0cb..7e5750c123 100644 --- a/be/test/olap/delta_writer_test.cpp +++ b/be/test/olap/delta_writer_test.cpp @@ -65,11 +65,12 @@ void set_up() { ExecEnv* exec_env = doris::ExecEnv::GetInstance(); exec_env->set_storage_engine(k_engine); - + k_engine->start_bg_threads(); k_mem_tracker.reset(new MemTracker(-1, "delta writer test")); } void tear_down() { + k_engine->stop(); delete k_engine; k_engine = nullptr; system("rm -rf ./data_test"); diff --git a/be/test/olap/short_key_index_test.cpp b/be/test/olap/short_key_index_test.cpp index 6722207436..704b4ff024 100644 --- a/be/test/olap/short_key_index_test.cpp +++ b/be/test/olap/short_key_index_test.cpp @@ -32,7 +32,7 @@ public: } }; -TEST_F(ShortKeyIndexTest, buider) { +TEST_F(ShortKeyIndexTest, builder) { ShortKeyIndexBuilder builder(0, 1024); int num_items = 0; @@ -95,7 +95,7 @@ TEST_F(ShortKeyIndexTest, buider) { } -TEST_F(ShortKeyIndexTest, enocde) { +TEST_F(ShortKeyIndexTest, encode) { TabletSchema tablet_schema; tablet_schema._cols.push_back(create_int_key(0)); tablet_schema._cols.push_back(create_int_key(1)); diff --git a/be/test/runtime/snapshot_loader_test.cpp b/be/test/runtime/snapshot_loader_test.cpp index 4e024553cc..29c252c11a 100644 --- a/be/test/runtime/snapshot_loader_test.cpp +++ b/be/test/runtime/snapshot_loader_test.cpp @@ -21,7 +21,7 @@ #include "runtime/exec_env.h" #include "util/cpu_info.h" -#define private public // hack complier +#define private public // hack compiler #define protected public #include "runtime/snapshot_loader.h" diff --git a/be/test/runtime/sorter_test.cpp b/be/test/runtime/sorter_test.cpp index 48ce5fcde5..0c259e7caf 100644 --- a/be/test/runtime/sorter_test.cpp +++ b/be/test/runtime/sorter_test.cpp @@ -270,7 +270,7 @@ TEST_F(SorterTest, sorter_run_asc) { delete sorter; } -/* reveser order : exceed 16 elment, we use quick sort*/ +/* reverse order : exceed 16 elements, we use quick sort*/ TEST_F(SorterTest, sorter_run_desc_with_quick_sort) { SortExecExprs exec_exprs; Status status = exec_exprs.init(_ordering_exprs, &_sort_tuple_slot_expr, _object_pool); diff --git a/be/test/udf/uda_test.cpp b/be/test/udf/uda_test.cpp index 6f93546c2a..db283b473c 100755 --- a/be/test/udf/uda_test.cpp +++ b/be/test/udf/uda_test.cpp @@ -152,7 +152,7 @@ StringVal MinFinalize(FunctionContext* context, const BufferVal& val) { //----------------------------- Bits after Xor ------------------------------------ // Example of a UDA that xors all the input bits and then returns the number of // resulting bits that are set. This illustrates where the result and intermediate -// are the same type, but a transformation is still needed in Finialize() +// are the same type, but a transformation is still needed in Finalize() // The input type is: double // The intermediate type is bigint // the return type is bigint