You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/19 13:34:36 UTC

[doris] 10/36: [chore](build) Use include-what-you-use to optimize includes (#18681)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-2.0-alpha
in repository https://gitbox.apache.org/repos/asf/doris.git

commit dce24e63830e21b62b56769cbeac817f6b8945af
Author: Adonis Ling <ad...@gmail.com>
AuthorDate: Mon Apr 17 11:44:58 2023 +0800

    [chore](build) Use include-what-you-use to optimize includes (#18681)
    
    Currently, there are some useless includes in the codebase. We can use a tool named include-what-you-use to optimize these includes. By using a strict include-what-you-use policy, we can get lots of benefits from it.
---
 be/src/agent/agent_server.cpp                      | 12 +++++
 be/src/agent/agent_server.h                        | 10 +++-
 be/src/agent/heartbeat_server.cpp                  | 19 +++++--
 be/src/agent/heartbeat_server.h                    |  8 ++-
 be/src/agent/task_worker_pool.cpp                  | 34 +++++++++---
 be/src/agent/task_worker_pool.h                    | 19 ++++++-
 be/src/agent/topic_subscriber.cpp                  |  7 +++
 be/src/agent/topic_subscriber.h                    |  5 +-
 be/src/agent/user_resource_listener.cpp            | 19 ++++---
 be/src/agent/user_resource_listener.h              |  7 ++-
 be/src/agent/utils.cpp                             | 23 +++++++-
 be/src/agent/utils.h                               | 10 ++++
 be/src/common/config.h                             |  2 +-
 be/src/common/configbase.cpp                       | 21 ++++++--
 be/src/common/configbase.h                         |  1 +
 be/src/common/daemon.cpp                           | 26 +++++++--
 be/src/common/exception.h                          | 11 ++++
 be/src/common/logconfig.cpp                        |  6 ++-
 be/src/common/logging.h                            |  2 +-
 be/src/common/resource_tls.cpp                     |  4 +-
 be/src/common/status.cpp                           |  8 ++-
 be/src/common/status.h                             |  5 +-
 be/src/exec/arrow/arrow_reader.cpp                 | 23 ++++----
 be/src/exec/arrow/arrow_reader.h                   | 28 ++++++++--
 be/src/exec/arrow/parquet_reader.cpp               | 23 +++++---
 be/src/exec/arrow/parquet_reader.h                 | 18 +++++--
 be/src/exec/base_scanner.cpp                       | 28 +++++++++-
 be/src/exec/base_scanner.h                         | 16 ++++++
 be/src/exec/data_sink.cpp                          | 12 +++--
 be/src/exec/data_sink.h                            | 14 ++++-
 be/src/exec/decompressor.cpp                       |  4 ++
 be/src/exec/decompressor.h                         |  4 ++
 be/src/exec/es/es_scan_reader.cpp                  |  4 ++
 be/src/exec/es/es_scan_reader.h                    |  6 +++
 be/src/exec/es/es_scroll_parser.cpp                | 24 +++++++--
 be/src/exec/es/es_scroll_parser.h                  |  6 +++
 be/src/exec/es/es_scroll_query.cpp                 |  5 ++
 be/src/exec/exec_node.cpp                          | 20 ++++++-
 be/src/exec/exec_node.h                            | 13 ++++-
 be/src/exec/odbc_connector.cpp                     | 16 ++++--
 be/src/exec/odbc_connector.h                       | 12 +++++
 be/src/exec/olap_common.cpp                        |  4 --
 be/src/exec/olap_common.h                          | 13 +++++
 be/src/exec/rowid_fetcher.cpp                      | 26 ++++++++-
 be/src/exec/rowid_fetcher.h                        | 14 ++++-
 be/src/exec/scan_node.cpp                          |  9 ++++
 be/src/exec/scan_node.h                            | 11 +++-
 be/src/exec/schema_scanner.cpp                     | 21 +++++++-
 be/src/exec/schema_scanner.h                       | 12 ++++-
 .../schema_scanner/schema_charsets_scanner.cpp     |  8 +++
 .../exec/schema_scanner/schema_charsets_scanner.h  |  6 +++
 .../schema_scanner/schema_collations_scanner.cpp   |  9 +++-
 .../schema_scanner/schema_collations_scanner.h     |  6 +++
 .../exec/schema_scanner/schema_columns_scanner.cpp | 16 ++++--
 .../exec/schema_scanner/schema_columns_scanner.h   |  9 +++-
 .../exec/schema_scanner/schema_dummy_scanner.cpp   |  9 ++++
 be/src/exec/schema_scanner/schema_dummy_scanner.h  |  5 ++
 .../exec/schema_scanner/schema_files_scanner.cpp   | 10 +++-
 be/src/exec/schema_scanner/schema_files_scanner.h  | 10 +++-
 be/src/exec/schema_scanner/schema_helper.cpp       | 17 ++++--
 be/src/exec/schema_scanner/schema_helper.h         | 18 ++++++-
 .../schema_scanner/schema_partitions_scanner.cpp   | 12 ++++-
 .../schema_scanner/schema_partitions_scanner.h     | 10 +++-
 .../exec/schema_scanner/schema_rowsets_scanner.cpp | 24 ++++++---
 .../exec/schema_scanner/schema_rowsets_scanner.h   |  8 +++
 .../schema_schema_privileges_scanner.cpp           | 12 ++++-
 .../schema_schema_privileges_scanner.h             | 10 +++-
 .../schema_scanner/schema_schemata_scanner.cpp     | 12 ++++-
 .../exec/schema_scanner/schema_schemata_scanner.h  | 10 +++-
 .../schema_scanner/schema_statistics_scanner.cpp   |  4 +-
 .../schema_scanner/schema_statistics_scanner.h     |  2 +
 .../schema_table_privileges_scanner.cpp            | 10 +++-
 .../schema_table_privileges_scanner.h              | 10 +++-
 .../exec/schema_scanner/schema_tables_scanner.cpp  | 18 ++++++-
 be/src/exec/schema_scanner/schema_tables_scanner.h | 10 +++-
 .../schema_user_privileges_scanner.cpp             | 12 ++++-
 .../schema_user_privileges_scanner.h               | 10 +++-
 .../schema_scanner/schema_variables_scanner.cpp    | 16 +++++-
 .../exec/schema_scanner/schema_variables_scanner.h | 11 +++-
 .../exec/schema_scanner/schema_views_scanner.cpp   | 12 ++++-
 be/src/exec/schema_scanner/schema_views_scanner.h  | 10 +++-
 be/src/exec/table_connector.cpp                    | 21 ++++++--
 be/src/exec/table_connector.h                      | 12 +++++
 be/src/exec/tablet_info.cpp                        | 18 +++++++
 be/src/exec/tablet_info.h                          | 21 +++++++-
 be/src/exec/text_converter.cpp                     | 14 ++++-
 be/src/exec/text_converter.h                       |  3 ++
 be/src/exprs/block_bloom_filter_avx_impl.cc        |  6 ++-
 be/src/exprs/block_bloom_filter_impl.cc            |  9 +++-
 be/src/exprs/json_functions.cpp                    | 16 +++---
 be/src/exprs/json_functions.h                      | 13 +++++
 be/src/exprs/math_functions.cpp                    | 11 ++--
 be/src/exprs/math_functions.h                      |  1 +
 be/src/exprs/runtime_filter.cpp                    | 21 +++++++-
 be/src/exprs/runtime_filter.h                      | 22 ++++++++
 be/src/exprs/runtime_filter_rpc.cpp                | 15 +++++-
 be/src/exprs/string_functions.cpp                  |  7 +--
 be/src/exprs/string_functions.h                    |  2 +
 be/src/geo/ByteOrderDataInStream.h                 |  2 +
 be/src/geo/ByteOrderValues.cpp                     |  3 +-
 be/src/geo/ByteOrderValues.h                       |  5 ++
 be/src/geo/geo_tobinary.cpp                        | 10 +++-
 be/src/geo/geo_tobinary.h                          |  8 +++
 be/src/geo/geo_types.cpp                           | 14 +++--
 be/src/geo/geo_types.h                             |  3 +-
 be/src/geo/machine.h                               |  2 +
 be/src/geo/wkb_parse.cpp                           | 12 +++--
 be/src/geo/wkb_parse.h                             | 12 +++++
 be/src/geo/wkt_parse.cpp                           |  3 +-
 be/src/geo/wkt_parse.h                             |  4 ++
 be/src/http/action/check_rpc_channel_action.cpp    | 14 +++--
 be/src/http/action/check_rpc_channel_action.h      |  2 +
 be/src/http/action/check_tablet_segment_action.cpp |  7 +++
 be/src/http/action/check_tablet_segment_action.h   |  1 +
 be/src/http/action/checksum_action.cpp             |  7 +--
 be/src/http/action/checksum_action.h               |  1 +
 be/src/http/action/compaction_action.cpp           | 13 ++++-
 be/src/http/action/compaction_action.h             |  5 ++
 be/src/http/action/config_action.cpp               |  8 ++-
 be/src/http/action/config_action.h                 |  1 +
 be/src/http/action/download_action.cpp             | 12 ++---
 be/src/http/action/download_action.h               |  5 ++
 be/src/http/action/health_action.cpp               |  1 -
 be/src/http/action/health_action.h                 |  1 +
 be/src/http/action/jeprofile_actions.cpp           |  9 ++--
 be/src/http/action/meta_action.cpp                 | 13 +++--
 be/src/http/action/meta_action.h                   |  3 ++
 be/src/http/action/metrics_action.cpp              |  7 ---
 be/src/http/action/monitor_action.cpp              |  5 +-
 be/src/http/action/pad_rowset_action.cpp           | 15 +++++-
 be/src/http/action/pad_rowset_action.h             |  2 +
 be/src/http/action/pprof_actions.cpp               | 14 ++---
 be/src/http/action/reload_tablet_action.cpp        |  7 +--
 be/src/http/action/reload_tablet_action.h          |  7 ++-
 be/src/http/action/reset_rpc_channel_action.cpp    |  8 ++-
 be/src/http/action/reset_rpc_channel_action.h      |  2 +
 be/src/http/action/restore_tablet_action.cpp       | 19 ++++---
 be/src/http/action/restore_tablet_action.h         |  6 ++-
 be/src/http/action/snapshot_action.cpp             | 10 ++--
 be/src/http/action/snapshot_action.h               |  1 +
 be/src/http/action/stream_load.cpp                 | 32 ++++++-----
 be/src/http/action/stream_load.h                   |  7 ++-
 be/src/http/action/stream_load_2pc.cpp             | 11 +++-
 be/src/http/action/stream_load_2pc.h               |  1 +
 be/src/http/action/tablet_migration_action.cpp     |  7 ++-
 be/src/http/action/tablet_migration_action.h       | 14 ++++-
 be/src/http/action/tablets_distribution_action.cpp | 10 +++-
 be/src/http/action/tablets_distribution_action.h   |  3 ++
 be/src/http/action/tablets_info_action.cpp         |  9 ++++
 be/src/http/action/tablets_info_action.h           |  1 +
 be/src/http/action/version_action.cpp              |  5 +-
 be/src/http/action/version_action.h                |  1 +
 be/src/http/default_path_handlers.cpp              | 18 +++++--
 be/src/http/ev_http_server.cpp                     | 19 ++++---
 be/src/http/ev_http_server.h                       |  3 ++
 be/src/http/http_channel.cpp                       |  7 ++-
 be/src/http/http_channel.h                         |  2 +
 be/src/http/http_client.cpp                        |  6 +++
 be/src/http/http_client.h                          |  3 ++
 be/src/http/http_method.cpp                        |  1 +
 be/src/http/http_request.cpp                       |  7 +--
 be/src/http/http_status.cpp                        |  1 +
 be/src/http/utils.cpp                              | 10 +++-
 be/src/http/utils.h                                |  1 +
 be/src/http/web_page_handler.cpp                   | 10 +++-
 be/src/http/web_page_handler.h                     |  3 ++
 be/src/io/fs/file_reader_writer_fwd.h              |  3 ++
 be/src/io/fs/hdfs.h                                |  4 +-
 be/src/io/fs/hdfs_file_reader.h                    | 12 +++++
 be/src/io/fs/hdfs_file_writer.h                    |  7 +++
 be/src/service/backend_options.cpp                 |  1 +
 be/src/service/backend_options.h                   |  1 +
 be/src/service/backend_service.cpp                 | 46 +++++++++-------
 be/src/service/backend_service.h                   | 23 ++++++--
 be/src/service/brpc_service.cpp                    |  9 +++-
 be/src/service/doris_main.cpp                      | 34 +++++++-----
 be/src/service/http_service.cpp                    |  5 ++
 be/src/service/internal_service.cpp                | 62 ++++++++++++++++++----
 be/src/service/internal_service.h                  | 15 +++++-
 be/src/service/point_query_executor.cpp            | 15 ++++--
 be/src/service/point_query_executor.h              | 33 +++++++++++-
 .../single_replica_load_download_service.cpp       |  6 +++
 be/src/udf/udf.cpp                                 | 11 +---
 be/src/udf/udf.h                                   |  2 +-
 be/src/util/sse_util.hpp                           |  6 +--
 185 files changed, 1619 insertions(+), 355 deletions(-)

diff --git a/be/src/agent/agent_server.cpp b/be/src/agent/agent_server.cpp
index 5fc46a912d..cb84e8b2e0 100644
--- a/be/src/agent/agent_server.cpp
+++ b/be/src/agent/agent_server.cpp
@@ -17,9 +17,14 @@
 
 #include "agent/agent_server.h"
 
+#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/HeartbeatService_types.h>
+#include <gen_cpp/Types_types.h>
+#include <stdint.h>
 #include <thrift/protocol/TDebugProtocol.h>
 
 #include <filesystem>
+#include <ostream>
 #include <string>
 
 #include "agent/task_worker_pool.h"
@@ -29,7 +34,14 @@
 #include "common/logging.h"
 #include "common/status.h"
 #include "gutil/strings/substitute.h"
+#include "olap/olap_define.h"
+#include "olap/options.h"
 #include "olap/snapshot_manager.h"
+#include "runtime/exec_env.h"
+
+namespace doris {
+class TopicListener;
+} // namespace doris
 
 using std::string;
 using std::vector;
diff --git a/be/src/agent/agent_server.h b/be/src/agent/agent_server.h
index c8136d00b8..11521eb09a 100644
--- a/be/src/agent/agent_server.h
+++ b/be/src/agent/agent_server.h
@@ -17,17 +17,25 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/AgentService_types.h>
+
 #include <memory>
 #include <string>
 #include <vector>
 
-#include "gen_cpp/AgentService_types.h"
 #include "runtime/exec_env.h"
 
 namespace doris {
 
 class TaskWorkerPool;
 class TopicSubscriber;
+class ExecEnv;
+class TAgentPublishRequest;
+class TAgentResult;
+class TAgentTaskRequest;
+class TMasterInfo;
+class TSnapshotRequest;
 
 // Each method corresponds to one RPC from FE Master, see BackendService.
 class AgentServer {
diff --git a/be/src/agent/heartbeat_server.cpp b/be/src/agent/heartbeat_server.cpp
index 705f14ab9a..41a61005ed 100644
--- a/be/src/agent/heartbeat_server.cpp
+++ b/be/src/agent/heartbeat_server.cpp
@@ -17,18 +17,31 @@
 
 #include "agent/heartbeat_server.h"
 
-#include <thrift/TProcessor.h>
+#include <gen_cpp/HeartbeatService.h>
+#include <gen_cpp/HeartbeatService_types.h>
+#include <gen_cpp/Types_types.h>
+#include <glog/logging.h>
 
+#include <memory>
+#include <ostream>
+#include <string>
+
+#include "common/config.h"
 #include "common/status.h"
-#include "gen_cpp/HeartbeatService.h"
-#include "gen_cpp/Status_types.h"
 #include "olap/storage_engine.h"
+#include "runtime/exec_env.h"
 #include "runtime/heartbeat_flags.h"
 #include "service/backend_options.h"
 #include "util/debug_util.h"
 #include "util/thrift_server.h"
 #include "util/time.h"
 
+namespace apache {
+namespace thrift {
+class TProcessor;
+} // namespace thrift
+} // namespace apache
+
 namespace doris {
 
 HeartbeatServer::HeartbeatServer(TMasterInfo* master_info)
diff --git a/be/src/agent/heartbeat_server.h b/be/src/agent/heartbeat_server.h
index 73bfbba7fa..65e228dd8c 100644
--- a/be/src/agent/heartbeat_server.h
+++ b/be/src/agent/heartbeat_server.h
@@ -17,14 +17,20 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/HeartbeatService.h>
+#include <stdint.h>
+
 #include <mutex>
 
 #include "common/status.h"
-#include "gen_cpp/HeartbeatService.h"
 #include "olap/olap_define.h"
 #include "runtime/exec_env.h"
 
 namespace doris {
+class ExecEnv;
+class THeartbeatResult;
+class TMasterInfo;
 
 const uint32_t HEARTBEAT_INTERVAL = 10;
 class StorageEngine;
diff --git a/be/src/agent/task_worker_pool.cpp b/be/src/agent/task_worker_pool.cpp
index 9fe680ea96..ab7877fbf2 100644
--- a/be/src/agent/task_worker_pool.cpp
+++ b/be/src/agent/task_worker_pool.cpp
@@ -17,46 +17,66 @@
 
 #include "agent/task_worker_pool.h"
 
+#include <fmt/format.h>
 #include <gen_cpp/AgentService_types.h>
-#include <pthread.h>
-#include <sys/stat.h>
-
-#include <boost/lexical_cast.hpp>
-#include <chrono>
-#include <csignal>
+#include <gen_cpp/HeartbeatService_types.h>
+#include <gen_cpp/MasterService_types.h>
+#include <gen_cpp/Status_types.h>
+#include <gen_cpp/Types_types.h>
+#include <unistd.h>
+
+#include <algorithm>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
 #include <ctime>
+#include <functional>
 #include <memory>
+#include <shared_mutex>
 #include <sstream>
 #include <string>
+#include <thread>
+#include <utility>
+#include <vector>
 
 #include "agent/utils.h"
+#include "common/config.h"
 #include "common/logging.h"
 #include "common/status.h"
-#include "gen_cpp/Types_types.h"
+#include "gutil/ref_counted.h"
+#include "gutil/stringprintf.h"
 #include "gutil/strings/substitute.h"
+#include "io/fs/file_system.h"
 #include "io/fs/local_file_system.h"
+#include "io/fs/path.h"
 #include "io/fs/s3_file_system.h"
 #include "olap/data_dir.h"
 #include "olap/olap_common.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/snapshot_manager.h"
 #include "olap/storage_engine.h"
 #include "olap/storage_policy.h"
 #include "olap/tablet.h"
+#include "olap/tablet_manager.h"
+#include "olap/tablet_meta.h"
+#include "olap/tablet_schema.h"
 #include "olap/task/engine_alter_tablet_task.h"
 #include "olap/task/engine_batch_load_task.h"
 #include "olap/task/engine_checksum_task.h"
 #include "olap/task/engine_clone_task.h"
 #include "olap/task/engine_publish_version_task.h"
 #include "olap/task/engine_storage_migration_task.h"
+#include "olap/txn_manager.h"
 #include "olap/utils.h"
 #include "runtime/exec_env.h"
 #include "runtime/snapshot_loader.h"
 #include "service/backend_options.h"
 #include "util/doris_metrics.h"
 #include "util/random.h"
+#include "util/s3_util.h"
 #include "util/scoped_cleanup.h"
 #include "util/stopwatch.hpp"
 #include "util/threadpool.h"
+#include "util/time.h"
 #include "util/trace.h"
 
 namespace doris {
diff --git a/be/src/agent/task_worker_pool.h b/be/src/agent/task_worker_pool.h
index 3ea664014e..cd9b274d98 100644
--- a/be/src/agent/task_worker_pool.h
+++ b/be/src/agent/task_worker_pool.h
@@ -17,24 +17,39 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/HeartbeatService_types.h>
+#include <gen_cpp/Types_types.h>
+#include <stdint.h>
+
 #include <atomic>
+#include <condition_variable>
 #include <deque>
+#include <map>
 #include <memory>
+#include <mutex>
+#include <set>
+#include <string>
 #include <utility>
 #include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/AgentService_types.h"
-#include "gen_cpp/HeartbeatService_types.h"
 #include "olap/data_dir.h"
 #include "olap/tablet.h"
 #include "util/countdown_latch.h"
+#include "util/metrics.h"
 
 namespace doris {
 
 class ExecEnv;
 class ThreadPool;
 class AgentUtils;
+class DataDir;
+class TFinishTaskRequest;
+class TMasterInfo;
+class TReportRequest;
+class TTabletInfo;
 
 class TaskWorkerPool {
 public:
diff --git a/be/src/agent/topic_subscriber.cpp b/be/src/agent/topic_subscriber.cpp
index 88754efd2b..c5c4a324eb 100644
--- a/be/src/agent/topic_subscriber.cpp
+++ b/be/src/agent/topic_subscriber.cpp
@@ -17,6 +17,13 @@
 
 #include "agent/topic_subscriber.h"
 
+#include <gen_cpp/AgentService_types.h>
+
+#include <mutex>
+#include <utility>
+
+#include "agent/topic_listener.h"
+
 namespace doris {
 
 TopicSubscriber::TopicSubscriber() {}
diff --git a/be/src/agent/topic_subscriber.h b/be/src/agent/topic_subscriber.h
index 2d57f6927d..3151cbe54c 100644
--- a/be/src/agent/topic_subscriber.h
+++ b/be/src/agent/topic_subscriber.h
@@ -17,15 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/AgentService_types.h>
+
 #include <map>
 #include <mutex>
 #include <shared_mutex>
 #include <thread>
+#include <vector>
 
 #include "agent/topic_listener.h"
-#include "gen_cpp/AgentService_types.h"
 
 namespace doris {
+class TopicListener;
 
 class TopicSubscriber {
 public:
diff --git a/be/src/agent/user_resource_listener.cpp b/be/src/agent/user_resource_listener.cpp
index efef2c7f6b..07ae1ee6b0 100644
--- a/be/src/agent/user_resource_listener.cpp
+++ b/be/src/agent/user_resource_listener.cpp
@@ -17,17 +17,24 @@
 
 #include "agent/user_resource_listener.h"
 
-#include <thrift/TApplicationException.h>
+#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/FrontendService.h>
+#include <gen_cpp/HeartbeatService_types.h>
+#include <gen_cpp/MasterService_types.h>
+#include <gen_cpp/Types_types.h>
+#include <glog/logging.h>
 #include <thrift/Thrift.h>
-#include <thrift/protocol/TBinaryProtocol.h>
-#include <thrift/transport/TBufferTransports.h>
-#include <thrift/transport/TSocket.h>
+#include <thrift/transport/TTransportException.h>
 
 #include <future>
-#include <map>
+#include <ostream>
+#include <string>
+#include <vector>
 
-#include "gen_cpp/FrontendService.h"
+#include "common/config.h"
+#include "common/status.h"
 #include "runtime/client_cache.h"
+#include "runtime/exec_env.h"
 
 namespace doris {
 
diff --git a/be/src/agent/user_resource_listener.h b/be/src/agent/user_resource_listener.h
index 9bddb1856b..b26ae3f279 100644
--- a/be/src/agent/user_resource_listener.h
+++ b/be/src/agent/user_resource_listener.h
@@ -17,16 +17,19 @@
 
 #pragma once
 
+#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/HeartbeatService_types.h>
+#include <stdint.h>
+
 #include <string>
 
 #include "agent/topic_listener.h"
-#include "gen_cpp/AgentService_types.h"
-#include "gen_cpp/HeartbeatService_types.h"
 #include "runtime/exec_env.h"
 
 namespace doris {
 
 class ExecEnv;
+class TMasterInfo;
 
 class UserResourceListener : public TopicListener {
 public:
diff --git a/be/src/agent/utils.cpp b/be/src/agent/utils.cpp
index dfe4bc04c8..0e91eeaa49 100644
--- a/be/src/agent/utils.cpp
+++ b/be/src/agent/utils.cpp
@@ -17,18 +17,39 @@
 
 #include "agent/utils.h"
 
+#include <errno.h>
+#include <gen_cpp/FrontendService.h>
+#include <gen_cpp/HeartbeatService_types.h>
+#include <gen_cpp/Types_types.h>
+#include <glog/logging.h>
 #include <rapidjson/document.h>
+#include <rapidjson/encodings.h>
 #include <rapidjson/rapidjson.h>
 #include <rapidjson/stringbuffer.h>
 #include <rapidjson/writer.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <thrift/transport/TTransportException.h>
 
 #include <cstdio>
+#include <exception>
 #include <fstream>
-#include <sstream>
+#include <memory>
+#include <utility>
 
+#include "common/config.h"
 #include "common/status.h"
 #include "runtime/client_cache.h"
 
+namespace doris {
+class TConfirmUnusedRemoteFilesRequest;
+class TConfirmUnusedRemoteFilesResult;
+class TFinishTaskRequest;
+class TMasterResult;
+class TReportRequest;
+} // namespace doris
+
 using std::map;
 using std::string;
 using std::stringstream;
diff --git a/be/src/agent/utils.h b/be/src/agent/utils.h
index cfce0c3413..8cd1895d6a 100644
--- a/be/src/agent/utils.h
+++ b/be/src/agent/utils.h
@@ -17,14 +17,24 @@
 
 #pragma once
 
+#include <butil/macros.h>
 #include <gen_cpp/FrontendService.h>
 #include <gen_cpp/HeartbeatService_types.h>
 #include <gen_cpp/MasterService_types.h>
 
+#include <map>
+#include <string>
+
 #include "common/status.h"
 #include "gutil/macros.h"
 
 namespace doris {
+class TConfirmUnusedRemoteFilesRequest;
+class TConfirmUnusedRemoteFilesResult;
+class TFinishTaskRequest;
+class TMasterInfo;
+class TMasterResult;
+class TReportRequest;
 
 class MasterServerClient {
 public:
diff --git a/be/src/common/config.h b/be/src/common/config.h
index 03dfb1cfc2..3f2034191c 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -17,7 +17,7 @@
 
 #pragma once
 
-#include "configbase.h"
+#include "configbase.h" // IWYU pragma: export
 
 namespace doris {
 namespace config {
diff --git a/be/src/common/configbase.cpp b/be/src/common/configbase.cpp
index 24e3a44e66..066aa0352d 100644
--- a/be/src/common/configbase.cpp
+++ b/be/src/common/configbase.cpp
@@ -15,20 +15,31 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <stdint.h>
+
 #include <algorithm>
+#include <cctype>
 #include <cerrno>
+#include <cstdlib>
 #include <cstring>
-#include <fstream>
+#include <fstream> // IWYU pragma: keep
+#include <functional>
 #include <iostream>
-#include <list>
 #include <map>
+#include <memory>
+#include <mutex>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "common/logging.h"
 
 #define __IN_CONFIGBASE_CPP__
-#include "common/config.h"
+#include "common/config.h" // IWYU pragma: keep
 #undef __IN_CONFIGBASE_CPP__
 
 #include "common/status.h"
-#include "gutil/strings/substitute.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_writer.h"
 #include "io/fs/local_file_system.h"
 
@@ -390,7 +401,7 @@ Status persist_config(const std::string& field, const std::string& value) {
     // lock to make sure only one thread can modify the be_custom.conf
     std::lock_guard<std::mutex> l(custom_conf_lock);
 
-    static const string conffile = string(getenv("DORIS_HOME")) + "/conf/be_custom.conf";
+    static const std::string conffile = std::string(getenv("DORIS_HOME")) + "/conf/be_custom.conf";
 
     Properties tmp_props;
     if (!tmp_props.load(conffile.c_str(), false)) {
diff --git a/be/src/common/configbase.h b/be/src/common/configbase.h
index f3c79519ba..0bc11647a4 100644
--- a/be/src/common/configbase.h
+++ b/be/src/common/configbase.h
@@ -22,6 +22,7 @@
 #include <map>
 #include <mutex>
 #include <string>
+#include <utility>
 #include <vector>
 
 namespace doris {
diff --git a/be/src/common/daemon.cpp b/be/src/common/daemon.cpp
index 9e75a5a784..4a64e67053 100644
--- a/be/src/common/daemon.cpp
+++ b/be/src/common/daemon.cpp
@@ -17,21 +17,35 @@
 
 #include "common/daemon.h"
 
+#include <bthread/errno.h>
 #include <gflags/gflags.h>
-#include <gperftools/malloc_extension.h>
+// IWYU pragma: no_include <bits/std_abs.h>
+#include <math.h>
 #include <signal.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <algorithm>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <map>
+#include <memory>
+#include <ostream>
+#include <set>
+#include <string>
 
 #include "common/config.h"
 #include "common/logging.h"
-#include "exprs/math_functions.h"
-#include "exprs/string_functions.h"
+#include "common/status.h"
 #include "olap/options.h"
 #include "olap/storage_engine.h"
+#include "olap/tablet_manager.h"
 #include "runtime/block_spill_manager.h"
 #include "runtime/exec_env.h"
-#include "runtime/fragment_mgr.h"
 #include "runtime/load_channel_mgr.h"
-#include "runtime/memory/chunk_allocator.h"
+#include "runtime/memory/mem_tracker.h"
+#include "runtime/memory/mem_tracker_limiter.h"
 #include "runtime/user_function_cache.h"
 #include "service/backend_options.h"
 #include "util/cpu_info.h"
@@ -39,7 +53,9 @@
 #include "util/disk_info.h"
 #include "util/doris_metrics.h"
 #include "util/mem_info.h"
+#include "util/metrics.h"
 #include "util/network_util.h"
+#include "util/perf_counters.h"
 #include "util/system_metrics.h"
 #include "util/thrift_util.h"
 #include "util/time.h"
diff --git a/be/src/common/exception.h b/be/src/common/exception.h
index fff3215d31..3723db0891 100644
--- a/be/src/common/exception.h
+++ b/be/src/common/exception.h
@@ -17,6 +17,17 @@
 
 #pragma once
 
+#include <fmt/format.h>
+#include <gen_cpp/Status_types.h>
+#include <stdint.h>
+
+#include <exception>
+#include <memory>
+#include <ostream>
+#include <string>
+#include <string_view>
+#include <utility>
+
 #include "common/status.h"
 
 namespace doris {
diff --git a/be/src/common/logconfig.cpp b/be/src/common/logconfig.cpp
index 9e05e64a97..fc81103254 100644
--- a/be/src/common/logconfig.cpp
+++ b/be/src/common/logconfig.cpp
@@ -15,14 +15,16 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <glog/logging.h>
-#include <glog/vlog_is_on.h>
+#include <ctype.h>
+#include <stdint.h>
 
 #include <cerrno>
 #include <cstdlib>
 #include <cstring>
 #include <iostream>
 #include <mutex>
+#include <string>
+#include <vector>
 
 #include "common/config.h"
 #include "common/logging.h"
diff --git a/be/src/common/logging.h b/be/src/common/logging.h
index d8c55d5f6b..894db39cda 100644
--- a/be/src/common/logging.h
+++ b/be/src/common/logging.h
@@ -24,7 +24,7 @@
 #undef _XOPEN_SOURCE
 // This is including a glog internal file.  We want this to expose the
 // function to get the stack trace.
-#include <glog/logging.h>
+#include <glog/logging.h> // IWYU pragma: export
 #undef MutexLock
 
 // Define VLOG levels.  We want display per-row info less than per-file which
diff --git a/be/src/common/resource_tls.cpp b/be/src/common/resource_tls.cpp
index 5ac6c94d9d..9b5ddc6815 100644
--- a/be/src/common/resource_tls.cpp
+++ b/be/src/common/resource_tls.cpp
@@ -17,10 +17,12 @@
 
 #include "common/resource_tls.h"
 
+#include <gen_cpp/Types_types.h>
 #include <pthread.h>
 
+#include <ostream>
+
 #include "common/logging.h"
-#include "gen_cpp/Types_types.h"
 
 namespace doris {
 
diff --git a/be/src/common/status.cpp b/be/src/common/status.cpp
index 85f4d69938..d4403f1112 100644
--- a/be/src/common/status.cpp
+++ b/be/src/common/status.cpp
@@ -4,10 +4,16 @@
 
 #include "common/status.h"
 
+#include <gen_cpp/Status_types.h>
+#include <gen_cpp/types.pb.h> // for PStatus
+#include <rapidjson/encodings.h>
 #include <rapidjson/prettywriter.h>
 #include <rapidjson/stringbuffer.h>
 
-#include "gen_cpp/types.pb.h" // for PStatus
+#include <algorithm>
+#include <new>
+#include <vector>
+
 #include "service/backend_options.h"
 
 namespace doris {
diff --git a/be/src/common/status.h b/be/src/common/status.h
index 330f8114bf..ec8fbba4fe 100644
--- a/be/src/common/status.h
+++ b/be/src/common/status.h
@@ -5,14 +5,17 @@
 #pragma once
 
 #include <fmt/format.h>
+#include <gen_cpp/Status_types.h> // for TStatus
 #include <glog/logging.h>
+#include <stdint.h>
 
 #include <iostream>
+#include <memory>
 #include <string>
 #include <string_view>
+#include <utility>
 
 #include "common/compiler_util.h"
-#include "gen_cpp/Status_types.h" // for TStatus
 #ifdef ENABLE_STACKTRACE
 #include "util/stack_util.h"
 #endif
diff --git a/be/src/exec/arrow/arrow_reader.cpp b/be/src/exec/arrow/arrow_reader.cpp
index 2e34b343d2..6696d5489c 100644
--- a/be/src/exec/arrow/arrow_reader.cpp
+++ b/be/src/exec/arrow/arrow_reader.cpp
@@ -16,23 +16,24 @@
 // under the License.
 #include "exec/arrow/arrow_reader.h"
 
-#include <arrow/array.h>
-#include <arrow/status.h>
-#include <time.h>
+#include <arrow/buffer.h>
+#include <arrow/record_batch.h>
+#include <opentelemetry/common/threadlocal.h>
+
+#include <algorithm>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <ostream>
+#include <utility>
 
 #include "common/logging.h"
-#include "gen_cpp/PaloBrokerService_types.h"
-#include "gen_cpp/TPaloBrokerService.h"
-#include "io/io_common.h"
-#include "olap/iterators.h"
-#include "runtime/broker_mgr.h"
-#include "runtime/client_cache.h"
+#include "io/fs/file_reader.h"
 #include "runtime/descriptors.h"
-#include "runtime/exec_env.h"
 #include "runtime/runtime_state.h"
+#include "util/slice.h"
 #include "util/string_util.h"
-#include "util/thrift_util.h"
 #include "vec/core/block.h"
+#include "vec/core/column_with_type_and_name.h"
 #include "vec/utils/arrow_column_to_doris_column.h"
 
 namespace doris {
diff --git a/be/src/exec/arrow/arrow_reader.h b/be/src/exec/arrow/arrow_reader.h
index fc068092e6..e685e7edaf 100644
--- a/be/src/exec/arrow/arrow_reader.h
+++ b/be/src/exec/arrow/arrow_reader.h
@@ -22,23 +22,40 @@
 #include <arrow/io/api.h>
 #include <arrow/io/file.h>
 #include <arrow/io/interfaces.h>
+#include <arrow/result.h>
+#include <gen_cpp/PaloBrokerService_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
 #include <parquet/api/reader.h>
 #include <parquet/api/writer.h>
 #include <parquet/arrow/reader.h>
 #include <parquet/arrow/writer.h>
 #include <parquet/exception.h>
+#include <parquet/platform.h>
+#include <stddef.h>
 #include <stdint.h>
 
+#include <atomic>
+#include <condition_variable>
+#include <list>
 #include <map>
+#include <memory>
+#include <mutex>
 #include <string>
+#include <thread>
+#include <vector>
 
+#include "common/config.h"
 #include "common/status.h"
-#include "gen_cpp/PaloBrokerService_types.h"
-#include "gen_cpp/PlanNodes_types.h"
-#include "gen_cpp/Types_types.h"
 #include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "vec/exec/format/generic_reader.h"
 
+namespace arrow {
+class RecordBatch;
+class RecordBatchReader;
+} // namespace arrow
+
 namespace doris {
 
 class ExecEnv;
@@ -47,6 +64,11 @@ class TNetworkAddress;
 class RuntimeState;
 class SlotDescriptor;
 class FileReader;
+class TupleDescriptor;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 struct Statistics {
     int32_t filtered_row_groups = 0;
diff --git a/be/src/exec/arrow/parquet_reader.cpp b/be/src/exec/arrow/parquet_reader.cpp
index 5423db509f..f0a1755324 100644
--- a/be/src/exec/arrow/parquet_reader.cpp
+++ b/be/src/exec/arrow/parquet_reader.cpp
@@ -16,23 +16,34 @@
 // under the License.
 #include "exec/arrow/parquet_reader.h"
 
-#include <arrow/array.h>
+#include <arrow/record_batch.h>
+#include <arrow/result.h>
 #include <arrow/status.h>
-#include <arrow/type_fwd.h>
-#include <time.h>
+#include <arrow/type.h>
+#include <opentelemetry/common/threadlocal.h>
+#include <parquet/exception.h>
+#include <parquet/file_reader.h>
+#include <parquet/metadata.h>
+#include <parquet/properties.h>
+#include <parquet/schema.h>
 
 #include <algorithm>
-#include <cinttypes>
+#include <atomic>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <condition_variable>
+#include <list>
+#include <map>
 #include <mutex>
+#include <ostream>
 #include <thread>
 
 #include "common/logging.h"
 #include "common/status.h"
-#include "runtime/descriptors.h"
 #include "util/string_util.h"
-#include "vec/common/string_ref.h"
 
 namespace doris {
+class TupleDescriptor;
 
 // Broker
 ParquetReaderWrap::ParquetReaderWrap(RuntimeState* state,
diff --git a/be/src/exec/arrow/parquet_reader.h b/be/src/exec/arrow/parquet_reader.h
index 93dd64a081..4f57fdc7b9 100644
--- a/be/src/exec/arrow/parquet_reader.h
+++ b/be/src/exec/arrow/parquet_reader.h
@@ -23,6 +23,10 @@
 #include <arrow/io/file.h>
 #include <arrow/io/interfaces.h>
 #include <arrow/status.h>
+#include <arrow/type_fwd.h>
+#include <gen_cpp/PaloBrokerService_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
 #include <parquet/api/reader.h>
 #include <parquet/api/writer.h>
 #include <parquet/arrow/reader.h>
@@ -34,16 +38,23 @@
 #include <condition_variable>
 #include <list>
 #include <map>
+#include <memory>
 #include <mutex>
 #include <string>
 #include <thread>
+#include <vector>
 
 #include "common/config.h"
 #include "common/status.h"
 #include "exec/arrow/arrow_reader.h"
-#include "gen_cpp/PaloBrokerService_types.h"
-#include "gen_cpp/PlanNodes_types.h"
-#include "gen_cpp/Types_types.h"
+#include "io/fs/file_reader_writer_fwd.h"
+
+namespace arrow {
+class RecordBatch;
+} // namespace arrow
+namespace parquet {
+class FileMetaData;
+} // namespace parquet
 
 namespace doris {
 
@@ -54,6 +65,7 @@ class RuntimeState;
 class SlotDescriptor;
 class FileReader;
 class RowGroupReader;
+class TupleDescriptor;
 
 // Reader of parquet file
 class ParquetReaderWrap final : public ArrowReaderWrap {
diff --git a/be/src/exec/base_scanner.cpp b/be/src/exec/base_scanner.cpp
index 84329c832d..043913a5f8 100644
--- a/be/src/exec/base_scanner.cpp
+++ b/be/src/exec/base_scanner.cpp
@@ -17,16 +17,40 @@
 
 #include "base_scanner.h"
 
+#include <assert.h>
 #include <fmt/format.h>
+#include <gen_cpp/Metrics_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <glog/logging.h>
+#include <opentelemetry/common/threadlocal.h>
+#include <parallel_hashmap/phmap.h>
+#include <stddef.h>
+
+#include <boost/iterator/iterator_facade.hpp>
+#include <iterator>
+#include <map>
+#include <string>
+#include <utility>
 
 #include "common/consts.h"
-#include "common/utils.h"
-#include "exec/exec_node.h"
+#include "gutil/casts.h"
+#include "runtime/define_primitive_type.h"
 #include "runtime/descriptors.h"
 #include "runtime/runtime_state.h"
+#include "runtime/types.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/columns/column_vector.h"
+#include "vec/columns/columns_number.h"
+#include "vec/common/string_ref.h"
+#include "vec/core/column_with_type_and_name.h"
+#include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
+#include "vec/data_types/data_type_number.h"
+#include "vec/exprs/vexpr_context.h"
 
 namespace doris {
+class TColumn;
+class TNetworkAddress;
 
 BaseScanner::BaseScanner(RuntimeState* state, RuntimeProfile* profile,
                          const TBrokerScanRangeParams& params,
diff --git a/be/src/exec/base_scanner.h b/be/src/exec/base_scanner.h
index 8fbcb8b01f..291f7d653d 100644
--- a/be/src/exec/base_scanner.h
+++ b/be/src/exec/base_scanner.h
@@ -17,9 +17,21 @@
 
 #pragma once
 
+#include <gen_cpp/Exprs_types.h>
+#include <stdint.h>
+
+#include <memory>
+#include <unordered_map>
+#include <vector>
+
+#include "common/global_types.h"
 #include "common/status.h"
+#include "runtime/descriptors.h"
 #include "util/runtime_profile.h"
+#include "util/slice.h"
+#include "vec/columns/column.h"
 #include "vec/common/schema_util.h"
+#include "vec/core/block.h"
 #include "vec/exprs/vexpr.h"
 #include "vec/exprs/vexpr_context.h"
 
@@ -28,10 +40,14 @@ namespace doris {
 class TupleDescriptor;
 class RowDescriptor;
 class RuntimeState;
+class TBrokerRangeDesc;
+class TBrokerScanRangeParams;
+class TNetworkAddress;
 
 namespace vectorized {
 class VExprContext;
 class IColumn;
+
 using MutableColumnPtr = IColumn::MutablePtr;
 } // namespace vectorized
 
diff --git a/be/src/exec/data_sink.cpp b/be/src/exec/data_sink.cpp
index 3ce9d004e2..197a353124 100644
--- a/be/src/exec/data_sink.cpp
+++ b/be/src/exec/data_sink.cpp
@@ -20,22 +20,28 @@
 
 #include "exec/data_sink.h"
 
+#include <gen_cpp/DataSinks_types.h>
+#include <gen_cpp/PaloInternalService_types.h>
+#include <glog/logging.h>
+
 #include <map>
 #include <memory>
+#include <ostream>
 #include <string>
+#include <utility>
 
-#include "gen_cpp/PaloInternalService_types.h"
-#include "runtime/runtime_state.h"
+#include "common/config.h"
 #include "vec/sink/vdata_stream_sender.h"
 #include "vec/sink/vjdbc_table_sink.h"
 #include "vec/sink/vmemory_scratch_sink.h"
-#include "vec/sink/vmysql_table_sink.h"
 #include "vec/sink/vodbc_table_sink.h"
 #include "vec/sink/vresult_file_sink.h"
 #include "vec/sink/vresult_sink.h"
 #include "vec/sink/vtablet_sink.h"
 
 namespace doris {
+class DescriptorTbl;
+class TExpr;
 
 Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink,
                                   const std::vector<TExpr>& output_exprs,
diff --git a/be/src/exec/data_sink.h b/be/src/exec/data_sink.h
index 0e0b9e63fd..3ea5da0c3c 100644
--- a/be/src/exec/data_sink.h
+++ b/be/src/exec/data_sink.h
@@ -20,11 +20,16 @@
 
 #pragma once
 
+#include <gen_cpp/DataSinks_types.h>
+#include <gen_cpp/Exprs_types.h>
+#include <opentelemetry/trace/span.h>
+#include <stddef.h>
+// IWYU pragma: no_include <opentelemetry/nostd/shared_ptr.h>
+#include <memory>
+#include <string>
 #include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/DataSinks_types.h"
-#include "gen_cpp/Exprs_types.h"
 #include "runtime/descriptors.h"
 #include "runtime/query_statistics.h"
 #include "util/runtime_profile.h"
@@ -36,6 +41,11 @@ class ObjectPool;
 class RuntimeState;
 class TPlanFragmentExecParams;
 class RowDescriptor;
+class DescriptorTbl;
+class QueryStatistics;
+class TDataSink;
+class TExpr;
+class TPipelineFragmentParams;
 
 namespace vectorized {
 class Block;
diff --git a/be/src/exec/decompressor.cpp b/be/src/exec/decompressor.cpp
index 18bf064fcb..af69a896a2 100644
--- a/be/src/exec/decompressor.cpp
+++ b/be/src/exec/decompressor.cpp
@@ -17,6 +17,10 @@
 
 #include "exec/decompressor.h"
 
+#include <strings.h>
+
+#include <ostream>
+
 #include "common/logging.h"
 
 namespace doris {
diff --git a/be/src/exec/decompressor.h b/be/src/exec/decompressor.h
index a9e6ef7b02..af37335f1f 100644
--- a/be/src/exec/decompressor.h
+++ b/be/src/exec/decompressor.h
@@ -19,8 +19,12 @@
 
 #include <bzlib.h>
 #include <lz4/lz4frame.h>
+#include <stddef.h>
+#include <stdint.h>
 #include <zlib.h>
 
+#include <string>
+
 #ifdef DORIS_WITH_LZO
 #include <lzo/lzo1x.h>
 #include <lzo/lzoconf.h>
diff --git a/be/src/exec/es/es_scan_reader.cpp b/be/src/exec/es/es_scan_reader.cpp
index 0002d8f2d6..10c36ab67f 100644
--- a/be/src/exec/es/es_scan_reader.cpp
+++ b/be/src/exec/es/es_scan_reader.cpp
@@ -17,6 +17,8 @@
 
 #include "exec/es/es_scan_reader.h"
 
+#include <stdlib.h>
+
 #include <map>
 #include <sstream>
 #include <string>
@@ -24,7 +26,9 @@
 #include "common/config.h"
 #include "common/logging.h"
 #include "common/status.h"
+#include "exec/es/es_scroll_parser.h"
 #include "exec/es/es_scroll_query.h"
+#include "http/http_method.h"
 
 namespace doris {
 
diff --git a/be/src/exec/es/es_scan_reader.h b/be/src/exec/es/es_scan_reader.h
index 79042838af..95b3e37980 100644
--- a/be/src/exec/es/es_scan_reader.h
+++ b/be/src/exec/es/es_scan_reader.h
@@ -17,11 +17,17 @@
 
 #pragma once
 
+#include <map>
+#include <memory>
 #include <string>
 
 #include "exec/es/es_scroll_parser.h"
 #include "http/http_client.h"
 
+namespace doris {
+class ScrollParser;
+} // namespace doris
+
 using std::string;
 
 namespace doris {
diff --git a/be/src/exec/es/es_scroll_parser.cpp b/be/src/exec/es/es_scroll_parser.cpp
index d0a57b341c..abe793984c 100644
--- a/be/src/exec/es/es_scroll_parser.cpp
+++ b/be/src/exec/es/es_scroll_parser.cpp
@@ -18,20 +18,34 @@
 #include "exec/es/es_scroll_parser.h"
 
 #include <cctz/time_zone.h>
+#include <glog/logging.h>
 #include <gutil/strings/substitute.h>
-
-#include <boost/algorithm/string.hpp>
+#include <rapidjson/allocators.h>
+#include <rapidjson/encodings.h>
+#include <stdint.h>
+#include <string.h>
+
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <cstdlib>
+#include <ostream>
 #include <string>
 
 #include "common/status.h"
+#include "gutil/integral_types.h"
 #include "rapidjson/document.h"
 #include "rapidjson/rapidjson.h"
 #include "rapidjson/stringbuffer.h"
 #include "rapidjson/writer.h"
-#include "runtime/memory/mem_tracker.h"
+#include "runtime/decimalv2_value.h"
+#include "runtime/define_primitive_type.h"
+#include "runtime/descriptors.h"
+#include "runtime/primitive_type.h"
+#include "runtime/types.h"
+#include "util/binary_cast.hpp"
 #include "util/string_parser.hpp"
-#include "vec/columns/column_array.h"
-#include "vec/common/string_ref.h"
+#include "vec/columns/column.h"
+#include "vec/columns/column_nullable.h"
 #include "vec/core/field.h"
 #include "vec/runtime/vdatetime_value.h"
 
diff --git a/be/src/exec/es/es_scroll_parser.h b/be/src/exec/es/es_scroll_parser.h
index 2a40bde974..d4edcb9ed2 100644
--- a/be/src/exec/es/es_scroll_parser.h
+++ b/be/src/exec/es/es_scroll_parser.h
@@ -17,15 +17,21 @@
 
 #pragma once
 
+#include <rapidjson/rapidjson.h>
+
+#include <map>
 #include <string>
+#include <vector>
 
 #include "rapidjson/document.h"
 #include "runtime/descriptors.h"
 #include "vec/core/block.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
 
 class Status;
+class TupleDescriptor;
 
 class ScrollParser {
 public:
diff --git a/be/src/exec/es/es_scroll_query.cpp b/be/src/exec/es/es_scroll_query.cpp
index b68e8624c3..e8d214fd9b 100644
--- a/be/src/exec/es/es_scroll_query.cpp
+++ b/be/src/exec/es/es_scroll_query.cpp
@@ -17,6 +17,11 @@
 
 #include "exec/es/es_scroll_query.h"
 
+#include <glog/logging.h>
+#include <rapidjson/encodings.h>
+#include <rapidjson/rapidjson.h>
+#include <stdlib.h>
+
 #include <sstream>
 
 #include "exec/es/es_scan_reader.h"
diff --git a/be/src/exec/exec_node.cpp b/be/src/exec/exec_node.cpp
index d0dde43c93..6c3a011dc5 100644
--- a/be/src/exec/exec_node.cpp
+++ b/be/src/exec/exec_node.cpp
@@ -20,19 +20,32 @@
 
 #include "exec/exec_node.h"
 
+#include <gen_cpp/Metrics_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <opentelemetry/common/threadlocal.h>
 #include <thrift/protocol/TDebugProtocol.h>
-#include <unistd.h>
 
+#include <map>
 #include <sstream>
+#include <typeinfo>
+#include <utility>
 
+#include "common/config.h"
+#include "common/logging.h"
 #include "common/object_pool.h"
 #include "common/status.h"
+#include "exec/scan_node.h"
 #include "runtime/descriptors.h"
 #include "runtime/memory/mem_tracker.h"
 #include "runtime/runtime_state.h"
 #include "util/debug_util.h"
 #include "util/runtime_profile.h"
+#include "util/uid_util.h"
+#include "vec/columns/column.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/common/pod_array_fwd.h"
 #include "vec/core/block.h"
+#include "vec/core/column_with_type_and_name.h"
 #include "vec/exec/join/vhash_join_node.h"
 #include "vec/exec/join/vnested_loop_join_node.h"
 #include "vec/exec/scan/new_es_scan_node.h"
@@ -41,13 +54,13 @@
 #include "vec/exec/scan/new_odbc_scan_node.h"
 #include "vec/exec/scan/new_olap_scan_node.h"
 #include "vec/exec/scan/vmeta_scan_node.h"
+#include "vec/exec/scan/vscan_node.h"
 #include "vec/exec/vaggregation_node.h"
 #include "vec/exec/vanalytic_eval_node.h"
 #include "vec/exec/vassert_num_rows_node.h"
 #include "vec/exec/vdata_gen_scan_node.h"
 #include "vec/exec/vempty_set_node.h"
 #include "vec/exec/vexchange_node.h"
-#include "vec/exec/vmysql_scan_node.h"
 #include "vec/exec/vrepeat_node.h"
 #include "vec/exec/vschema_scan_node.h"
 #include "vec/exec/vselect_node.h"
@@ -56,8 +69,11 @@
 #include "vec/exec/vtable_function_node.h"
 #include "vec/exec/vunion_node.h"
 #include "vec/exprs/vexpr.h"
+#include "vec/exprs/vexpr_context.h"
+#include "vec/utils/util.hpp"
 
 namespace doris {
+class QueryStatistics;
 
 const std::string ExecNode::ROW_THROUGHPUT_COUNTER = "RowsReturnedRate";
 
diff --git a/be/src/exec/exec_node.h b/be/src/exec/exec_node.h
index d5a38890ab..d5b9688361 100644
--- a/be/src/exec/exec_node.h
+++ b/be/src/exec/exec_node.h
@@ -20,18 +20,27 @@
 
 #pragma once
 
+#include <gen_cpp/PlanNodes_types.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <atomic>
+#include <functional>
+#include <memory>
 #include <mutex>
 #include <sstream>
+#include <string>
 #include <vector>
 
+#include "common/global_types.h"
 #include "common/status.h"
-#include "gen_cpp/PlanNodes_types.h"
 #include "runtime/descriptors.h"
 #include "runtime/query_statistics.h"
 #include "service/backend_options.h"
 #include "util/blocking_queue.hpp"
 #include "util/runtime_profile.h"
 #include "util/telemetry/telemetry.h"
+#include "vec/core/block.h"
 #include "vec/exprs/vexpr_context.h"
 
 namespace doris {
@@ -40,10 +49,12 @@ class Counters;
 class RuntimeState;
 class TPlan;
 class MemTracker;
+class QueryStatistics;
 
 namespace vectorized {
 class Block;
 class VExpr;
+class VExprContext;
 } // namespace vectorized
 
 namespace pipeline {
diff --git a/be/src/exec/odbc_connector.cpp b/be/src/exec/odbc_connector.cpp
index 255eb1715c..3b3d896ce6 100644
--- a/be/src/exec/odbc_connector.cpp
+++ b/be/src/exec/odbc_connector.cpp
@@ -17,12 +17,22 @@
 
 #include "exec/odbc_connector.h"
 
+#include <glog/logging.h>
+#include <sql.h>
 #include <sqlext.h>
+#include <wchar.h>
 
-#include <codecvt>
+#include <algorithm>
+#include <ostream>
 
-#include "runtime/primitive_type.h"
-#include "util/types.h"
+#include "runtime/define_primitive_type.h"
+#include "runtime/descriptors.h"
+#include "runtime/types.h"
+#include "util/runtime_profile.h"
+
+namespace doris {
+class RuntimeState;
+} // namespace doris
 
 #define ODBC_DISPOSE(h, ht, x, op)                                                        \
     {                                                                                     \
diff --git a/be/src/exec/odbc_connector.h b/be/src/exec/odbc_connector.h
index f7765a9fce..90ef031a10 100644
--- a/be/src/exec/odbc_connector.h
+++ b/be/src/exec/odbc_connector.h
@@ -16,12 +16,24 @@
 // under the License.
 
 #pragma once
+#include <fmt/format.h>
 #include <sqltypes.h>
+#include <stdint.h>
+#include <stdlib.h>
 
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "common/config.h"
 #include "common/status.h"
 #include "exec/table_connector.h"
 
 namespace doris {
+class RuntimeProfile;
+class RuntimeState;
+class TupleDescriptor;
+
 struct ODBCConnectorParam {
     std::string connect_string;
 
diff --git a/be/src/exec/olap_common.cpp b/be/src/exec/olap_common.cpp
index 7963139542..04ca8e5efc 100644
--- a/be/src/exec/olap_common.cpp
+++ b/be/src/exec/olap_common.cpp
@@ -17,10 +17,6 @@
 
 #include "exec/olap_common.h"
 
-#include <boost/lexical_cast.hpp>
-#include <set>
-#include <sstream>
-#include <string>
 #include <utility>
 #include <vector>
 
diff --git a/be/src/exec/olap_common.h b/be/src/exec/olap_common.h
index d0b6191927..e160d54fa3 100644
--- a/be/src/exec/olap_common.h
+++ b/be/src/exec/olap_common.h
@@ -17,17 +17,30 @@
 
 #pragma once
 
+#include <gen_cpp/PaloInternalService_types.h>
+#include <glog/logging.h>
+#include <stddef.h>
+
+#include <boost/container/detail/std_fwd.hpp>
 #include <boost/lexical_cast.hpp>
 #include <cstdint>
+#include <iterator>
 #include <map>
+#include <memory>
+#include <set>
 #include <sstream>
 #include <string>
 #include <type_traits>
+#include <utility>
 #include <variant>
+#include <vector>
 
+#include "common/status.h"
 #include "exec/olap_utils.h"
 #include "olap/olap_common.h"
 #include "olap/olap_tuple.h"
+#include "runtime/datetime_value.h"
+#include "runtime/define_primitive_type.h"
 #include "runtime/primitive_type.h"
 #include "runtime/type_limit.h"
 #include "vec/core/types.h"
diff --git a/be/src/exec/rowid_fetcher.cpp b/be/src/exec/rowid_fetcher.cpp
index a9a326c0e3..57bacb4fcb 100644
--- a/be/src/exec/rowid_fetcher.cpp
+++ b/be/src/exec/rowid_fetcher.cpp
@@ -17,14 +17,36 @@
 
 #include "exec/rowid_fetcher.h"
 
+#include <brpc/callback.h>
+#include <brpc/controller.h>
+#include <butil/endpoint.h>
+#include <fmt/format.h>
+#include <gen_cpp/internal_service.pb.h>
+#include <glog/logging.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
+#include <ostream>
+#include <string>
+#include <unordered_map>
+#include <utility>
+
 #include "bthread/countdown_event.h"
+#include "common/config.h"
 #include "exec/tablet_info.h" // DorisNodesInfo
-#include "gen_cpp/Types_types.h"
-#include "gen_cpp/internal_service.pb.h"
+#include "olap/olap_common.h"
+#include "olap/utils.h"
+#include "runtime/descriptors.h"
 #include "runtime/exec_env.h"       // ExecEnv
 #include "runtime/runtime_state.h"  // RuntimeState
 #include "util/brpc_client_cache.h" // BrpcClientCache
 #include "util/defer_op.h"
+#include "vec/columns/column.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/columns/column_string.h"
+#include "vec/common/assert_cast.h"
+#include "vec/common/string_ref.h"
 #include "vec/core/block.h" // Block
 
 namespace doris {
diff --git a/be/src/exec/rowid_fetcher.h b/be/src/exec/rowid_fetcher.h
index 57101c5033..19dabdf901 100644
--- a/be/src/exec/rowid_fetcher.h
+++ b/be/src/exec/rowid_fetcher.h
@@ -17,13 +17,25 @@
 
 #pragma once
 
-#include "gen_cpp/internal_service.pb.h"
+#include <gen_cpp/internal_service.pb.h>
+
+#include <memory>
+#include <vector>
+
+#include "common/status.h"
 #include "vec/core/block.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
 
 class DorisNodesInfo;
 class RuntimeState;
+class TupleDescriptor;
+
+namespace vectorized {
+class ColumnString;
+class MutableBlock;
+} // namespace vectorized
 
 // fetch rows by global rowid
 // tablet_id/rowset_name/segment_id/ordinal_id
diff --git a/be/src/exec/scan_node.cpp b/be/src/exec/scan_node.cpp
index 2b8bb6b5cf..281a55b6f3 100644
--- a/be/src/exec/scan_node.cpp
+++ b/be/src/exec/scan_node.cpp
@@ -20,9 +20,18 @@
 
 #include "exec/scan_node.h"
 
+#include <gen_cpp/Metrics_types.h>
+
+#include <memory>
+
+#include "vec/exprs/vexpr_context.h"
 #include "vec/utils/util.hpp"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class VExpr;
+} // namespace vectorized
 
 const std::string ScanNode::_s_bytes_read_counter = "BytesRead";
 const std::string ScanNode::_s_rows_read_counter = "RowsRead";
diff --git a/be/src/exec/scan_node.h b/be/src/exec/scan_node.h
index c83bf9884b..aed701dbe9 100644
--- a/be/src/exec/scan_node.h
+++ b/be/src/exec/scan_node.h
@@ -20,15 +20,24 @@
 
 #pragma once
 
+#include <gen_cpp/PaloInternalService_types.h>
+
+#include <functional>
 #include <string>
+#include <vector>
 
+#include "common/status.h"
 #include "exec/exec_node.h"
-#include "gen_cpp/PaloInternalService_types.h"
 #include "util/runtime_profile.h"
 
 namespace doris {
 
 class TScanRange;
+class DescriptorTbl;
+class ObjectPool;
+class RuntimeState;
+class TPlanNode;
+class TScanRangeParams;
 
 // Abstract base class of all scan nodes; introduces set_scan_range().
 //
diff --git a/be/src/exec/schema_scanner.cpp b/be/src/exec/schema_scanner.cpp
index ebca8591a5..fd47976c89 100644
--- a/be/src/exec/schema_scanner.cpp
+++ b/be/src/exec/schema_scanner.cpp
@@ -17,7 +17,14 @@
 
 #include "exec/schema_scanner.h"
 
-#include <cstddef>
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/Types_types.h>
+#include <glog/logging.h>
+#include <string.h>
+
+#include <new>
+#include <ostream>
+#include <utility>
 
 #include "exec/schema_scanner/schema_charsets_scanner.h"
 #include "exec/schema_scanner/schema_collations_scanner.h"
@@ -33,13 +40,23 @@
 #include "exec/schema_scanner/schema_user_privileges_scanner.h"
 #include "exec/schema_scanner/schema_variables_scanner.h"
 #include "exec/schema_scanner/schema_views_scanner.h"
+#include "olap/hll.h"
 #include "runtime/define_primitive_type.h"
-#include "util/encryption_util.h"
+#include "util/types.h"
 #include "vec/columns/column.h"
+#include "vec/columns/column_complex.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/columns/column_string.h"
+#include "vec/columns/column_vector.h"
+#include "vec/columns/columns_number.h"
 #include "vec/common/string_ref.h"
 #include "vec/core/block.h"
+#include "vec/core/column_with_type_and_name.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
+class ObjectPool;
 
 DorisServer* SchemaScanner::_s_doris_server;
 
diff --git a/be/src/exec/schema_scanner.h b/be/src/exec/schema_scanner.h
index 3602defbd0..bc600bdf58 100644
--- a/be/src/exec/schema_scanner.h
+++ b/be/src/exec/schema_scanner.h
@@ -17,12 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
 #include <string>
+#include <vector>
 
 #include "common/object_pool.h"
 #include "common/status.h"
-#include "gen_cpp/Descriptors_types.h"
-#include "gen_cpp/Types_types.h"
+#include "runtime/define_primitive_type.h"
 #include "util/runtime_profile.h"
 #include "vec/core/block.h"
 
@@ -31,6 +37,8 @@ namespace doris {
 // forehead declare class, because jni function init in DorisServer.
 class DorisServer;
 class RuntimeState;
+class ObjectPool;
+class TUserIdentity;
 
 namespace vectorized {
 class Block;
diff --git a/be/src/exec/schema_scanner/schema_charsets_scanner.cpp b/be/src/exec/schema_scanner/schema_charsets_scanner.cpp
index 824b5a76ea..4a801f50c1 100644
--- a/be/src/exec/schema_scanner/schema_charsets_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_charsets_scanner.cpp
@@ -17,10 +17,18 @@
 
 #include "exec/schema_scanner/schema_charsets_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <string.h>
+
 #include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaCharsetsScanner::_s_css_columns = {
         //   name,       type,          size
diff --git a/be/src/exec/schema_scanner/schema_charsets_scanner.h b/be/src/exec/schema_scanner/schema_charsets_scanner.h
index 37b2866bab..dfc83cc34b 100644
--- a/be/src/exec/schema_scanner/schema_charsets_scanner.h
+++ b/be/src/exec/schema_scanner/schema_charsets_scanner.h
@@ -19,9 +19,15 @@
 
 #include <stdint.h>
 
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaCharsetsScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_collations_scanner.cpp b/be/src/exec/schema_scanner/schema_collations_scanner.cpp
index 472ba92074..f63e7622b4 100644
--- a/be/src/exec/schema_scanner/schema_collations_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_collations_scanner.cpp
@@ -17,11 +17,18 @@
 
 #include "exec/schema_scanner/schema_collations_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <string.h>
+
 #include "common/status.h"
-#include "runtime/primitive_type.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaCollationsScanner::_s_cols_columns = {
         //   name,       type,          size
diff --git a/be/src/exec/schema_scanner/schema_collations_scanner.h b/be/src/exec/schema_scanner/schema_collations_scanner.h
index d421cf3818..260ef0a170 100644
--- a/be/src/exec/schema_scanner/schema_collations_scanner.h
+++ b/be/src/exec/schema_scanner/schema_collations_scanner.h
@@ -19,9 +19,15 @@
 
 #include <stdint.h>
 
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaCollationsScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_columns_scanner.cpp b/be/src/exec/schema_scanner/schema_columns_scanner.cpp
index 963ed68ebd..e980cced64 100644
--- a/be/src/exec/schema_scanner/schema_columns_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_columns_scanner.cpp
@@ -17,16 +17,24 @@
 
 #include "exec/schema_scanner/schema_columns_scanner.h"
 
-#include <cstddef>
+#include <fmt/format.h>
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+#include <gen_cpp/Types_types.h>
+
 #include <cstdint>
-#include <memory>
-#include <sstream>
 
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaColumnsScanner::_s_col_columns = {
         //   name,       type,          size,                     is_null
diff --git a/be/src/exec/schema_scanner/schema_columns_scanner.h b/be/src/exec/schema_scanner/schema_columns_scanner.h
index 634ff08e2c..4165c6b0bc 100644
--- a/be/src/exec/schema_scanner/schema_columns_scanner.h
+++ b/be/src/exec/schema_scanner/schema_columns_scanner.h
@@ -17,12 +17,19 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
 #include <string>
+#include <vector>
 
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaColumnsScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_dummy_scanner.cpp b/be/src/exec/schema_scanner/schema_dummy_scanner.cpp
index b858855718..1d5956f390 100644
--- a/be/src/exec/schema_scanner/schema_dummy_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_dummy_scanner.cpp
@@ -17,6 +17,15 @@
 
 #include "schema_dummy_scanner.h"
 
+#include <vector>
+
+namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
+} // namespace doris
+
 namespace {
 std::vector<doris::SchemaScanner::ColumnDesc> DUMMY_COLUMN;
 }
diff --git a/be/src/exec/schema_scanner/schema_dummy_scanner.h b/be/src/exec/schema_scanner/schema_dummy_scanner.h
index d48466e83a..919bae8fbb 100644
--- a/be/src/exec/schema_scanner/schema_dummy_scanner.h
+++ b/be/src/exec/schema_scanner/schema_dummy_scanner.h
@@ -17,9 +17,14 @@
 
 #pragma once
 
+#include "common/status.h"
 #include "exec/schema_scanner.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaDummyScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_files_scanner.cpp b/be/src/exec/schema_scanner/schema_files_scanner.cpp
index 1eb8132668..596d21c3dd 100644
--- a/be/src/exec/schema_scanner/schema_files_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_files_scanner.cpp
@@ -17,12 +17,20 @@
 
 #include "exec/schema_scanner/schema_files_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+#include <stdint.h>
+
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
+#include "runtime/define_primitive_type.h"
 #include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaFilesScanner::_s_tbls_columns = {
         //   name,       type,          size,     is_null
diff --git a/be/src/exec/schema_scanner/schema_files_scanner.h b/be/src/exec/schema_scanner/schema_files_scanner.h
index 0e33bf6dd3..7d140bdbe4 100644
--- a/be/src/exec/schema_scanner/schema_files_scanner.h
+++ b/be/src/exec/schema_scanner/schema_files_scanner.h
@@ -17,10 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaFilesScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_helper.cpp b/be/src/exec/schema_scanner/schema_helper.cpp
index dc4e213d67..9dbc40886e 100644
--- a/be/src/exec/schema_scanner/schema_helper.cpp
+++ b/be/src/exec/schema_scanner/schema_helper.cpp
@@ -17,15 +17,24 @@
 
 #include "exec/schema_scanner/schema_helper.h"
 
-#include <sstream>
-#include <thread>
+#include <gen_cpp/FrontendService.h>
 
-#include "gen_cpp/FrontendService.h"
-#include "gen_cpp/FrontendService_types.h"
 #include "runtime/client_cache.h"
 #include "util/thrift_rpc_helper.h"
 
 namespace doris {
+class TDescribeTableParams;
+class TDescribeTableResult;
+class TDescribeTablesParams;
+class TDescribeTablesResult;
+class TGetDbsParams;
+class TGetDbsResult;
+class TGetTablesParams;
+class TGetTablesResult;
+class TListPrivilegesResult;
+class TListTableStatusResult;
+class TShowVariableRequest;
+class TShowVariableResult;
 
 Status SchemaHelper::get_db_names(const std::string& ip, const int32_t port,
                                   const TGetDbsParams& request, TGetDbsResult* result) {
diff --git a/be/src/exec/schema_scanner/schema_helper.h b/be/src/exec/schema_scanner/schema_helper.h
index a6a2ed976e..d6a340e1e4 100644
--- a/be/src/exec/schema_scanner/schema_helper.h
+++ b/be/src/exec/schema_scanner/schema_helper.h
@@ -17,10 +17,26 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+#include <stdint.h>
+
+#include <string>
+
 #include "common/status.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class TDescribeTableParams;
+class TDescribeTableResult;
+class TDescribeTablesParams;
+class TDescribeTablesResult;
+class TGetDbsParams;
+class TGetDbsResult;
+class TGetTablesParams;
+class TGetTablesResult;
+class TListPrivilegesResult;
+class TListTableStatusResult;
+class TShowVariableRequest;
+class TShowVariableResult;
 
 // this class is a helper for getting schema info from FE
 class SchemaHelper {
diff --git a/be/src/exec/schema_scanner/schema_partitions_scanner.cpp b/be/src/exec/schema_scanner/schema_partitions_scanner.cpp
index 5aaded0f93..7c6b7827b9 100644
--- a/be/src/exec/schema_scanner/schema_partitions_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_partitions_scanner.cpp
@@ -17,13 +17,21 @@
 
 #include "exec/schema_scanner/schema_partitions_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+#include <stdint.h>
+
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/datetime_value.h"
-#include "runtime/primitive_type.h"
+#include "runtime/decimalv2_value.h"
+#include "runtime/define_primitive_type.h"
 #include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaPartitionsScanner::_s_tbls_columns = {
         //   name,       type,          size,     is_null
diff --git a/be/src/exec/schema_scanner/schema_partitions_scanner.h b/be/src/exec/schema_scanner/schema_partitions_scanner.h
index 197f917a1d..1c5a86f145 100644
--- a/be/src/exec/schema_scanner/schema_partitions_scanner.h
+++ b/be/src/exec/schema_scanner/schema_partitions_scanner.h
@@ -17,10 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaPartitionsScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_rowsets_scanner.cpp b/be/src/exec/schema_scanner/schema_rowsets_scanner.cpp
index 1028812910..49a8d1fe7f 100644
--- a/be/src/exec/schema_scanner/schema_rowsets_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_rowsets_scanner.cpp
@@ -17,20 +17,32 @@
 
 #include "exec/schema_scanner/schema_rowsets_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+
+#include <algorithm>
 #include <cstddef>
+#include <memory>
+#include <shared_mutex>
+#include <string>
+#include <utility>
 
 #include "common/status.h"
-#include "gutil/integral_types.h"
-#include "olap/rowset/beta_rowset.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/rowset.h"
-#include "olap/rowset/segment_v2/segment.h"
-#include "olap/segment_loader.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet.h"
-#include "runtime/descriptors.h"
-#include "runtime/primitive_type.h"
+#include "olap/tablet_manager.h"
+#include "runtime/define_primitive_type.h"
+#include "runtime/runtime_state.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
+
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
+
 std::vector<SchemaScanner::ColumnDesc> SchemaRowsetsScanner::_s_tbls_columns = {
         //   name,       type,          size,     is_null
         {"BACKEND_ID", TYPE_BIGINT, sizeof(int64_t), true},
diff --git a/be/src/exec/schema_scanner/schema_rowsets_scanner.h b/be/src/exec/schema_scanner/schema_rowsets_scanner.h
index 1e8921a78d..0a8dabc270 100644
--- a/be/src/exec/schema_scanner/schema_rowsets_scanner.h
+++ b/be/src/exec/schema_scanner/schema_rowsets_scanner.h
@@ -20,13 +20,21 @@
 #include <cstddef>
 #include <cstdint>
 #include <memory>
+#include <vector>
 
 #include "common/status.h"
 #include "exec/schema_scanner.h"
 #include "olap/rowset/rowset.h"
 #include "olap/rowset/segment_v2/segment.h"
 #include "runtime/runtime_state.h"
+
 namespace doris {
+class RuntimeState;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
+
 class SchemaRowsetsScanner : public SchemaScanner {
 public:
     SchemaRowsetsScanner();
diff --git a/be/src/exec/schema_scanner/schema_schema_privileges_scanner.cpp b/be/src/exec/schema_scanner/schema_schema_privileges_scanner.cpp
index 17973a1e61..4b210bc5eb 100644
--- a/be/src/exec/schema_scanner/schema_schema_privileges_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_schema_privileges_scanner.cpp
@@ -17,11 +17,21 @@
 
 #include "exec/schema_scanner/schema_schema_privileges_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+
+#include <string>
+
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaSchemaPrivilegesScanner::_s_tbls_columns = {
         //   name,       type,          size,     is_null
diff --git a/be/src/exec/schema_scanner/schema_schema_privileges_scanner.h b/be/src/exec/schema_scanner/schema_schema_privileges_scanner.h
index a52643afd1..9b34f952f5 100644
--- a/be/src/exec/schema_scanner/schema_schema_privileges_scanner.h
+++ b/be/src/exec/schema_scanner/schema_schema_privileges_scanner.h
@@ -17,10 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaSchemaPrivilegesScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_schemata_scanner.cpp b/be/src/exec/schema_scanner/schema_schemata_scanner.cpp
index 4c2b05a172..b0d0aca2bb 100644
--- a/be/src/exec/schema_scanner/schema_schemata_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_schemata_scanner.cpp
@@ -17,11 +17,21 @@
 
 #include "exec/schema_scanner/schema_schemata_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+
+#include <string>
+
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaSchemataScanner::_s_columns = {
         //   name,       type,          size
diff --git a/be/src/exec/schema_scanner/schema_schemata_scanner.h b/be/src/exec/schema_scanner/schema_schemata_scanner.h
index 572f8b741d..90437e0f78 100644
--- a/be/src/exec/schema_scanner/schema_schemata_scanner.h
+++ b/be/src/exec/schema_scanner/schema_schemata_scanner.h
@@ -17,10 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaSchemataScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_statistics_scanner.cpp b/be/src/exec/schema_scanner/schema_statistics_scanner.cpp
index ed2e713da0..f4f3d5dba8 100644
--- a/be/src/exec/schema_scanner/schema_statistics_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_statistics_scanner.cpp
@@ -17,7 +17,9 @@
 
 #include "exec/schema_scanner/schema_statistics_scanner.h"
 
-#include "runtime/primitive_type.h"
+#include <stdint.h>
+
+#include "runtime/define_primitive_type.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
diff --git a/be/src/exec/schema_scanner/schema_statistics_scanner.h b/be/src/exec/schema_scanner/schema_statistics_scanner.h
index e31c27277b..2d02863bfc 100644
--- a/be/src/exec/schema_scanner/schema_statistics_scanner.h
+++ b/be/src/exec/schema_scanner/schema_statistics_scanner.h
@@ -17,6 +17,8 @@
 
 #pragma once
 
+#include <vector>
+
 #include "exec/schema_scanner.h"
 
 namespace doris {
diff --git a/be/src/exec/schema_scanner/schema_table_privileges_scanner.cpp b/be/src/exec/schema_scanner/schema_table_privileges_scanner.cpp
index d40ce08d18..4a4982bad7 100644
--- a/be/src/exec/schema_scanner/schema_table_privileges_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_table_privileges_scanner.cpp
@@ -17,13 +17,21 @@
 
 #include "exec/schema_scanner/schema_table_privileges_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+
 #include <string>
 
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaTablePrivilegesScanner::_s_tbls_columns = {
         //   name,       type,          size,     is_null
diff --git a/be/src/exec/schema_scanner/schema_table_privileges_scanner.h b/be/src/exec/schema_scanner/schema_table_privileges_scanner.h
index 00545717c2..3aa0d4c659 100644
--- a/be/src/exec/schema_scanner/schema_table_privileges_scanner.h
+++ b/be/src/exec/schema_scanner/schema_table_privileges_scanner.h
@@ -17,10 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaTablePrivilegesScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_tables_scanner.cpp b/be/src/exec/schema_scanner/schema_tables_scanner.cpp
index def0ef5540..3acf255df2 100644
--- a/be/src/exec/schema_scanner/schema_tables_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_tables_scanner.cpp
@@ -17,13 +17,27 @@
 
 #include "exec/schema_scanner/schema_tables_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+#include <stdint.h>
+
+#include <string>
+
 #include "common/status.h"
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
-#include "vec/columns/column_complex.h"
+#include "runtime/decimalv2_value.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
+#include "util/timezone_utils.h"
 #include "vec/common/string_ref.h"
+#include "vec/runtime/vdatetime_value.h"
 
 namespace doris {
+class RuntimeState;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaTablesScanner::_s_tbls_columns = {
         //   name,       type,          size,     is_null
diff --git a/be/src/exec/schema_scanner/schema_tables_scanner.h b/be/src/exec/schema_scanner/schema_tables_scanner.h
index 18488451cc..c295fc6ba2 100644
--- a/be/src/exec/schema_scanner/schema_tables_scanner.h
+++ b/be/src/exec/schema_scanner/schema_tables_scanner.h
@@ -17,12 +17,20 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
+#include <vector>
+
 #include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 #include "vec/core/block.h"
 
 namespace doris {
+class RuntimeState;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaTablesScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_user_privileges_scanner.cpp b/be/src/exec/schema_scanner/schema_user_privileges_scanner.cpp
index bd1037941a..f74436d8d1 100644
--- a/be/src/exec/schema_scanner/schema_user_privileges_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_user_privileges_scanner.cpp
@@ -17,11 +17,21 @@
 
 #include "exec/schema_scanner/schema_user_privileges_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+
+#include <string>
+
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaUserPrivilegesScanner::_s_tbls_columns = {
         //   name,       type,          size,     is_null
diff --git a/be/src/exec/schema_scanner/schema_user_privileges_scanner.h b/be/src/exec/schema_scanner/schema_user_privileges_scanner.h
index 1bef2b340b..66c3501c37 100644
--- a/be/src/exec/schema_scanner/schema_user_privileges_scanner.h
+++ b/be/src/exec/schema_scanner/schema_user_privileges_scanner.h
@@ -17,10 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaUserPrivilegesScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_variables_scanner.cpp b/be/src/exec/schema_scanner/schema_variables_scanner.cpp
index 7627ecdfe1..5efcee07b7 100644
--- a/be/src/exec/schema_scanner/schema_variables_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_variables_scanner.cpp
@@ -17,12 +17,24 @@
 
 #include "exec/schema_scanner/schema_variables_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+#include <string.h>
+
+#include <map>
+#include <string>
+#include <utility>
+
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
-#include "runtime/runtime_state.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaVariablesScanner::_s_vars_columns = {
         //   name,       type,          size
diff --git a/be/src/exec/schema_scanner/schema_variables_scanner.h b/be/src/exec/schema_scanner/schema_variables_scanner.h
index 4befea7bda..2728b70530 100644
--- a/be/src/exec/schema_scanner/schema_variables_scanner.h
+++ b/be/src/exec/schema_scanner/schema_variables_scanner.h
@@ -17,13 +17,22 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+#include <gen_cpp/Types_types.h>
+
 #include <map>
 #include <string>
+#include <vector>
 
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaVariablesScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/schema_scanner/schema_views_scanner.cpp b/be/src/exec/schema_scanner/schema_views_scanner.cpp
index 34e9d93dae..abfb1929f3 100644
--- a/be/src/exec/schema_scanner/schema_views_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_views_scanner.cpp
@@ -17,11 +17,21 @@
 
 #include "exec/schema_scanner/schema_views_scanner.h"
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/FrontendService_types.h>
+
+#include <string>
+
 #include "exec/schema_scanner/schema_helper.h"
-#include "runtime/primitive_type.h"
+#include "runtime/define_primitive_type.h"
+#include "util/runtime_profile.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 std::vector<SchemaScanner::ColumnDesc> SchemaViewsScanner::_s_tbls_columns = {
         //   name,       type,          size,     is_null
diff --git a/be/src/exec/schema_scanner/schema_views_scanner.h b/be/src/exec/schema_scanner/schema_views_scanner.h
index 9eeca601f3..65683c4a8b 100644
--- a/be/src/exec/schema_scanner/schema_views_scanner.h
+++ b/be/src/exec/schema_scanner/schema_views_scanner.h
@@ -17,10 +17,18 @@
 
 #pragma once
 
+#include <gen_cpp/FrontendService_types.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "gen_cpp/FrontendService_types.h"
 
 namespace doris {
+class RuntimeState;
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class SchemaViewsScanner : public SchemaScanner {
 public:
diff --git a/be/src/exec/table_connector.cpp b/be/src/exec/table_connector.cpp
index e4af221a2b..ef0b9db8c3 100644
--- a/be/src/exec/table_connector.cpp
+++ b/be/src/exec/table_connector.cpp
@@ -17,22 +17,37 @@
 
 #include "exec/table_connector.h"
 
-#include <fmt/core.h>
+#include <bthread/errno.h>
+#include <errno.h>
+#include <gen_cpp/Metrics_types.h>
 #include <gen_cpp/Types_types.h>
 #include <glog/logging.h>
 #include <iconv.h>
 
+#include <cstdlib>
+#include <memory>
+#include <string_view>
+#include <type_traits>
+
+#include "runtime/decimalv2_value.h"
 #include "runtime/define_primitive_type.h"
-#include "runtime/primitive_type.h"
-#include "util/mysql_global.h"
+#include "util/binary_cast.hpp"
+#include "vec/columns/column.h"
 #include "vec/columns/column_array.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/common/assert_cast.h"
+#include "vec/common/string_ref.h"
 #include "vec/core/block.h"
+#include "vec/core/column_with_type_and_name.h"
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_array.h"
+#include "vec/data_types/data_type_nullable.h"
 #include "vec/exprs/vexpr.h"
 #include "vec/exprs/vexpr_context.h"
+#include "vec/runtime/vdatetime_value.h"
 
 namespace doris {
+class TupleDescriptor;
 
 // Default max buffer size use in insert to: 50MB, normally a batch is smaller than the size
 static constexpr uint32_t INSERT_BUFFER_SIZE = 1024l * 1024 * 50;
diff --git a/be/src/exec/table_connector.h b/be/src/exec/table_connector.h
index 872aa7fe14..27d3061e75 100644
--- a/be/src/exec/table_connector.h
+++ b/be/src/exec/table_connector.h
@@ -19,6 +19,7 @@
 
 #include <fmt/format.h>
 #include <gen_cpp/Types_types.h>
+#include <stdint.h>
 
 #include <boost/format.hpp>
 #include <cstdlib>
@@ -27,9 +28,20 @@
 
 #include "common/status.h"
 #include "runtime/descriptors.h"
+#include "runtime/types.h"
+#include "util/runtime_profile.h"
+#include "vec/aggregate_functions/aggregate_function.h"
+#include "vec/data_types/data_type.h"
 #include "vec/exprs/vexpr_context.h"
 
 namespace doris {
+class RuntimeState;
+class TupleDescriptor;
+
+namespace vectorized {
+class Block;
+class VExprContext;
+} // namespace vectorized
 
 // Table Connector for scan data from ODBC/JDBC
 class TableConnector {
diff --git a/be/src/exec/tablet_info.cpp b/be/src/exec/tablet_info.cpp
index b4583943ea..1b79278d8b 100644
--- a/be/src/exec/tablet_info.cpp
+++ b/be/src/exec/tablet_info.cpp
@@ -17,10 +17,28 @@
 
 #include "exec/tablet_info.h"
 
+#include <butil/fast_rand.h>
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/Exprs_types.h>
+#include <gen_cpp/Types_types.h>
+#include <gen_cpp/descriptors.pb.h>
+#include <glog/logging.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <ostream>
+
+#include "olap/tablet_schema.h"
+#include "runtime/descriptors.h"
 #include "runtime/large_int_value.h"
+#include "runtime/memory/mem_tracker.h"
 #include "runtime/raw_value.h"
+#include "runtime/types.h"
+#include "util/hash_util.hpp"
 #include "util/string_parser.hpp"
+#include "vec/common/string_ref.h"
 #include "vec/exprs/vexpr.h"
+#include "vec/runtime/vdatetime_value.h"
 
 namespace doris {
 
diff --git a/be/src/exec/tablet_info.h b/be/src/exec/tablet_info.h
index 97dcd2a40d..6c9272787d 100644
--- a/be/src/exec/tablet_info.h
+++ b/be/src/exec/tablet_info.h
@@ -17,22 +17,39 @@
 
 #pragma once
 
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/descriptors.pb.h>
+
 #include <cstdint>
+#include <functional>
+#include <iterator>
 #include <map>
 #include <memory>
+#include <string>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include "common/object_pool.h"
 #include "common/status.h"
-#include "gen_cpp/Descriptors_types.h"
-#include "gen_cpp/descriptors.pb.h"
 #include "olap/tablet_schema.h"
 #include "runtime/descriptors.h"
+#include "vec/columns/column.h"
 #include "vec/core/block.h"
+#include "vec/core/column_with_type_and_name.h"
 #include "vec/exprs/vexpr_context.h"
 
 namespace doris {
+class MemTracker;
+class SlotDescriptor;
+class TExprNode;
+class TabletColumn;
+class TabletIndex;
+class TupleDescriptor;
+
+namespace vectorized {
+class VExprContext;
+} // namespace vectorized
 
 struct OlapTableIndexSchema {
     int64_t index_id;
diff --git a/be/src/exec/text_converter.cpp b/be/src/exec/text_converter.cpp
index 3859bd3022..8249b42a98 100644
--- a/be/src/exec/text_converter.cpp
+++ b/be/src/exec/text_converter.cpp
@@ -17,15 +17,25 @@
 
 #include "text_converter.h"
 
+#include <glog/logging.h>
 #include <sql.h>
+#include <stdint.h>
 
+#include <ostream>
+
+#include "common/compiler_util.h"
+#include "olap/hll.h"
 #include "runtime/decimalv2_value.h"
+#include "runtime/define_primitive_type.h"
 #include "runtime/descriptors.h"
+#include "runtime/types.h"
+#include "util/slice.h"
 #include "util/string_parser.hpp"
-#include "util/types.h"
 #include "vec/columns/column_complex.h"
 #include "vec/columns/column_nullable.h"
-#include "vec/common/string_ref.h"
+#include "vec/columns/column_string.h"
+#include "vec/columns/column_vector.h"
+#include "vec/core/types.h"
 #include "vec/runtime/vdatetime_value.h"
 
 namespace doris {
diff --git a/be/src/exec/text_converter.h b/be/src/exec/text_converter.h
index d1b32a094e..0bf3b3f16e 100644
--- a/be/src/exec/text_converter.h
+++ b/be/src/exec/text_converter.h
@@ -17,7 +17,10 @@
 
 #pragma once
 
+#include <stddef.h>
+
 #include "vec/columns/column.h"
+
 namespace doris {
 
 class SlotDescriptor;
diff --git a/be/src/exprs/block_bloom_filter_avx_impl.cc b/be/src/exprs/block_bloom_filter_avx_impl.cc
index db8b9156f0..6781a23332 100644
--- a/be/src/exprs/block_bloom_filter_avx_impl.cc
+++ b/be/src/exprs/block_bloom_filter_avx_impl.cc
@@ -20,10 +20,14 @@
 
 #ifdef __AVX2__
 
+#include <glog/logging.h>
 #include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <ostream>
 
 #include "exprs/block_bloom_filter.hpp"
-#include "gutil/macros.h"
 
 namespace doris {
 
diff --git a/be/src/exprs/block_bloom_filter_impl.cc b/be/src/exprs/block_bloom_filter_impl.cc
index 07d98e842b..d285edcb31 100644
--- a/be/src/exprs/block_bloom_filter_impl.cc
+++ b/be/src/exprs/block_bloom_filter_impl.cc
@@ -20,15 +20,20 @@
 // and modified by Doris
 
 #include <butil/iobuf.h>
+#include <fmt/format.h>
+#include <glog/logging.h>
+#include <stdint.h>
 
 #include <algorithm>
-#include <climits>
-#include <cmath>
+#include <climits> // IWYU pragma: keep
+#include <cmath>   // IWYU pragma: keep
 #include <cstdlib>
 #include <cstring>
 #include <string>
 
+#include "common/status.h"
 #include "exprs/block_bloom_filter.hpp"
+// IWYU pragma: no_include <emmintrin.h>
 #include "util/sse_util.hpp"
 
 namespace doris {
diff --git a/be/src/exprs/json_functions.cpp b/be/src/exprs/json_functions.cpp
index 5a3cbcc9e0..ebfc4b0ae8 100644
--- a/be/src/exprs/json_functions.cpp
+++ b/be/src/exprs/json_functions.cpp
@@ -17,25 +17,23 @@
 
 #include "exprs/json_functions.h"
 
+#include <rapidjson/allocators.h>
 #include <rapidjson/document.h>
-#include <rapidjson/stringbuffer.h>
-#include <rapidjson/writer.h>
+#include <rapidjson/encodings.h>
+#include <rapidjson/rapidjson.h>
 #include <re2/re2.h>
+#include <simdjson/simdjson.h> // IWYU pragma: keep
 #include <stdlib.h>
-#include <sys/time.h>
 
-#include <boost/algorithm/string.hpp>
-#include <iomanip>
+#include <boost/iterator/iterator_facade.hpp>
+#include <boost/token_functions.hpp>
+#include <boost/tokenizer.hpp>
 #include <sstream>
 #include <string>
-#include <string_view>
 #include <vector>
 
 #include "common/compiler_util.h"
 #include "common/logging.h"
-#include "gutil/strings/stringpiece.h"
-#include "udf/udf.h"
-#include "util/string_util.h"
 
 namespace doris {
 
diff --git a/be/src/exprs/json_functions.h b/be/src/exprs/json_functions.h
index 32a2f93814..2de0857219 100644
--- a/be/src/exprs/json_functions.h
+++ b/be/src/exprs/json_functions.h
@@ -18,14 +18,27 @@
 #pragma once
 
 #include <fmt/core.h>
+#include <fmt/format.h>
 #include <rapidjson/document.h>
 #include <simdjson.h>
 
 #include <sstream>
+#include <string>
+#include <utility>
+#include <vector>
 
 #include "common/status.h"
 #include "udf/udf.h"
 
+namespace simdjson {
+namespace fallback {
+namespace ondemand {
+class object;
+class value;
+} // namespace ondemand
+} // namespace fallback
+} // namespace simdjson
+
 namespace doris {
 
 enum JsonFunctionType {
diff --git a/be/src/exprs/math_functions.cpp b/be/src/exprs/math_functions.cpp
index 04ca6f57c1..e76cdde2a5 100644
--- a/be/src/exprs/math_functions.cpp
+++ b/be/src/exprs/math_functions.cpp
@@ -21,17 +21,14 @@
 #include "exprs/math_functions.h"
 
 #include <stdlib.h>
-
+#include <string.h>
+// IWYU pragma: no_include <bits/std_abs.h>
 #include <cmath>
-#include <iomanip>
-#include <random>
-#include <sstream>
+#include <limits>
 #include <string_view>
 
 #include "common/compiler_util.h"
-#include "runtime/decimalv2_value.h"
-#include "runtime/large_int_value.h"
-#include "util/simd/vstring_function.h"
+#include "udf/udf.h"
 #include "util/string_parser.hpp"
 
 namespace doris {
diff --git a/be/src/exprs/math_functions.h b/be/src/exprs/math_functions.h
index 108a690660..5399a39f42 100644
--- a/be/src/exprs/math_functions.h
+++ b/be/src/exprs/math_functions.h
@@ -26,6 +26,7 @@
 #include "vec/common/string_ref.h"
 
 namespace doris {
+class FunctionContext;
 
 class MathFunctions {
 public:
diff --git a/be/src/exprs/runtime_filter.cpp b/be/src/exprs/runtime_filter.cpp
index 0a39b25248..30d8f3b988 100644
--- a/be/src/exprs/runtime_filter.cpp
+++ b/be/src/exprs/runtime_filter.cpp
@@ -17,27 +17,46 @@
 
 #include "runtime_filter.h"
 
+#include <gen_cpp/Opcodes_types.h>
+#include <gen_cpp/PaloInternalService_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
+#include <gen_cpp/internal_service.pb.h>
+#include <stddef.h>
+
+#include <algorithm>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <map>
 #include <memory>
+#include <mutex>
+#include <ostream>
+#include <utility>
 
+#include "common/logging.h"
 #include "common/object_pool.h"
 #include "common/status.h"
 #include "exprs/bitmapfilter_predicate.h"
+#include "exprs/bloom_filter_func.h"
 #include "exprs/create_predicate_function.h"
 #include "exprs/hybrid_set.h"
 #include "exprs/minmax_predicate.h"
-#include "gen_cpp/internal_service.pb.h"
+#include "gutil/strings/substitute.h"
 #include "runtime/define_primitive_type.h"
 #include "runtime/large_int_value.h"
 #include "runtime/primitive_type.h"
 #include "runtime/runtime_filter_mgr.h"
+#include "util/bitmap_value.h"
 #include "util/runtime_profile.h"
 #include "util/string_parser.hpp"
 #include "vec/columns/column.h"
 #include "vec/columns/column_complex.h"
+#include "vec/common/assert_cast.h"
 #include "vec/exprs/vbitmap_predicate.h"
 #include "vec/exprs/vbloom_predicate.h"
 #include "vec/exprs/vdirect_in_predicate.h"
 #include "vec/exprs/vexpr.h"
+#include "vec/exprs/vexpr_context.h"
 #include "vec/exprs/vliteral.h"
 #include "vec/exprs/vruntimefilter_wrapper.h"
 #include "vec/runtime/shared_hash_table_controller.h"
diff --git a/be/src/exprs/runtime_filter.h b/be/src/exprs/runtime_filter.h
index 5050d81c41..141df632c5 100644
--- a/be/src/exprs/runtime_filter.h
+++ b/be/src/exprs/runtime_filter.h
@@ -17,12 +17,31 @@
 
 #pragma once
 
+#include <fmt/format.h>
+#include <gen_cpp/Exprs_types.h>
+#include <stdint.h>
+
+#include <atomic>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "common/status.h"
+#include "runtime/datetime_value.h"
+#include "runtime/decimalv2_value.h"
+#include "runtime/define_primitive_type.h"
 #include "runtime/large_int_value.h"
+#include "runtime/primitive_type.h"
 #include "runtime/runtime_state.h"
+#include "runtime/types.h"
 #include "util/lock.h"
 #include "util/runtime_profile.h"
 #include "util/time.h"
 #include "util/uid_util.h"
+#include "vec/common/string_ref.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/runtime/vdatetime_value.h"
 
 namespace butil {
 class IOBufAsZeroCopyInputStream;
@@ -42,6 +61,8 @@ class HashJoinNode;
 class RuntimeProfile;
 class BloomFilterFuncBase;
 class BitmapFilterFuncBase;
+class TNetworkAddress;
+class TQueryOptions;
 
 namespace vectorized {
 class VExpr;
@@ -339,6 +360,7 @@ protected:
     std::vector<doris::vectorized::VExpr*> _push_down_vexprs;
 
     struct rpc_context;
+
     std::shared_ptr<rpc_context> _rpc_context;
 
     // parent profile
diff --git a/be/src/exprs/runtime_filter_rpc.cpp b/be/src/exprs/runtime_filter_rpc.cpp
index faaee410d0..8a5c4acb9b 100644
--- a/be/src/exprs/runtime_filter_rpc.cpp
+++ b/be/src/exprs/runtime_filter_rpc.cpp
@@ -15,14 +15,25 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <brpc/controller.h>
+#include <butil/iobuf.h>
+#include <fmt/format.h>
+#include <gen_cpp/Types_types.h>
+#include <gen_cpp/types.pb.h>
+
+#include <memory>
+#include <ostream>
+#include <string>
+
 #include "common/config.h"
 #include "common/status.h"
 #include "exprs/runtime_filter.h"
 #include "runtime/exec_env.h"
 #include "runtime/runtime_state.h"
-
 // for rpc
-#include "gen_cpp/internal_service.pb.h"
+#include <gen_cpp/internal_service.pb.h>
+
+#include "common/logging.h"
 #include "util/brpc_client_cache.h"
 
 namespace doris {
diff --git a/be/src/exprs/string_functions.cpp b/be/src/exprs/string_functions.cpp
index ac80e21b9b..ce5738dba9 100644
--- a/be/src/exprs/string_functions.cpp
+++ b/be/src/exprs/string_functions.cpp
@@ -21,12 +21,9 @@
 #include "exprs/string_functions.h"
 
 #include <re2/re2.h>
+#include <re2/stringpiece.h>
 
-#include <algorithm>
-
-#include "math_functions.h"
-#include "util/simd/vstring_function.h"
-#include "util/url_parser.h"
+#include <sstream>
 
 // NOTE: be careful not to use string::append.  It is not performant.
 namespace doris {
diff --git a/be/src/exprs/string_functions.h b/be/src/exprs/string_functions.h
index e8527eb614..5a64790032 100644
--- a/be/src/exprs/string_functions.h
+++ b/be/src/exprs/string_functions.h
@@ -24,7 +24,9 @@
 
 #include <iomanip>
 #include <locale>
+#include <memory>
 #include <sstream>
+#include <string>
 #include <string_view>
 
 #include "gutil/strings/numbers.h"
diff --git a/be/src/geo/ByteOrderDataInStream.h b/be/src/geo/ByteOrderDataInStream.h
index 2980fc4b43..f42d685808 100644
--- a/be/src/geo/ByteOrderDataInStream.h
+++ b/be/src/geo/ByteOrderDataInStream.h
@@ -15,6 +15,8 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#pragma once
+
 #include <cstddef>
 
 #include "ByteOrderValues.h"
diff --git a/be/src/geo/ByteOrderValues.cpp b/be/src/geo/ByteOrderValues.cpp
index ba05bb647d..1e78322eaa 100644
--- a/be/src/geo/ByteOrderValues.cpp
+++ b/be/src/geo/ByteOrderValues.cpp
@@ -17,7 +17,8 @@
 
 #include "ByteOrderValues.h"
 
-#include <cassert>
+#include <stdint.h>
+
 #include <cstring>
 
 namespace doris {
diff --git a/be/src/geo/ByteOrderValues.h b/be/src/geo/ByteOrderValues.h
index 79a0bbde8a..c78f6c8856 100644
--- a/be/src/geo/ByteOrderValues.h
+++ b/be/src/geo/ByteOrderValues.h
@@ -15,7 +15,12 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#pragma once
+
+#include <sys/types.h>
+
 #include <ctime>
+
 using int64_t = __int64_t;
 using int32_t = __int32_t;
 using uint32_t = __uint32_t;
diff --git a/be/src/geo/geo_tobinary.cpp b/be/src/geo/geo_tobinary.cpp
index f3980075c0..12b36dd3a8 100644
--- a/be/src/geo/geo_tobinary.cpp
+++ b/be/src/geo/geo_tobinary.cpp
@@ -17,10 +17,16 @@
 
 #include "geo_tobinary.h"
 
+#include <cstddef>
+#include <sstream>
+#include <vector>
+
+#include "geo/ByteOrderValues.h"
+#include "geo/geo_common.h"
+#include "geo/machine.h"
+#include "geo/wkt_parse_type.h"
 #include "geo_tobinary_type.h"
 #include "geo_types.h"
-#include "sstream"
-#include "wkb_parse.h"
 
 namespace doris {
 
diff --git a/be/src/geo/geo_tobinary.h b/be/src/geo/geo_tobinary.h
index ee77bea88e..8b861a519a 100644
--- a/be/src/geo/geo_tobinary.h
+++ b/be/src/geo/geo_tobinary.h
@@ -15,18 +15,26 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#pragma once
+
 //#include "geo_types.h"
 
+#include <string>
+
 #include "geo/geo_common.h"
 #include "geo/geo_tobinary_type.h"
 #include "geo/wkt_parse_type.h"
 
+struct ToBinaryContext;
+
 namespace doris {
 
 class GeoShape;
 class GeoPoint;
 class GeoLine;
 class GeoPolygon;
+struct GeoCoordinate;
+struct GeoCoordinateList;
 
 class toBinary {
 public:
diff --git a/be/src/geo/geo_types.cpp b/be/src/geo/geo_types.cpp
index 10d7f5e0a1..672e594273 100644
--- a/be/src/geo/geo_types.cpp
+++ b/be/src/geo/geo_types.cpp
@@ -17,19 +17,25 @@
 
 #include "geo/geo_types.h"
 
+#include <absl/strings/str_format.h>
+#include <glog/logging.h>
+#include <s2/s1angle.h>
 #include <s2/s2cap.h>
-#include <s2/s2cell.h>
 #include <s2/s2earth.h>
 #include <s2/s2latlng.h>
+#include <s2/s2loop.h>
+#include <s2/s2point.h>
 #include <s2/s2polygon.h>
 #include <s2/s2polyline.h>
 #include <s2/util/coding/coder.h>
 #include <s2/util/units/length-units.h>
-#include <stdio.h>
-
+#include <string.h>
+// IWYU pragma: no_include <bits/std_abs.h>
+#include <cmath>
 #include <iomanip>
 #include <sstream>
-#include <type_traits>
+#include <utility>
+#include <vector>
 
 #include "geo/geo_tobinary.h"
 #include "geo/wkb_parse.h"
diff --git a/be/src/geo/geo_types.h b/be/src/geo/geo_types.h
index 055d5463ae..7416dccb35 100644
--- a/be/src/geo/geo_types.h
+++ b/be/src/geo/geo_types.h
@@ -17,6 +17,8 @@
 
 #pragma once
 
+#include <stddef.h>
+
 #include <memory>
 #include <string>
 #include <vector>
@@ -28,7 +30,6 @@ class S2Polyline;
 class S2Polygon;
 class S2Cap;
 class S2Loop;
-
 template <typename T>
 class Vector3;
 
diff --git a/be/src/geo/machine.h b/be/src/geo/machine.h
index db2a67e14e..f40f7b9529 100644
--- a/be/src/geo/machine.h
+++ b/be/src/geo/machine.h
@@ -15,6 +15,8 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#pragma once
+
 namespace doris {
 /**
  * Check endianness of current machine.
diff --git a/be/src/geo/wkb_parse.cpp b/be/src/geo/wkb_parse.cpp
index 5510fa5250..f792dd9a25 100644
--- a/be/src/geo/wkb_parse.cpp
+++ b/be/src/geo/wkb_parse.cpp
@@ -17,10 +17,16 @@
 
 #include "wkb_parse.h"
 
-#include <string.h>
-
+#include <array>
+#include <cstddef>
+#include <istream>
+#include <vector>
+
+#include "geo/ByteOrderDataInStream.h"
+#include "geo/ByteOrderValues.h"
+#include "geo/geo_types.h"
+#include "geo/wkb_parse_ctx.h"
 #include "geo_tobinary_type.h"
-#include "sstream"
 
 namespace doris {
 
diff --git a/be/src/geo/wkb_parse.h b/be/src/geo/wkb_parse.h
index 312459e0f1..c27537966b 100644
--- a/be/src/geo/wkb_parse.h
+++ b/be/src/geo/wkb_parse.h
@@ -15,13 +15,25 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#pragma once
+
+#include <stdint.h>
+
+#include <iosfwd>
+
 #include "geo/geo_common.h"
 #include "geo/geo_types.h"
+#include "geo/wkt_parse_type.h"
 #include "wkb_parse_ctx.h"
 
+struct WkbParseContext;
+
 namespace doris {
 
 class GeoShape;
+class GeoLine;
+class GeoPoint;
+class GeoPolygon;
 
 class WkbParse {
 public:
diff --git a/be/src/geo/wkt_parse.cpp b/be/src/geo/wkt_parse.cpp
index 1e69f7036a..5dd8778332 100644
--- a/be/src/geo/wkt_parse.cpp
+++ b/be/src/geo/wkt_parse.cpp
@@ -17,9 +17,10 @@
 
 #include "geo/wkt_parse.h"
 
-#include "geo/geo_types.h"
 #include "geo/wkt_parse_ctx.h"
+#include "geo/wkt_parse_type.h" // IWYU pragma: keep
 #include "geo/wkt_yacc.y.hpp"
+
 #define YYSTYPE WKT_STYPE
 #define YY_EXTRA_TYPE WktParseContext*
 #include "geo/wkt_lex.l.h"
diff --git a/be/src/geo/wkt_parse.h b/be/src/geo/wkt_parse.h
index a121944aef..0bb999af73 100644
--- a/be/src/geo/wkt_parse.h
+++ b/be/src/geo/wkt_parse.h
@@ -15,6 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#pragma once
+
+#include <stddef.h>
+
 #include <memory>
 
 #include "geo/geo_common.h"
diff --git a/be/src/http/action/check_rpc_channel_action.cpp b/be/src/http/action/check_rpc_channel_action.cpp
index 6a688e836d..d483fc4fa3 100644
--- a/be/src/http/action/check_rpc_channel_action.cpp
+++ b/be/src/http/action/check_rpc_channel_action.cpp
@@ -17,13 +17,21 @@
 
 #include "http/action/check_rpc_channel_action.h"
 
-#include <fmt/core.h>
+#include <brpc/controller.h>
+#include <fmt/format.h>
+#include <gen_cpp/internal_service.pb.h>
+#include <gen_cpp/types.pb.h>
+#include <glog/logging.h>
+#include <stdint.h>
+
+#include <exception>
+#include <memory>
+#include <string>
 
-#include "gen_cpp/internal_service.pb.h"
 #include "http/http_channel.h"
 #include "http/http_request.h"
+#include "http/http_status.h"
 #include "runtime/exec_env.h"
-#include "service/brpc.h"
 #include "util/brpc_client_cache.h"
 #include "util/md5.h"
 
diff --git a/be/src/http/action/check_rpc_channel_action.h b/be/src/http/action/check_rpc_channel_action.h
index d8b456ca8b..6847c51b08 100644
--- a/be/src/http/action/check_rpc_channel_action.h
+++ b/be/src/http/action/check_rpc_channel_action.h
@@ -21,6 +21,8 @@
 
 namespace doris {
 class ExecEnv;
+class HttpRequest;
+
 class CheckRPCChannelAction : public HttpHandler {
 public:
     explicit CheckRPCChannelAction(ExecEnv* exec_env);
diff --git a/be/src/http/action/check_tablet_segment_action.cpp b/be/src/http/action/check_tablet_segment_action.cpp
index 6e822ace7d..4b5362a587 100644
--- a/be/src/http/action/check_tablet_segment_action.cpp
+++ b/be/src/http/action/check_tablet_segment_action.cpp
@@ -17,6 +17,11 @@
 
 #include "http/action/check_tablet_segment_action.h"
 
+#include <glog/logging.h>
+#include <stdint.h>
+
+#include <ostream>
+#include <set>
 #include <string>
 
 #include "http/http_channel.h"
@@ -24,7 +29,9 @@
 #include "http/http_request.h"
 #include "http/http_status.h"
 #include "olap/storage_engine.h"
+#include "olap/tablet_manager.h"
 #include "service/backend_options.h"
+#include "util/easy_json.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/check_tablet_segment_action.h b/be/src/http/action/check_tablet_segment_action.h
index 353c372a13..a4c6f422ee 100644
--- a/be/src/http/action/check_tablet_segment_action.h
+++ b/be/src/http/action/check_tablet_segment_action.h
@@ -23,6 +23,7 @@
 #include "util/easy_json.h"
 
 namespace doris {
+class HttpRequest;
 
 class CheckTabletSegmentAction : public HttpHandler {
 public:
diff --git a/be/src/http/action/checksum_action.cpp b/be/src/http/action/checksum_action.cpp
index 3bbf1dd5a6..6ef7215b95 100644
--- a/be/src/http/action/checksum_action.cpp
+++ b/be/src/http/action/checksum_action.cpp
@@ -17,20 +17,17 @@
 
 #include "http/action/checksum_action.h"
 
+#include <boost/lexical_cast/bad_lexical_cast.hpp>
 #include <sstream>
 #include <string>
 
 #include "boost/lexical_cast.hpp"
 #include "common/logging.h"
+#include "common/status.h"
 #include "http/http_channel.h"
-#include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
-#include "olap/olap_define.h"
-#include "olap/storage_engine.h"
 #include "olap/task/engine_checksum_task.h"
-#include "runtime/exec_env.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/checksum_action.h b/be/src/http/action/checksum_action.h
index 441c302cb1..5afacbfe6d 100644
--- a/be/src/http/action/checksum_action.h
+++ b/be/src/http/action/checksum_action.h
@@ -24,6 +24,7 @@
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 class ChecksumAction : public HttpHandler {
 public:
diff --git a/be/src/http/action/compaction_action.cpp b/be/src/http/action/compaction_action.cpp
index 86d2548946..96d450c599 100644
--- a/be/src/http/action/compaction_action.cpp
+++ b/be/src/http/action/compaction_action.cpp
@@ -17,11 +17,16 @@
 
 #include "http/action/compaction_action.h"
 
-#include <sys/syscall.h>
-
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <exception>
 #include <future>
+#include <memory>
+#include <mutex>
 #include <sstream>
 #include <string>
+#include <thread>
+#include <utility>
 
 #include "common/logging.h"
 #include "gutil/strings/substitute.h"
@@ -31,8 +36,12 @@
 #include "http/http_status.h"
 #include "olap/base_compaction.h"
 #include "olap/cumulative_compaction.h"
+#include "olap/cumulative_compaction_policy.h"
 #include "olap/olap_define.h"
 #include "olap/storage_engine.h"
+#include "olap/tablet_manager.h"
+#include "util/doris_metrics.h"
+#include "util/stopwatch.hpp"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/http/action/compaction_action.h b/be/src/http/action/compaction_action.h
index 6def386a44..8fc487d4a0 100644
--- a/be/src/http/action/compaction_action.h
+++ b/be/src/http/action/compaction_action.h
@@ -17,11 +17,16 @@
 
 #pragma once
 
+#include <stdint.h>
+
+#include <string>
+
 #include "common/status.h"
 #include "http/http_handler.h"
 #include "olap/tablet.h"
 
 namespace doris {
+class HttpRequest;
 
 enum class CompactionActionType {
     SHOW_INFO = 1,
diff --git a/be/src/http/action/config_action.cpp b/be/src/http/action/config_action.cpp
index 9c95276db3..60cc21e36b 100644
--- a/be/src/http/action/config_action.cpp
+++ b/be/src/http/action/config_action.cpp
@@ -18,11 +18,16 @@
 #include "http/action/config_action.h"
 
 #include <rapidjson/document.h>
+#include <rapidjson/encodings.h>
 #include <rapidjson/prettywriter.h>
-#include <rapidjson/rapidjson.h>
 #include <rapidjson/stringbuffer.h>
+#include <rapidjson/writer.h>
 
+#include <map>
+#include <ostream>
 #include <string>
+#include <utility>
+#include <vector>
 
 #include "common/configbase.h"
 #include "common/logging.h"
@@ -31,7 +36,6 @@
 #include "http/http_channel.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
 
 namespace doris {
diff --git a/be/src/http/action/config_action.h b/be/src/http/action/config_action.h
index ca20f3862f..7d9d3e7f2e 100644
--- a/be/src/http/action/config_action.h
+++ b/be/src/http/action/config_action.h
@@ -20,6 +20,7 @@
 #include "http/http_handler.h"
 
 namespace doris {
+class HttpRequest;
 
 enum ConfigActionType {
     UPDATE_CONFIG = 1,
diff --git a/be/src/http/action/download_action.cpp b/be/src/http/action/download_action.cpp
index e56b24c61f..074baf5ec1 100644
--- a/be/src/http/action/download_action.cpp
+++ b/be/src/http/action/download_action.cpp
@@ -17,21 +17,19 @@
 
 #include "http/action/download_action.h"
 
-#include <sys/types.h>
-#include <unistd.h>
-
+#include <algorithm>
+#include <memory>
 #include <sstream>
 #include <string>
+#include <utility>
 
+#include "common/config.h"
+#include "common/logging.h"
 #include "http/http_channel.h"
-#include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
-#include "http/http_status.h"
 #include "http/utils.h"
 #include "io/fs/local_file_system.h"
 #include "runtime/exec_env.h"
-#include "util/path_util.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/download_action.h b/be/src/http/action/download_action.h
index 944c422fc6..86bee3e2b1 100644
--- a/be/src/http/action/download_action.h
+++ b/be/src/http/action/download_action.h
@@ -17,6 +17,10 @@
 
 #pragma once
 
+#include <string>
+#include <vector>
+
+#include "common/status.h"
 #include "exec/scan_node.h"
 #include "http/http_handler.h"
 #include "runtime/descriptors.h"
@@ -24,6 +28,7 @@
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 // A simple handler that serves incoming HTTP requests of file-download to send their respective HTTP responses.
 //
diff --git a/be/src/http/action/health_action.cpp b/be/src/http/action/health_action.cpp
index 163c782b5f..ef937ab27c 100644
--- a/be/src/http/action/health_action.cpp
+++ b/be/src/http/action/health_action.cpp
@@ -23,7 +23,6 @@
 #include "http/http_channel.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
 
 namespace doris {
diff --git a/be/src/http/action/health_action.h b/be/src/http/action/health_action.h
index 68d46fa325..cdee0f12b4 100644
--- a/be/src/http/action/health_action.h
+++ b/be/src/http/action/health_action.h
@@ -22,6 +22,7 @@
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 // Get BE health state from http API.
 class HealthAction : public HttpHandler {
diff --git a/be/src/http/action/jeprofile_actions.cpp b/be/src/http/action/jeprofile_actions.cpp
index c014ef4eba..4faac5b51a 100644
--- a/be/src/http/action/jeprofile_actions.cpp
+++ b/be/src/http/action/jeprofile_actions.cpp
@@ -18,22 +18,25 @@
 #include "http/action/jeprofile_actions.h"
 
 #include <jemalloc/jemalloc.h>
+#include <stdlib.h>
+#include <unistd.h>
 
 #include <ctime>
 #include <fstream>
+#include <memory>
 #include <mutex>
-#include <sstream>
+#include <string>
 
 #include "common/config.h"
 #include "common/object_pool.h"
 #include "http/ev_http_server.h"
 #include "http/http_channel.h"
 #include "http/http_handler.h"
-#include "http/http_headers.h"
-#include "http/http_request.h"
+#include "http/http_method.h"
 #include "io/fs/local_file_system.h"
 
 namespace doris {
+class HttpRequest;
 
 static std::mutex kJeprofileActionMutex;
 class JeHeapAction : public HttpHandler {
diff --git a/be/src/http/action/meta_action.cpp b/be/src/http/action/meta_action.cpp
index bb8300c8d3..ede286e3d9 100644
--- a/be/src/http/action/meta_action.cpp
+++ b/be/src/http/action/meta_action.cpp
@@ -17,22 +17,27 @@
 
 #include "http/action/meta_action.h"
 
+#include <json2pb/pb_to_json.h>
+#include <stdint.h>
+
+#include <cstring>
+#include <exception>
+#include <memory>
+#include <shared_mutex>
 #include <sstream>
 #include <string>
 
 #include "common/logging.h"
-#include "gutil/strings/substitute.h"
 #include "http/http_channel.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
 #include "olap/olap_define.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet.h"
+#include "olap/tablet_manager.h"
 #include "olap/tablet_meta.h"
-#include "olap/tablet_meta_manager.h"
-#include "util/json_util.h"
+#include "util/easy_json.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/meta_action.h b/be/src/http/action/meta_action.h
index 2349d7ec22..c4809cd3b5 100644
--- a/be/src/http/action/meta_action.h
+++ b/be/src/http/action/meta_action.h
@@ -17,12 +17,15 @@
 
 #pragma once
 
+#include <string>
+
 #include "common/status.h"
 #include "http/http_handler.h"
 
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 // Get Meta Info
 class MetaAction : public HttpHandler {
diff --git a/be/src/http/action/metrics_action.cpp b/be/src/http/action/metrics_action.cpp
index f2bd8b43cb..d9df65928a 100644
--- a/be/src/http/action/metrics_action.cpp
+++ b/be/src/http/action/metrics_action.cpp
@@ -17,18 +17,11 @@
 
 #include "http/action/metrics_action.h"
 
-#include <rapidjson/document.h>
-#include <rapidjson/rapidjson.h>
-#include <rapidjson/stringbuffer.h>
-#include <rapidjson/writer.h>
-
 #include <string>
 
 #include "http/http_channel.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
-#include "runtime/exec_env.h"
 #include "util/metrics.h"
 
 namespace doris {
diff --git a/be/src/http/action/monitor_action.cpp b/be/src/http/action/monitor_action.cpp
index cf1604623e..22a1a89cd2 100644
--- a/be/src/http/action/monitor_action.cpp
+++ b/be/src/http/action/monitor_action.cpp
@@ -17,12 +17,13 @@
 
 #include "http/action/monitor_action.h"
 
+#include <glog/logging.h>
+
 #include <sstream>
+#include <utility>
 
-#include "common/status.h"
 #include "http/http_channel.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
 #include "http/rest_monitor_iface.h"
 
diff --git a/be/src/http/action/pad_rowset_action.cpp b/be/src/http/action/pad_rowset_action.cpp
index c353b4fad7..18e0b2568e 100644
--- a/be/src/http/action/pad_rowset_action.cpp
+++ b/be/src/http/action/pad_rowset_action.cpp
@@ -17,14 +17,27 @@
 
 #include "http/action/pad_rowset_action.h"
 
+#include <gen_cpp/olap_file.pb.h>
+#include <glog/logging.h>
+#include <stdint.h>
+
+#include <cstdlib>
 #include <memory>
 #include <mutex>
+#include <ostream>
+#include <string>
+#include <vector>
 
 #include "http/http_channel.h"
+#include "http/http_request.h"
+#include "http/http_status.h"
 #include "olap/olap_common.h"
-#include "olap/rowset/beta_rowset_writer.h"
 #include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_writer.h"
+#include "olap/rowset/rowset_writer_context.h"
 #include "olap/storage_engine.h"
+#include "olap/tablet_manager.h"
+#include "util/time.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/pad_rowset_action.h b/be/src/http/action/pad_rowset_action.h
index f6036dc9fa..13090dcd8c 100644
--- a/be/src/http/action/pad_rowset_action.h
+++ b/be/src/http/action/pad_rowset_action.h
@@ -23,6 +23,8 @@
 #include "olap/tablet.h"
 
 namespace doris {
+class HttpRequest;
+struct Version;
 
 class PadRowsetAction : public HttpHandler {
 public:
diff --git a/be/src/http/action/pprof_actions.cpp b/be/src/http/action/pprof_actions.cpp
index 0be0e2c708..7696078a4d 100644
--- a/be/src/http/action/pprof_actions.cpp
+++ b/be/src/http/action/pprof_actions.cpp
@@ -17,29 +17,23 @@
 
 #include "http/action/pprof_actions.h"
 
-#include <gperftools/heap-profiler.h>
-#include <gperftools/malloc_extension.h>
-#include <gperftools/profiler.h>
+#include <stdio.h>
 
 #include <fstream>
-#include <iostream>
+#include <memory>
 #include <mutex>
-#include <sstream>
+#include <string>
 
-#include "agent/utils.h"
 #include "common/config.h"
 #include "common/object_pool.h"
-#include "gutil/strings/substitute.h"
 #include "http/ev_http_server.h"
 #include "http/http_channel.h"
 #include "http/http_handler.h"
-#include "http/http_headers.h"
+#include "http/http_method.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "io/fs/local_file_system.h"
 #include "runtime/exec_env.h"
 #include "util/bfd_parser.h"
-#include "util/pprof_utils.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/reload_tablet_action.cpp b/be/src/http/action/reload_tablet_action.cpp
index ee4d6bd22f..30f65fccce 100644
--- a/be/src/http/action/reload_tablet_action.cpp
+++ b/be/src/http/action/reload_tablet_action.cpp
@@ -17,17 +17,18 @@
 
 #include "http/action/reload_tablet_action.h"
 
+#include <gen_cpp/AgentService_types.h>
+
+#include <boost/lexical_cast/bad_lexical_cast.hpp>
 #include <sstream>
 #include <string>
 
 #include "boost/lexical_cast.hpp"
 #include "common/logging.h"
+#include "common/status.h"
 #include "http/http_channel.h"
-#include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
-#include "olap/olap_define.h"
 #include "olap/storage_engine.h"
 #include "runtime/exec_env.h"
 
diff --git a/be/src/http/action/reload_tablet_action.h b/be/src/http/action/reload_tablet_action.h
index 5338131224..aa36a474dd 100644
--- a/be/src/http/action/reload_tablet_action.h
+++ b/be/src/http/action/reload_tablet_action.h
@@ -17,12 +17,17 @@
 
 #pragma once
 
-#include "gen_cpp/AgentService_types.h"
+#include <gen_cpp/AgentService_types.h>
+#include <stdint.h>
+
+#include <string>
+
 #include "http/http_handler.h"
 
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 class ReloadTabletAction : public HttpHandler {
 public:
diff --git a/be/src/http/action/reset_rpc_channel_action.cpp b/be/src/http/action/reset_rpc_channel_action.cpp
index 242bfe7a05..95f9ba9e7e 100644
--- a/be/src/http/action/reset_rpc_channel_action.cpp
+++ b/be/src/http/action/reset_rpc_channel_action.cpp
@@ -17,10 +17,16 @@
 
 #include "http/action/reset_rpc_channel_action.h"
 
-#include <fmt/core.h>
+#include <fmt/format.h>
+#include <glog/logging.h>
+
+#include <algorithm>
+#include <string>
+#include <vector>
 
 #include "http/http_channel.h"
 #include "http/http_request.h"
+#include "http/http_status.h"
 #include "runtime/exec_env.h"
 #include "util/brpc_client_cache.h"
 #include "util/string_util.h"
diff --git a/be/src/http/action/reset_rpc_channel_action.h b/be/src/http/action/reset_rpc_channel_action.h
index 912a324217..52df0d6817 100644
--- a/be/src/http/action/reset_rpc_channel_action.h
+++ b/be/src/http/action/reset_rpc_channel_action.h
@@ -21,6 +21,8 @@
 
 namespace doris {
 class ExecEnv;
+class HttpRequest;
+
 class ResetRPCChannelAction : public HttpHandler {
 public:
     explicit ResetRPCChannelAction(ExecEnv* exec_env);
diff --git a/be/src/http/action/restore_tablet_action.cpp b/be/src/http/action/restore_tablet_action.cpp
index 118008d160..d710a2b36b 100644
--- a/be/src/http/action/restore_tablet_action.cpp
+++ b/be/src/http/action/restore_tablet_action.cpp
@@ -17,24 +17,31 @@
 
 #include "http/action/restore_tablet_action.h"
 
-#include <unistd.h>
+#include <fmt/format.h>
+#include <gen_cpp/AgentService_types.h>
+#include <glog/logging.h>
 
+#include <cstdlib>
+#include <filesystem>
+#include <memory>
 #include <sstream>
 #include <string>
+#include <utility>
+#include <vector>
 
-#include "gutil/strings/substitute.h" // for Substitute
 #include "http/http_channel.h"
-#include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
+#include "io/fs/file_system.h"
+#include "io/fs/local_file_system.h"
+#include "io/fs/path.h"
 #include "olap/data_dir.h"
-#include "olap/olap_define.h"
 #include "olap/storage_engine.h"
+#include "olap/tablet.h"
+#include "olap/tablet_manager.h"
 #include "olap/tablet_meta.h"
 #include "olap/utils.h"
 #include "runtime/exec_env.h"
-#include "util/json_util.h"
 
 using std::filesystem::path;
 
diff --git a/be/src/http/action/restore_tablet_action.h b/be/src/http/action/restore_tablet_action.h
index 7cae5ff70a..a11d7783b7 100644
--- a/be/src/http/action/restore_tablet_action.h
+++ b/be/src/http/action/restore_tablet_action.h
@@ -17,16 +17,20 @@
 
 #pragma once
 
+#include <gen_cpp/AgentService_types.h>
+#include <stdint.h>
+
 #include <map>
 #include <mutex>
+#include <string>
 
 #include "common/status.h"
-#include "gen_cpp/AgentService_types.h"
 #include "http/http_handler.h"
 
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 class RestoreTabletAction : public HttpHandler {
 public:
diff --git a/be/src/http/action/snapshot_action.cpp b/be/src/http/action/snapshot_action.cpp
index 4862df5037..19e603fa34 100644
--- a/be/src/http/action/snapshot_action.cpp
+++ b/be/src/http/action/snapshot_action.cpp
@@ -17,21 +17,19 @@
 
 #include "http/action/snapshot_action.h"
 
+#include <gen_cpp/AgentService_types.h>
+
 #include <boost/lexical_cast.hpp>
+#include <boost/lexical_cast/bad_lexical_cast.hpp>
 #include <sstream>
 #include <string>
 
 #include "common/logging.h"
-#include "gen_cpp/AgentService_types.h"
+#include "common/status.h"
 #include "http/http_channel.h"
-#include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
-#include "olap/olap_define.h"
 #include "olap/snapshot_manager.h"
-#include "olap/storage_engine.h"
-#include "runtime/exec_env.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/snapshot_action.h b/be/src/http/action/snapshot_action.h
index 49285bb336..0d1399604d 100644
--- a/be/src/http/action/snapshot_action.h
+++ b/be/src/http/action/snapshot_action.h
@@ -25,6 +25,7 @@
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 // make snapshot
 // be_host:be_http_port/api/snapshot?tablet_id=123&schema_hash=456
diff --git a/be/src/http/action/stream_load.cpp b/be/src/http/action/stream_load.cpp
index 2520b3a5f4..925a8ad8e0 100644
--- a/be/src/http/action/stream_load.cpp
+++ b/be/src/http/action/stream_load.cpp
@@ -17,45 +17,49 @@
 
 #include "http/action/stream_load.h"
 
-#include <deque>
-#include <future>
-#include <sstream>
-
 // use string iequal
 #include <event2/buffer.h>
-#include <event2/bufferevent.h>
 #include <event2/http.h>
-#include <rapidjson/prettywriter.h>
+#include <gen_cpp/FrontendService.h>
+#include <gen_cpp/FrontendService_types.h>
+#include <gen_cpp/HeartbeatService_types.h>
+#include <gen_cpp/PaloInternalService_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <sys/time.h>
 #include <thrift/protocol/TDebugProtocol.h>
+#include <time.h>
+
+#include <future>
+#include <map>
+#include <sstream>
+#include <stdexcept>
+#include <utility>
 
 #include "common/config.h"
 #include "common/consts.h"
 #include "common/logging.h"
+#include "common/status.h"
 #include "common/utils.h"
-#include "gen_cpp/FrontendService.h"
-#include "gen_cpp/FrontendService_types.h"
-#include "gen_cpp/HeartbeatService_types.h"
 #include "http/http_channel.h"
 #include "http/http_common.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/utils.h"
 #include "io/fs/stream_load_pipe.h"
 #include "olap/storage_engine.h"
 #include "runtime/client_cache.h"
 #include "runtime/exec_env.h"
-#include "runtime/fragment_mgr.h"
 #include "runtime/load_path_mgr.h"
-#include "runtime/plan_fragment_executor.h"
+#include "runtime/message_body_sink.h"
 #include "runtime/stream_load/new_load_stream_mgr.h"
 #include "runtime/stream_load/stream_load_context.h"
 #include "runtime/stream_load/stream_load_executor.h"
 #include "runtime/stream_load/stream_load_recorder.h"
 #include "util/byte_buffer.h"
-#include "util/debug_util.h"
 #include "util/doris_metrics.h"
-#include "util/json_util.h"
 #include "util/metrics.h"
 #include "util/string_util.h"
 #include "util/thrift_rpc_helper.h"
diff --git a/be/src/http/action/stream_load.h b/be/src/http/action/stream_load.h
index 2dc3c762ad..3c44a77bb4 100644
--- a/be/src/http/action/stream_load.h
+++ b/be/src/http/action/stream_load.h
@@ -17,18 +17,23 @@
 
 #pragma once
 
+#include <gen_cpp/PlanNodes_types.h>
+
 #include <functional>
+#include <memory>
+#include <string>
 
-#include "gen_cpp/PlanNodes_types.h"
 #include "http/http_handler.h"
 #include "runtime/client_cache.h"
 #include "runtime/message_body_sink.h"
+#include "util/metrics.h"
 
 namespace doris {
 
 class ExecEnv;
 class Status;
 class StreamLoadContext;
+class HttpRequest;
 
 class StreamLoadAction : public HttpHandler {
 public:
diff --git a/be/src/http/action/stream_load_2pc.cpp b/be/src/http/action/stream_load_2pc.cpp
index 3a5690cb8f..ce3a8961b2 100644
--- a/be/src/http/action/stream_load_2pc.cpp
+++ b/be/src/http/action/stream_load_2pc.cpp
@@ -17,18 +17,25 @@
 
 #include "http/action/stream_load_2pc.h"
 
+#include <glog/logging.h>
+#include <rapidjson/encodings.h>
 #include <rapidjson/prettywriter.h>
 #include <rapidjson/stringbuffer.h>
 
+#include <exception>
+#include <memory>
+#include <new>
+#include <ostream>
+
 #include "common/status.h"
 #include "http/http_channel.h"
-#include "http/http_headers.h"
+#include "http/http_common.h"
 #include "http/http_request.h"
 #include "http/http_status.h"
 #include "http/utils.h"
+#include "runtime/exec_env.h"
 #include "runtime/stream_load/stream_load_context.h"
 #include "runtime/stream_load/stream_load_executor.h"
-#include "util/json_util.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/stream_load_2pc.h b/be/src/http/action/stream_load_2pc.h
index 1a1013a12b..fdf39873e2 100644
--- a/be/src/http/action/stream_load_2pc.h
+++ b/be/src/http/action/stream_load_2pc.h
@@ -24,6 +24,7 @@
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 class StreamLoad2PCAction : public HttpHandler {
 public:
diff --git a/be/src/http/action/tablet_migration_action.cpp b/be/src/http/action/tablet_migration_action.cpp
index 6cb05d13a0..3f0fbed297 100644
--- a/be/src/http/action/tablet_migration_action.cpp
+++ b/be/src/http/action/tablet_migration_action.cpp
@@ -17,17 +17,20 @@
 
 #include "http/action/tablet_migration_action.h"
 
+#include <glog/logging.h>
+
+#include <exception>
 #include <string>
 
-#include "gutil/strings/substitute.h"
+#include "common/config.h"
 #include "http/http_channel.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
 #include "http/http_status.h"
+#include "olap/data_dir.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet_manager.h"
 #include "olap/task/engine_storage_migration_task.h"
-#include "util/json_util.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/tablet_migration_action.h b/be/src/http/action/tablet_migration_action.h
index 4e5a92b877..aee9a65d12 100644
--- a/be/src/http/action/tablet_migration_action.h
+++ b/be/src/http/action/tablet_migration_action.h
@@ -17,16 +17,28 @@
 
 #pragma once
 
+#include <gen_cpp/Status_types.h>
+#include <stdint.h>
+
+#include <deque>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <ostream>
 #include <string>
+#include <utility>
 
 #include "common/status.h"
-#include "gen_cpp/Status_types.h"
+#include "gutil/stringprintf.h"
+#include "gutil/strings/numbers.h"
 #include "http/http_handler.h"
 #include "olap/data_dir.h"
 #include "olap/tablet.h"
 #include "util/threadpool.h"
 
 namespace doris {
+class DataDir;
+class HttpRequest;
 
 // Migrate a tablet from a disk to another.
 class TabletMigrationAction : public HttpHandler {
diff --git a/be/src/http/action/tablets_distribution_action.cpp b/be/src/http/action/tablets_distribution_action.cpp
index 6bb7b5ab6f..605f900b17 100644
--- a/be/src/http/action/tablets_distribution_action.cpp
+++ b/be/src/http/action/tablets_distribution_action.cpp
@@ -17,7 +17,14 @@
 
 #include "http/action/tablets_distribution_action.h"
 
+#include <glog/logging.h>
+
+#include <exception>
+#include <map>
+#include <ostream>
 #include <string>
+#include <utility>
+#include <vector>
 
 #include "common/status.h"
 #include "gutil/strings/substitute.h"
@@ -25,10 +32,11 @@
 #include "http/http_headers.h"
 #include "http/http_request.h"
 #include "http/http_status.h"
+#include "olap/data_dir.h"
+#include "olap/olap_common.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet_manager.h"
 #include "service/backend_options.h"
-#include "util/json_util.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/tablets_distribution_action.h b/be/src/http/action/tablets_distribution_action.h
index 218882d6c2..0e400f9feb 100644
--- a/be/src/http/action/tablets_distribution_action.h
+++ b/be/src/http/action/tablets_distribution_action.h
@@ -17,12 +17,15 @@
 
 #pragma once
 
+#include <stdint.h>
+
 #include <string>
 
 #include "http/http_handler.h"
 #include "util/easy_json.h"
 
 namespace doris {
+class HttpRequest;
 
 // Get BE tablets distribution info from http API.
 class TabletsDistributionAction : public HttpHandler {
diff --git a/be/src/http/action/tablets_info_action.cpp b/be/src/http/action/tablets_info_action.cpp
index 56ccbc09a8..656fbdf158 100644
--- a/be/src/http/action/tablets_info_action.cpp
+++ b/be/src/http/action/tablets_info_action.cpp
@@ -17,12 +17,21 @@
 
 #include "http/action/tablets_info_action.h"
 
+#include <ctype.h>
+
+#include <algorithm>
+#include <cstdint>
+#include <cstdlib>
+#include <limits>
 #include <string>
+#include <vector>
 
+#include "gutil/strings/numbers.h"
 #include "http/http_channel.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
 #include "http/http_status.h"
+#include "olap/olap_common.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet_manager.h"
 #include "service/backend_options.h"
diff --git a/be/src/http/action/tablets_info_action.h b/be/src/http/action/tablets_info_action.h
index f21045bfae..22f8634faf 100644
--- a/be/src/http/action/tablets_info_action.h
+++ b/be/src/http/action/tablets_info_action.h
@@ -23,6 +23,7 @@
 #include "util/easy_json.h"
 
 namespace doris {
+class HttpRequest;
 
 // Get BE tablets info from http API.
 class TabletsInfoAction : public HttpHandler {
diff --git a/be/src/http/action/version_action.cpp b/be/src/http/action/version_action.cpp
index c9cb908522..18b05ed3c4 100644
--- a/be/src/http/action/version_action.cpp
+++ b/be/src/http/action/version_action.cpp
@@ -17,14 +17,13 @@
 
 #include "http/action/version_action.h"
 
-#include <sstream>
+#include <gen_cpp/version.h>
+
 #include <string>
 
-#include "gen_cpp/version.h"
 #include "http/http_channel.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
 #include "util/easy_json.h"
 
diff --git a/be/src/http/action/version_action.h b/be/src/http/action/version_action.h
index 7695ad9fe4..e78e19f37c 100644
--- a/be/src/http/action/version_action.h
+++ b/be/src/http/action/version_action.h
@@ -23,6 +23,7 @@
 namespace doris {
 
 class ExecEnv;
+class HttpRequest;
 
 // Get BE version info from http API.
 class VersionAction : public HttpHandler {
diff --git a/be/src/http/default_path_handlers.cpp b/be/src/http/default_path_handlers.cpp
index b4c837f3d8..539268f693 100644
--- a/be/src/http/default_path_handlers.cpp
+++ b/be/src/http/default_path_handlers.cpp
@@ -17,24 +17,32 @@
 
 #include "http/default_path_handlers.h"
 
-#include <gperftools/heap-profiler.h>
+#include <gen_cpp/Metrics_types.h>
+
+#include <boost/algorithm/string/replace.hpp>
 #ifdef USE_JEMALLOC
 #include "jemalloc/jemalloc.h"
 #else
 #include <gperftools/malloc_extension.h>
 #endif
 
-#include <boost/algorithm/string.hpp>
+#include <functional>
+#include <map>
+#include <memory>
+#include <mutex>
 #include <sstream>
+#include <string>
+#include <utility>
+#include <vector>
 
-#include "agent/utils.h"
-#include "common/configbase.h"
+#include "common/config.h"
 #include "gutil/strings/numbers.h"
 #include "gutil/strings/substitute.h"
 #include "http/action/tablets_info_action.h"
 #include "http/web_page_handler.h"
+#include "runtime/memory/mem_tracker.h"
 #include "runtime/memory/mem_tracker_limiter.h"
-#include "util/debug_util.h"
+#include "util/easy_json.h"
 #include "util/mem_info.h"
 #include "util/perf_counters.h"
 #include "util/pretty_printer.h"
diff --git a/be/src/http/ev_http_server.cpp b/be/src/http/ev_http_server.cpp
index bef87541a3..ccea181a8f 100644
--- a/be/src/http/ev_http_server.cpp
+++ b/be/src/http/ev_http_server.cpp
@@ -17,14 +17,20 @@
 
 #include "http/ev_http_server.h"
 
-#include <event2/buffer.h>
-#include <event2/bufferevent.h>
+#include <arpa/inet.h>
+#include <bthread/errno.h>
+#include <butil/endpoint.h>
+#include <butil/fd_utility.h>
 #include <event2/event.h>
 #include <event2/http.h>
 #include <event2/http_struct.h>
-#include <event2/keyvalq_struct.h>
 #include <event2/thread.h>
+#include <netinet/in.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
 
+#include <algorithm>
 #include <memory>
 #include <sstream>
 
@@ -33,12 +39,13 @@
 #include "http/http_handler.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
-#include "runtime/thread_context.h"
+#include "http/http_status.h"
 #include "service/backend_options.h"
-#include "service/brpc.h"
-#include "util/debug_util.h"
 #include "util/threadpool.h"
 
+struct event_base;
+struct evhttp;
+
 namespace doris {
 
 static void on_chunked(struct evhttp_request* ev_req, void* param) {
diff --git a/be/src/http/ev_http_server.h b/be/src/http/ev_http_server.h
index 7263b2f3ef..5ba634b219 100644
--- a/be/src/http/ev_http_server.h
+++ b/be/src/http/ev_http_server.h
@@ -17,6 +17,7 @@
 
 #pragma once
 
+#include <memory>
 #include <mutex>
 #include <string>
 #include <thread>
@@ -26,6 +27,8 @@
 #include "http/http_method.h"
 #include "util/path_trie.hpp"
 
+struct event_base;
+
 namespace doris {
 
 class HttpHandler;
diff --git a/be/src/http/http_channel.cpp b/be/src/http/http_channel.cpp
index 4a06a4e7f5..5727ba3902 100644
--- a/be/src/http/http_channel.cpp
+++ b/be/src/http/http_channel.cpp
@@ -20,16 +20,19 @@
 #include <event2/buffer.h>
 #include <event2/http.h>
 
-#include <mutex>
+#include <algorithm>
 #include <sstream>
 #include <string>
+#include <vector>
 
 #include "common/logging.h"
+#include "common/status.h"
 #include "gutil/strings/split.h"
+#include "gutil/strings/strip.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
+#include "util/slice.h"
 #include "util/zlib.h"
 
 namespace doris {
diff --git a/be/src/http/http_channel.h b/be/src/http/http_channel.h
index 83b696a409..a12eddb535 100644
--- a/be/src/http/http_channel.h
+++ b/be/src/http/http_channel.h
@@ -17,6 +17,8 @@
 
 #pragma once
 
+#include <stddef.h>
+
 #include <cstdint>
 #include <string>
 
diff --git a/be/src/http/http_client.cpp b/be/src/http/http_client.cpp
index 0cb5b97ec4..0919d21d38 100644
--- a/be/src/http/http_client.cpp
+++ b/be/src/http/http_client.cpp
@@ -17,6 +17,12 @@
 
 #include "http/http_client.h"
 
+#include <glog/logging.h>
+#include <unistd.h>
+
+#include <memory>
+#include <ostream>
+
 #include "common/config.h"
 #include "util/stack_util.h"
 
diff --git a/be/src/http/http_client.h b/be/src/http/http_client.h
index b9605afb0f..7ec714587a 100644
--- a/be/src/http/http_client.h
+++ b/be/src/http/http_client.h
@@ -18,8 +18,11 @@
 #pragma once
 
 #include <curl/curl.h>
+#include <curl/system.h>
+#include <stdint.h>
 
 #include <cstdio>
+#include <functional>
 #include <string>
 
 #include "common/status.h"
diff --git a/be/src/http/http_method.cpp b/be/src/http/http_method.cpp
index c7a95905b1..9986f3c653 100644
--- a/be/src/http/http_method.cpp
+++ b/be/src/http/http_method.cpp
@@ -19,6 +19,7 @@
 
 #include <map>
 #include <string>
+#include <utility>
 
 namespace doris {
 
diff --git a/be/src/http/http_request.cpp b/be/src/http/http_request.cpp
index c3228f7a58..14bde591b4 100644
--- a/be/src/http/http_request.cpp
+++ b/be/src/http/http_request.cpp
@@ -18,19 +18,16 @@
 #include "http/http_request.h"
 
 #include <event2/buffer.h>
-#include <event2/bufferevent.h>
 #include <event2/http.h>
 #include <event2/http_struct.h>
 #include <event2/keyvalq_struct.h>
 
-#include <boost/algorithm/string.hpp>
 #include <sstream>
 #include <string>
-#include <vector>
+#include <unordered_map>
+#include <utility>
 
-#include "common/logging.h"
 #include "http/http_handler.h"
-#include "util/url_coding.h"
 
 namespace doris {
 
diff --git a/be/src/http/http_status.cpp b/be/src/http/http_status.cpp
index 415be0b835..b716ff269f 100644
--- a/be/src/http/http_status.cpp
+++ b/be/src/http/http_status.cpp
@@ -19,6 +19,7 @@
 
 #include <map>
 #include <string>
+#include <utility>
 
 namespace doris {
 
diff --git a/be/src/http/utils.cpp b/be/src/http/utils.cpp
index ec793b9c30..fe11738d5a 100644
--- a/be/src/http/utils.cpp
+++ b/be/src/http/utils.cpp
@@ -18,15 +18,23 @@
 #include "http/utils.h"
 
 #include <fcntl.h>
+#include <stdint.h>
 #include <sys/stat.h>
+#include <unistd.h>
+
+#include <memory>
+#include <ostream>
+#include <vector>
 
 #include "common/logging.h"
 #include "common/status.h"
 #include "common/utils.h"
 #include "http/http_channel.h"
-#include "http/http_common.h"
 #include "http/http_headers.h"
+#include "http/http_method.h"
 #include "http/http_request.h"
+#include "http/http_status.h"
+#include "io/fs/file_system.h"
 #include "io/fs/local_file_system.h"
 #include "util/path_util.h"
 #include "util/url_coding.h"
diff --git a/be/src/http/utils.h b/be/src/http/utils.h
index a120c67cbf..f9b09b3017 100644
--- a/be/src/http/utils.h
+++ b/be/src/http/utils.h
@@ -26,6 +26,7 @@
 namespace doris {
 
 class HttpRequest;
+struct AuthInfo;
 
 std::string encode_basic_auth(const std::string& user, const std::string& passwd);
 // parse Basic authorization
diff --git a/be/src/http/web_page_handler.cpp b/be/src/http/web_page_handler.cpp
index 20e6a00185..c6def7ff0f 100644
--- a/be/src/http/web_page_handler.cpp
+++ b/be/src/http/web_page_handler.cpp
@@ -17,22 +17,28 @@
 
 #include "http/web_page_handler.h"
 
+#include <stdlib.h>
+
 #include <functional>
+#include <memory>
 
-#include "common/config.h"
+#include "common/logging.h"
+#include "common/status.h"
 #include "gutil/stl_util.h"
+#include "gutil/strings/numbers.h"
 #include "gutil/strings/substitute.h"
 #include "http/ev_http_server.h"
 #include "http/http_channel.h"
 #include "http/http_headers.h"
+#include "http/http_method.h"
 #include "http/http_request.h"
-#include "http/http_response.h"
 #include "http/http_status.h"
 #include "http/utils.h"
 #include "io/fs/local_file_system.h"
 #include "util/cpu_info.h"
 #include "util/debug_util.h"
 #include "util/disk_info.h"
+#include "util/easy_json.h"
 #include "util/mem_info.h"
 #include "util/mustache/mustache.h"
 
diff --git a/be/src/http/web_page_handler.h b/be/src/http/web_page_handler.h
index e55197a716..9ab304d96f 100644
--- a/be/src/http/web_page_handler.h
+++ b/be/src/http/web_page_handler.h
@@ -22,6 +22,7 @@
 #include <mutex>
 #include <sstream>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "http/http_handler.h"
@@ -30,6 +31,8 @@
 namespace doris {
 
 class EvHttpServer;
+class EasyJson;
+class HttpRequest;
 
 // This a handler for webpage request
 // and this handler manage all the page handler
diff --git a/be/src/io/fs/file_reader_writer_fwd.h b/be/src/io/fs/file_reader_writer_fwd.h
index a0e3078095..e63c5395de 100644
--- a/be/src/io/fs/file_reader_writer_fwd.h
+++ b/be/src/io/fs/file_reader_writer_fwd.h
@@ -19,6 +19,9 @@
 // and modified by Doris
 
 #pragma once
+
+#include <memory>
+
 namespace doris {
 namespace io {
 
diff --git a/be/src/io/fs/hdfs.h b/be/src/io/fs/hdfs.h
index eb9e1b2c07..c260ff9dea 100644
--- a/be/src/io/fs/hdfs.h
+++ b/be/src/io/fs/hdfs.h
@@ -18,7 +18,7 @@
 #pragma once
 
 #ifdef USE_HADOOP_HDFS
-#include <hadoop_hdfs/hdfs.h>
+#include <hadoop_hdfs/hdfs.h> // IWYU pragma: export
 #else
-#include <hdfs/hdfs.h>
+#include <hdfs/hdfs.h> // IWYU pragma: export
 #endif
diff --git a/be/src/io/fs/hdfs_file_reader.h b/be/src/io/fs/hdfs_file_reader.h
index 2b10baa602..cfb53eae39 100644
--- a/be/src/io/fs/hdfs_file_reader.h
+++ b/be/src/io/fs/hdfs_file_reader.h
@@ -17,11 +17,23 @@
 
 #pragma once
 
+#include <stddef.h>
+
+#include <atomic>
+#include <memory>
+#include <string>
+
+#include "common/status.h"
 #include "io/fs/file_reader.h"
+#include "io/fs/file_system.h"
+#include "io/fs/hdfs.h"
 #include "io/fs/hdfs_file_system.h"
+#include "io/fs/path.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 class HdfsFileReader : public FileReader {
 public:
diff --git a/be/src/io/fs/hdfs_file_writer.h b/be/src/io/fs/hdfs_file_writer.h
index 92130a93c2..c9b3ff9def 100644
--- a/be/src/io/fs/hdfs_file_writer.h
+++ b/be/src/io/fs/hdfs_file_writer.h
@@ -17,18 +17,25 @@
 
 #pragma once
 
+#include <stddef.h>
+
 #include <map>
 #include <string>
 
+#include "common/status.h"
 #include "gen_cpp/PlanNodes_types.h"
+#include "io/fs/file_system.h"
 #include "io/fs/file_writer.h"
+#include "io/fs/hdfs.h"
 #include "io/fs/path.h"
 #include "io/hdfs_builder.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
 
 class HdfsFileSystem;
+
 class HdfsFileWriter : public FileWriter {
 public:
     HdfsFileWriter(Path file, FileSystemSPtr fs);
diff --git a/be/src/service/backend_options.cpp b/be/src/service/backend_options.cpp
index bad73b0c82..3b1652ef43 100644
--- a/be/src/service/backend_options.cpp
+++ b/be/src/service/backend_options.cpp
@@ -18,6 +18,7 @@
 #include "service/backend_options.h"
 
 #include <algorithm>
+#include <ostream>
 
 #include "common/config.h"
 #include "common/logging.h"
diff --git a/be/src/service/backend_options.h b/be/src/service/backend_options.h
index 5d28edbf12..87ca36b17a 100644
--- a/be/src/service/backend_options.h
+++ b/be/src/service/backend_options.h
@@ -17,6 +17,7 @@
 
 #pragma once
 
+#include <butil/macros.h>
 #include <gutil/macros.h>
 
 #include <string>
diff --git a/be/src/service/backend_service.cpp b/be/src/service/backend_service.cpp
index 3ec71b8b37..977d9cfc02 100644
--- a/be/src/service/backend_service.cpp
+++ b/be/src/service/backend_service.cpp
@@ -18,43 +18,53 @@
 #include "service/backend_service.h"
 
 #include <arrow/record_batch.h>
-#include <gperftools/heap-profiler.h>
+#include <fmt/format.h>
+#include <gen_cpp/BackendService.h>
+#include <gen_cpp/BackendService_types.h>
+#include <gen_cpp/Data_types.h>
+#include <gen_cpp/DorisExternalService_types.h>
+#include <gen_cpp/PaloInternalService_types.h>
+#include <gen_cpp/Planner_types.h>
+#include <gen_cpp/Status_types.h>
+#include <gen_cpp/Types_types.h>
+#include <sys/types.h>
 #include <thrift/concurrency/ThreadFactory.h>
-#include <thrift/processor/TMultiplexedProcessor.h>
-#include <thrift/protocol/TDebugProtocol.h>
+#include <time.h>
 
 #include <map>
 #include <memory>
+#include <ostream>
+#include <utility>
 
 #include "common/config.h"
 #include "common/logging.h"
 #include "common/status.h"
-#include "gen_cpp/DorisExternalService_types.h"
-#include "gen_cpp/PaloInternalService_types.h"
-#include "gen_cpp/TDorisExternalService.h"
-#include "gen_cpp/Types_types.h"
 #include "gutil/strings/substitute.h"
+#include "olap/olap_common.h"
+#include "olap/olap_define.h"
 #include "olap/storage_engine.h"
-#include "runtime/descriptors.h"
+#include "olap/tablet_manager.h"
 #include "runtime/exec_env.h"
-#include "runtime/export_task_mgr.h"
 #include "runtime/external_scan_context_mgr.h"
 #include "runtime/fragment_mgr.h"
-#include "runtime/primitive_type.h"
-#include "runtime/result_buffer_mgr.h"
 #include "runtime/result_queue_mgr.h"
 #include "runtime/routine_load/routine_load_task_executor.h"
 #include "runtime/stream_load/stream_load_context.h"
-#include "service/backend_options.h"
+#include "runtime/stream_load/stream_load_recorder.h"
 #include "util/arrow/row_batch.h"
-#include "util/blocking_queue.hpp"
-#include "util/debug_util.h"
-#include "util/doris_metrics.h"
-#include "util/network_util.h"
 #include "util/thrift_server.h"
-#include "util/thrift_util.h"
 #include "util/uid_util.h"
-#include "util/url_coding.h"
+
+namespace apache {
+namespace thrift {
+class TException;
+class TMultiplexedProcessor;
+class TProcessor;
+namespace transport {
+class TTransportException;
+} // namespace transport
+} // namespace thrift
+} // namespace apache
 
 namespace doris {
 
diff --git a/be/src/service/backend_service.h b/be/src/service/backend_service.h
index 64a06e34ec..35a9ba8abc 100644
--- a/be/src/service/backend_service.h
+++ b/be/src/service/backend_service.h
@@ -17,17 +17,20 @@
 
 #pragma once
 
+#include <gen_cpp/BackendService.h>
+#include <gen_cpp/DorisExternalService_types.h>
+#include <gen_cpp/TDorisExternalService.h>
+#include <stdint.h>
 #include <thrift/protocol/TDebugProtocol.h>
 #include <time.h>
 
 #include <map>
 #include <memory>
+#include <string>
+#include <vector>
 
 #include "agent/agent_server.h"
 #include "common/status.h"
-#include "gen_cpp/BackendService.h"
-#include "gen_cpp/DorisExternalService_types.h"
-#include "gen_cpp/TDorisExternalService.h"
 
 namespace doris {
 
@@ -57,6 +60,20 @@ class TExportTaskRequest;
 class TExportStatusResult;
 class TStreamLoadRecordResult;
 class TDiskTrashInfo;
+class TCancelPlanFragmentParams;
+class TCheckStorageFormatResult;
+class TRoutineLoadTask;
+class TScanBatchResult;
+class TScanCloseParams;
+class TScanCloseResult;
+class TScanNextBatchParams;
+class TScanOpenParams;
+class TScanOpenResult;
+class TSnapshotRequest;
+class TStatus;
+class TTabletStatResult;
+class TTransmitDataParams;
+class TUniqueId;
 
 // This class just forward rpc for actual handler
 // make this class because we can bind multiple service on single point
diff --git a/be/src/service/brpc_service.cpp b/be/src/service/brpc_service.cpp
index e606fd8c85..35989f29dc 100644
--- a/be/src/service/brpc_service.cpp
+++ b/be/src/service/brpc_service.cpp
@@ -17,11 +17,18 @@
 
 #include "service/brpc_service.h"
 
+#include <brpc/server.h>
+#include <brpc/ssl_options.h>
+#include <bthread/errno.h>
+#include <butil/endpoint.h>
+#include <gflags/gflags_declare.h>
 #include <string.h>
 
+#include <ostream>
+
+#include "common/config.h"
 #include "common/logging.h"
 #include "service/backend_options.h"
-#include "service/brpc.h"
 #include "service/internal_service.h"
 
 namespace brpc {
diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp
index b3fd6e07ac..ab91661b5f 100644
--- a/be/src/service/doris_main.cpp
+++ b/be/src/service/doris_main.cpp
@@ -15,18 +15,28 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <bthread/errno.h>
+#include <butil/macros.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <libgen.h>
 #include <setjmp.h>
-#include <sys/file.h>
+#include <signal.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 
-#include <condition_variable>
+#include <algorithm>
 #include <cstring>
-#include <mutex>
-#include <thread>
-#include <unordered_map>
-
+#include <ostream>
+#include <string>
+#include <tuple>
+#include <vector>
+
+#include "olap/tablet_schema_cache.h"
+#include "olap/utils.h"
+#include "runtime/memory/mem_tracker_limiter.h"
 #include "util/jni-util.h"
 
 #if defined(LEAK_SANITIZER)
@@ -34,39 +44,35 @@
 #endif
 
 #include <curl/curl.h>
-#include <gperftools/profiler.h>
 #include <thrift/TOutput.h>
 
 #include "agent/heartbeat_server.h"
-#include "agent/topic_subscriber.h"
 #include "common/config.h"
 #include "common/daemon.h"
 #include "common/logging.h"
 #include "common/resource_tls.h"
 #include "common/signal_handler.h"
 #include "common/status.h"
-#include "common/utils.h"
 #include "io/cache/block/block_file_cache_factory.h"
 #include "olap/options.h"
 #include "olap/storage_engine.h"
 #include "runtime/exec_env.h"
-#include "runtime/heartbeat_flags.h"
 #include "service/backend_options.h"
 #include "service/backend_service.h"
 #include "service/brpc_service.h"
 #include "service/http_service.h"
 #include "service/single_replica_load_download_service.h"
 #include "util/debug_util.h"
-#include "util/doris_metrics.h"
-#include "util/perf_counters.h"
 #include "util/telemetry/telemetry.h"
 #include "util/thrift_rpc_helper.h"
 #include "util/thrift_server.h"
 #include "util/uid_util.h"
 
-static void help(const char*);
+namespace doris {
+class TMasterInfo;
+} // namespace doris
 
-#include <dlfcn.h>
+static void help(const char*);
 
 extern "C" {
 void __lsan_do_leak_check();
diff --git a/be/src/service/http_service.cpp b/be/src/service/http_service.cpp
index 3280ac0e6f..91e2a85044 100644
--- a/be/src/service/http_service.cpp
+++ b/be/src/service/http_service.cpp
@@ -17,6 +17,10 @@
 
 #include "service/http_service.h"
 
+#include <algorithm>
+#include <string>
+#include <vector>
+
 #include "http/action/check_rpc_channel_action.h"
 #include "http/action/check_tablet_segment_action.h"
 #include "http/action/checksum_action.h"
@@ -43,6 +47,7 @@
 #include "http/ev_http_server.h"
 #include "http/http_method.h"
 #include "http/web_page_handler.h"
+#include "olap/options.h"
 #include "runtime/exec_env.h"
 #include "runtime/load_path_mgr.h"
 #include "util/doris_metrics.h"
diff --git a/be/src/service/internal_service.cpp b/be/src/service/internal_service.cpp
index 4a337f0f1e..1cf6323587 100644
--- a/be/src/service/internal_service.cpp
+++ b/be/src/service/internal_service.cpp
@@ -17,54 +17,92 @@
 
 #include "service/internal_service.h"
 
+#include <assert.h>
+#include <brpc/closure_guard.h>
+#include <brpc/controller.h>
+#include <bthread/bthread.h>
+#include <bthread/types.h>
+#include <butil/errno.h>
 #include <butil/iobuf.h>
+#include <fcntl.h>
+#include <gen_cpp/PaloInternalService_types.h>
+#include <gen_cpp/PlanNodes_types.h>
 #include <gen_cpp/Status_types.h>
+#include <gen_cpp/Types_types.h>
+#include <gen_cpp/internal_service.pb.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <gen_cpp/types.pb.h>
+#include <google/protobuf/stubs/callback.h>
+#include <stddef.h>
 #include <stdint.h>
+#include <sys/stat.h>
 
 #include <algorithm>
+#include <filesystem>
+#include <memory>
 #include <set>
 #include <sstream>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "common/config.h"
-#include "common/consts.h"
-#include "gen_cpp/BackendService.h"
-#include "gen_cpp/PaloInternalService_types.h"
-#include "gen_cpp/internal_service.pb.h"
+#include "common/logging.h"
+#include "gutil/integral_types.h"
 #include "http/http_client.h"
+#include "io/fs/stream_load_pipe.h"
+#include "io/io_common.h"
+#include "olap/data_dir.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/beta_rowset.h"
+#include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_factory.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/rowset/segment_v2/column_reader.h"
+#include "olap/rowset/segment_v2/common.h"
+#include "olap/rowset/segment_v2/segment.h"
 #include "olap/segment_loader.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet.h"
+#include "olap/tablet_manager.h"
 #include "olap/tablet_schema.h"
+#include "olap/txn_manager.h"
+#include "olap/utils.h"
 #include "runtime/buffer_control_block.h"
+#include "runtime/cache/result_cache.h"
+#include "runtime/define_primitive_type.h"
+#include "runtime/descriptors.h"
 #include "runtime/exec_env.h"
 #include "runtime/fold_constant_executor.h"
 #include "runtime/fragment_mgr.h"
 #include "runtime/load_channel_mgr.h"
 #include "runtime/result_buffer_mgr.h"
 #include "runtime/routine_load/routine_load_task_executor.h"
-#include "runtime/runtime_state.h"
+#include "runtime/stream_load/new_load_stream_mgr.h"
+#include "runtime/stream_load/stream_load_context.h"
 #include "runtime/thread_context.h"
-#include "service/brpc.h"
+#include "runtime/types.h"
 #include "service/point_query_executor.h"
 #include "util/async_io.h"
 #include "util/brpc_client_cache.h"
-#include "util/defer_op.h"
+#include "util/doris_metrics.h"
 #include "util/md5.h"
+#include "util/metrics.h"
 #include "util/proto_util.h"
 #include "util/ref_count_closure.h"
-#include "util/s3_uri.h"
+#include "util/runtime_profile.h"
+#include "util/stopwatch.hpp"
 #include "util/string_util.h"
 #include "util/telemetry/brpc_carrier.h"
 #include "util/telemetry/telemetry.h"
 #include "util/thrift_util.h"
+#include "util/time.h"
 #include "util/uid_util.h"
+#include "vec/columns/column.h"
 #include "vec/core/block.h"
-#include "vec/data_types/data_type_string.h"
+#include "vec/core/column_with_type_and_name.h"
+#include "vec/data_types/data_type.h"
 #include "vec/exec/format/csv/csv_reader.h"
 #include "vec/exec/format/generic_reader.h"
 #include "vec/exec/format/json/new_json_reader.h"
@@ -72,6 +110,12 @@
 #include "vec/exec/format/parquet/vparquet_reader.h"
 #include "vec/runtime/vdata_stream_mgr.h"
 
+namespace google {
+namespace protobuf {
+class RpcController;
+} // namespace protobuf
+} // namespace google
+
 namespace doris {
 using namespace ErrorCode;
 
diff --git a/be/src/service/internal_service.h b/be/src/service/internal_service.h
index 2730839ffb..1b1e56d0cf 100644
--- a/be/src/service/internal_service.h
+++ b/be/src/service/internal_service.h
@@ -17,11 +17,22 @@
 
 #pragma once
 
+#include <gen_cpp/internal_service.pb.h>
+#include <stdint.h>
+
+#include <string>
+
 #include "common/status.h"
-#include "gen_cpp/internal_service.pb.h"
 #include "runtime/cache/result_cache.h"
 #include "util/priority_thread_pool.hpp"
 
+namespace google {
+namespace protobuf {
+class Closure;
+class RpcController;
+} // namespace protobuf
+} // namespace google
+
 namespace brpc {
 class Controller;
 }
@@ -29,6 +40,8 @@ class Controller;
 namespace doris {
 
 class ExecEnv;
+class PHandShakeRequest;
+class PHandShakeResponse;
 
 class PInternalServiceImpl : public PBackendService {
 public:
diff --git a/be/src/service/point_query_executor.cpp b/be/src/service/point_query_executor.cpp
index f57547d003..ed42c0c9c4 100644
--- a/be/src/service/point_query_executor.cpp
+++ b/be/src/service/point_query_executor.cpp
@@ -17,18 +17,27 @@
 
 #include "service/point_query_executor.h"
 
+#include <fmt/format.h>
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/Exprs_types.h>
+#include <gen_cpp/internal_service.pb.h>
+#include <stdlib.h>
+
 #include "olap/lru_cache.h"
+#include "olap/olap_tuple.h"
 #include "olap/row_cursor.h"
 #include "olap/storage_engine.h"
-#include "service/internal_service.h"
-#include "util/defer_op.h"
+#include "olap/tablet_manager.h"
+#include "olap/tablet_schema.h"
+#include "runtime/runtime_state.h"
 #include "util/key_util.h"
 #include "util/runtime_profile.h"
 #include "util/thrift_util.h"
 #include "vec/exprs/vexpr.h"
-#include "vec/exprs/vliteral.h"
+#include "vec/exprs/vexpr_context.h"
 #include "vec/jsonb/serialize.h"
 #include "vec/sink/vmysql_result_writer.cpp"
+#include "vec/sink/vmysql_result_writer.h"
 
 namespace doris {
 
diff --git a/be/src/service/point_query_executor.h b/be/src/service/point_query_executor.h
index 3f4a0426a1..69fa6850e9 100644
--- a/be/src/service/point_query_executor.h
+++ b/be/src/service/point_query_executor.h
@@ -17,22 +17,53 @@
 
 #pragma once
 
+#include <assert.h>
+#include <butil/macros.h>
+#include <butil/time.h>
+#include <gen_cpp/Metrics_types.h>
+#include <gen_cpp/internal_service.pb.h>
+#include <parallel_hashmap/phmap.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <algorithm>
 #include <memory>
+#include <mutex>
+#include <optional>
+#include <ostream>
+#include <string>
+#include <utility>
+#include <vector>
 
 #include "butil/containers/doubly_buffered_data.h"
+#include "common/config.h"
+#include "common/logging.h"
 #include "common/status.h"
-#include "gen_cpp/internal_service.pb.h"
 #include "gutil/int128.h"
+#include "olap/lru_cache.h"
 #include "olap/olap_common.h"
 #include "olap/rowset/rowset.h"
 #include "olap/tablet.h"
+#include "olap/utils.h"
+#include "runtime/descriptors.h"
+#include "util/mysql_global.h"
 #include "util/runtime_profile.h"
+#include "util/slice.h"
 #include "vec/core/block.h"
 
 namespace doris {
 
 class RowCache;
 class Cache;
+class PTabletKeyLookupRequest;
+class PTabletKeyLookupResponse;
+class RuntimeState;
+class TDescriptorTable;
+class TExpr;
+
+namespace vectorized {
+class VExprContext;
+} // namespace vectorized
 
 // For caching point lookup pre allocted blocks and exprs
 class Reusable {
diff --git a/be/src/service/single_replica_load_download_service.cpp b/be/src/service/single_replica_load_download_service.cpp
index 1cee6c677a..0e48c6760f 100644
--- a/be/src/service/single_replica_load_download_service.cpp
+++ b/be/src/service/single_replica_load_download_service.cpp
@@ -17,9 +17,15 @@
 
 #include "service/single_replica_load_download_service.h"
 
+#include <algorithm>
+#include <string>
+#include <vector>
+
 #include "http/action/download_action.h"
 #include "http/ev_http_server.h"
+#include "http/http_method.h"
 #include "io/fs/fs_utils.h"
+#include "olap/options.h"
 #include "runtime/exec_env.h"
 
 namespace doris {
diff --git a/be/src/udf/udf.cpp b/be/src/udf/udf.cpp
index d57d1cc3ae..37c8e72d17 100644
--- a/be/src/udf/udf.cpp
+++ b/be/src/udf/udf.cpp
@@ -20,23 +20,14 @@
 
 #include "udf/udf.h"
 
-#include <assert.h>
-
 #include <iostream>
-#include <sstream>
-
-#include "common/logging.h"
-#include "gen_cpp/types.pb.h"
-#include "olap/hll.h"
-#include "runtime/decimalv2_value.h"
+#include <utility>
 
 // Be careful what this includes since this needs to be linked into the UDF's
 // binary. For example, it would be unfortunate if they had a random dependency
 // on libhdfs.
 #include "runtime/runtime_state.h"
 #include "runtime/types.h"
-#include "udf/udf.h"
-#include "util/debug_util.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
diff --git a/be/src/udf/udf.h b/be/src/udf/udf.h
index 3d7d960038..bec07e8363 100644
--- a/be/src/udf/udf.h
+++ b/be/src/udf/udf.h
@@ -26,6 +26,7 @@
 #include <functional>
 #include <iostream>
 #include <memory>
+#include <string>
 #include <vector>
 
 #include "runtime/types.h"
@@ -38,7 +39,6 @@ class BitmapValue;
 class DecimalV2Value;
 class CollectionValue;
 struct TypeDescriptor;
-
 class RuntimeState;
 // All input and output values will be one of the structs below. The struct is a simple
 // object containing a boolean to store if the value is nullptr and the value itself. The
diff --git a/be/src/util/sse_util.hpp b/be/src/util/sse_util.hpp
index 60f1950a65..1d00a54fba 100644
--- a/be/src/util/sse_util.hpp
+++ b/be/src/util/sse_util.hpp
@@ -21,10 +21,10 @@
 #pragma once
 
 #if defined(__aarch64__)
-#include <sse2neon.h>
+#include <sse2neon.h> // IWYU pragma: export
 #elif defined(__x86_64__)
-#include <immintrin.h>
-#include <mm_malloc.h>
+#include <immintrin.h> // IWYU pragma: export
+#include <mm_malloc.h> // IWYU pragma: export
 #endif
 
 namespace doris {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org