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

[doris] branch master updated: [chore](build) Use include-what-you-use to optimize includes (PART II) (#18761)

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

adonisling pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new e412dd12e8 [chore](build) Use include-what-you-use to optimize includes (PART II) (#18761)
e412dd12e8 is described below

commit e412dd12e8f579dd2a0eb1ec977450d73f1948d1
Author: Adonis Ling <ad...@gmail.com>
AuthorDate: Wed Apr 19 23:11:48 2023 +0800

    [chore](build) Use include-what-you-use to optimize includes (PART II) (#18761)
    
    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.h                        |  3 -
 be/src/agent/heartbeat_server.h                    |  3 -
 be/src/agent/task_worker_pool.cpp                  |  2 +-
 be/src/agent/task_worker_pool.h                    |  4 --
 be/src/agent/topic_listener.h                      |  2 +-
 be/src/agent/topic_subscriber.h                    |  4 --
 be/src/agent/user_resource_listener.h              |  4 --
 be/src/agent/utils.cpp                             |  3 +-
 be/src/agent/utils.h                               |  4 --
 be/src/common/configbase.cpp                       |  4 +-
 be/src/common/daemon.cpp                           |  7 ++-
 be/src/common/daemon.h                             |  2 -
 be/src/common/signal_handler.h                     |  3 +-
 be/src/common/status.h                             |  3 +-
 be/src/exec/arrow/arrow_reader.cpp                 |  4 +-
 be/src/exec/arrow/arrow_reader.h                   | 17 ------
 be/src/exec/arrow/parquet_reader.cpp               |  4 +-
 be/src/exec/arrow/parquet_reader.h                 | 25 --------
 be/src/exec/base_scanner.cpp                       |  4 +-
 be/src/exec/base_scanner.h                         |  4 --
 be/src/exec/data_sink.h                            |  4 --
 be/src/exec/es/es_scan_reader.h                    |  1 -
 be/src/exec/es/es_scroll_parser.h                  |  2 -
 be/src/exec/exec_node.cpp                          |  5 +-
 be/src/exec/exec_node.h                            | 10 ----
 be/src/exec/olap_common.h                          |  2 -
 be/src/exec/olap_utils.h                           |  2 +-
 be/src/exec/rowid_fetcher.h                        |  1 -
 be/src/exec/scan_node.h                            |  3 -
 be/src/exec/schema_scanner.h                       |  3 -
 be/src/exec/schema_scanner/schema_helper.h         |  1 -
 .../exec/schema_scanner/schema_rowsets_scanner.h   |  3 -
 be/src/exec/schema_scanner/schema_tables_scanner.h |  1 -
 .../exec/schema_scanner/schema_variables_scanner.h |  2 -
 be/src/exec/table_connector.cpp                    |  5 +-
 be/src/exec/table_connector.h                      |  4 --
 be/src/exec/tablet_info.h                          |  3 -
 be/src/exec/text_converter.cpp                     |  4 +-
 be/src/exec/text_converter.h                       |  3 -
 be/src/exprs/bloom_filter_func.h                   |  3 +-
 be/src/exprs/function_filter.h                     |  1 +
 be/src/exprs/json_functions.cpp                    |  3 +-
 be/src/exprs/json_functions.h                      |  6 +-
 be/src/exprs/math_functions.cpp                    |  4 +-
 be/src/exprs/runtime_filter.h                      |  3 -
 be/src/exprs/runtime_filter_slots.h                |  1 +
 be/src/exprs/string_functions.h                    |  5 --
 be/src/geo/ByteOrderValues.h                       |  2 -
 be/src/geo/geo_tobinary.h                          |  4 --
 be/src/geo/geo_types.h                             |  1 -
 be/src/geo/wkb_parse.h                             |  2 -
 be/src/geo/wkt_parse.h                             |  2 -
 be/src/gutil/atomicops.h                           |  8 +--
 be/src/http/action/check_tablet_segment_action.h   |  1 -
 be/src/http/action/checksum_action.h               |  1 -
 be/src/http/action/download_action.h               |  2 -
 be/src/http/action/health_action.h                 |  1 -
 be/src/http/action/meta_action.h                   |  1 -
 be/src/http/action/metrics_action.h                |  2 -
 be/src/http/action/monitor_action.h                |  1 -
 be/src/http/action/pad_rowset_action.h             |  1 -
 be/src/http/action/pprof_actions.cpp               |  1 +
 be/src/http/action/reload_tablet_action.h          |  1 -
 be/src/http/action/restore_tablet_action.cpp       |  1 +
 be/src/http/action/restore_tablet_action.h         |  1 -
 be/src/http/action/snapshot_action.h               |  1 -
 be/src/http/action/stream_load.h                   |  5 --
 be/src/http/action/tablet_migration_action.h       |  5 +-
 be/src/http/action/tablets_info_action.cpp         |  2 +-
 be/src/http/action/version_action.h                |  1 -
 be/src/http/default_path_handlers.h                |  5 --
 be/src/http/ev_http_server.cpp                     |  3 +-
 be/src/http/ev_http_server.h                       |  1 -
 be/src/http/http_channel.h                         |  3 -
 be/src/http/http_client.h                          |  3 -
 be/src/http/http_request.h                         |  4 --
 be/src/http/utils.h                                |  3 -
 be/src/http/web_page_handler.h                     |  2 -
 be/src/io/cache/block/block_file_cache.cpp         |  4 ++
 be/src/io/cache/block/block_file_cache.h           | 14 ++++-
 be/src/io/cache/block/block_file_cache_factory.cpp |  9 ++-
 be/src/io/cache/block/block_file_cache_factory.h   |  9 ++-
 be/src/io/cache/block/block_file_cache_profile.cpp |  2 +
 be/src/io/cache/block/block_file_cache_profile.h   |  6 +-
 be/src/io/cache/block/block_file_segment.cpp       |  7 ++-
 be/src/io/cache/block/block_file_segment.h         | 10 +++-
 be/src/io/cache/block/block_lru_file_cache.cpp     | 32 ++++++++--
 be/src/io/cache/block/block_lru_file_cache.h       | 10 +++-
 .../io/cache/block/cached_remote_file_reader.cpp   | 20 ++++++-
 be/src/io/cache/block/cached_remote_file_reader.h  | 18 ++++--
 be/src/io/cache/dummy_file_cache.cpp               |  7 ++-
 be/src/io/cache/dummy_file_cache.h                 | 10 +++-
 be/src/io/cache/file_cache.cpp                     | 17 +++++-
 be/src/io/cache/file_cache.h                       | 10 +++-
 be/src/io/cache/file_cache_manager.cpp             | 17 +++++-
 be/src/io/cache/file_cache_manager.h               | 11 +++-
 be/src/io/cache/sub_file_cache.cpp                 | 13 +++-
 be/src/io/cache/sub_file_cache.h                   | 14 ++++-
 be/src/io/cache/whole_file_cache.cpp               | 14 ++++-
 be/src/io/cache/whole_file_cache.h                 |  9 ++-
 be/src/io/file_factory.cpp                         | 18 ++++--
 be/src/io/file_factory.h                           | 22 +++++--
 be/src/io/fs/broker_file_reader.cpp                | 15 ++++-
 be/src/io/fs/broker_file_reader.h                  |  9 ++-
 be/src/io/fs/broker_file_system.cpp                | 22 ++++++-
 be/src/io/fs/broker_file_system.h                  | 14 +++++
 be/src/io/fs/broker_file_writer.cpp                |  8 ++-
 be/src/io/fs/broker_file_writer.h                  | 10 ++--
 be/src/io/fs/buffered_reader.cpp                   | 13 +++-
 be/src/io/fs/buffered_reader.h                     | 15 +++--
 be/src/io/fs/err_utils.cpp                         |  3 +
 be/src/io/fs/file_reader.cpp                       |  4 +-
 be/src/io/fs/file_reader.h                         |  7 ++-
 be/src/io/fs/file_reader_options.h                 |  4 +-
 be/src/io/fs/file_system.cpp                       |  3 +-
 be/src/io/fs/file_system.h                         | 13 +++-
 be/src/io/fs/fs_utils.cpp                          |  5 ++
 be/src/io/fs/fs_utils.h                            |  7 +++
 be/src/io/fs/hdfs_file_reader.cpp                  | 10 ++++
 be/src/io/fs/hdfs_file_system.cpp                  | 22 ++++++-
 be/src/io/fs/hdfs_file_system.h                    | 16 ++++-
 be/src/io/fs/hdfs_file_writer.cpp                  |  6 ++
 be/src/io/fs/hdfs_file_writer.h                    |  5 --
 be/src/io/fs/local_file_reader.cpp                 | 14 +++++
 be/src/io/fs/local_file_reader.h                   |  7 +++
 be/src/io/fs/local_file_system.cpp                 | 17 +++++-
 be/src/io/fs/local_file_system.h                   | 12 ++++
 be/src/io/fs/local_file_writer.cpp                 | 17 +++++-
 be/src/io/fs/local_file_writer.h                   |  4 +-
 be/src/io/fs/remote_file_system.cpp                |  9 ++-
 be/src/io/fs/remote_file_system.h                  | 11 ++++
 be/src/io/fs/s3_file_reader.cpp                    | 12 +++-
 be/src/io/fs/s3_file_reader.h                      | 11 +++-
 be/src/io/fs/s3_file_system.cpp                    | 40 +++++++++++--
 be/src/io/fs/s3_file_system.h                      | 11 ++++
 be/src/io/fs/s3_file_writer.cpp                    | 32 ++++++----
 be/src/io/fs/s3_file_writer.h                      |  9 ++-
 be/src/io/fs/stream_load_pipe.cpp                  | 12 +++-
 be/src/io/fs/stream_load_pipe.h                    | 10 ++++
 be/src/io/hdfs_builder.cpp                         |  6 +-
 be/src/io/hdfs_builder.h                           | 10 +++-
 be/src/io/io_common.h                              |  2 +-
 be/src/olap/base_compaction.cpp                    | 14 +++++
 be/src/olap/base_compaction.h                      |  9 +++
 be/src/olap/base_tablet.cpp                        |  9 ++-
 be/src/olap/base_tablet.h                          |  8 ++-
 be/src/olap/block_column_predicate.cpp             | 10 +++-
 be/src/olap/block_column_predicate.h               | 20 ++++++-
 be/src/olap/cold_data_compaction.cpp               | 19 +++++-
 be/src/olap/cold_data_compaction.h                 |  6 ++
 be/src/olap/compaction.cpp                         | 27 ++++++++-
 be/src/olap/compaction.h                           | 20 ++++---
 be/src/olap/compaction_permit_limiter.cpp          |  3 +
 be/src/olap/compaction_permit_limiter.h            |  7 +--
 be/src/olap/comparison_predicate.h                 |  1 +
 be/src/olap/cumulative_compaction.cpp              | 13 ++++
 be/src/olap/cumulative_compaction.h                |  9 ++-
 be/src/olap/cumulative_compaction_policy.cpp       |  9 ++-
 be/src/olap/cumulative_compaction_policy.h         | 10 +++-
 be/src/olap/data_dir.cpp                           | 38 +++++++-----
 be/src/olap/data_dir.h                             | 12 ++--
 be/src/olap/delete_handler.cpp                     | 12 ++--
 be/src/olap/delete_handler.h                       | 20 ++++---
 be/src/olap/delta_writer.cpp                       | 28 +++++++++
 be/src/olap/delta_writer.h                         | 26 +++++++-
 be/src/olap/hll.cpp                                |  6 +-
 be/src/olap/hll.h                                  |  7 +--
 be/src/olap/in_list_predicate.h                    |  1 +
 be/src/olap/itoken_extractor.cpp                   |  2 +
 be/src/olap/key_coder.cpp                          |  2 +
 be/src/olap/key_coder.h                            | 10 ++++
 be/src/olap/like_column_predicate.cpp              |  4 +-
 be/src/olap/like_column_predicate.h                | 24 +++++++-
 be/src/olap/lru_cache.cpp                          |  7 +--
 be/src/olap/lru_cache.h                            | 15 +++--
 be/src/olap/match_predicate.cpp                    | 12 ++--
 be/src/olap/match_predicate.h                      | 19 +++++-
 be/src/olap/memtable.cpp                           | 27 ++++++++-
 be/src/olap/memtable.h                             | 11 +++-
 be/src/olap/memtable_flush_executor.cpp            | 11 +++-
 be/src/olap/memtable_flush_executor.h              | 11 ++--
 be/src/olap/merger.cpp                             | 26 +++++++-
 be/src/olap/merger.h                               | 23 +++++---
 be/src/olap/null_predicate.cpp                     | 11 +++-
 be/src/olap/null_predicate.h                       | 18 +++++-
 be/src/olap/olap_common.h                          |  2 +-
 be/src/olap/olap_meta.cpp                          |  7 +++
 be/src/olap/olap_meta.h                            | 10 +++-
 be/src/olap/olap_server.cpp                        | 41 ++++++++++---
 be/src/olap/options.cpp                            |  9 ++-
 be/src/olap/options.h                              |  6 +-
 be/src/olap/page_cache.cpp                         |  4 +-
 be/src/olap/page_cache.h                           |  9 ++-
 be/src/olap/primary_key_index.cpp                  | 10 +++-
 be/src/olap/primary_key_index.h                    | 18 +++++-
 be/src/olap/push_handler.cpp                       | 37 +++++++++---
 be/src/olap/push_handler.h                         | 28 ++++++---
 be/src/olap/reader.cpp                             | 30 ++++++++--
 be/src/olap/reader.h                               | 37 +++++++++---
 be/src/olap/row_cursor.cpp                         | 14 ++++-
 be/src/olap/row_cursor.h                           | 10 +++-
 be/src/olap/rowset/beta_rowset.cpp                 | 21 ++++---
 be/src/olap/rowset/beta_rowset.h                   | 17 ++++--
 be/src/olap/rowset/beta_rowset_reader.cpp          | 18 ++++++
 be/src/olap/rowset/beta_rowset_reader.h            | 16 ++++-
 be/src/olap/rowset/beta_rowset_writer.cpp          | 27 ++++++---
 be/src/olap/rowset/beta_rowset_writer.h            | 33 ++++++++---
 be/src/olap/rowset/rowset.cpp                      |  4 +-
 be/src/olap/rowset/rowset.h                        | 24 +++++---
 be/src/olap/rowset/rowset_factory.cpp              |  5 +-
 be/src/olap/rowset/rowset_factory.h                |  8 ++-
 be/src/olap/rowset/rowset_meta.h                   |  3 +-
 be/src/olap/rowset/rowset_meta_manager.cpp         |  9 +--
 be/src/olap/rowset/rowset_meta_manager.h           |  9 ++-
 be/src/olap/rowset/rowset_reader.h                 |  3 +-
 be/src/olap/rowset/rowset_tree.cpp                 |  3 +
 be/src/olap/rowset/rowset_tree.h                   |  5 +-
 be/src/olap/rowset/rowset_writer.h                 |  5 +-
 be/src/olap/rowset/rowset_writer_context.h         |  3 +-
 be/src/olap/rowset/segcompaction.cpp               | 38 +++++++++---
 be/src/olap/rowset/segcompaction.h                 | 19 ++++--
 be/src/olap/rowset/segment_v2/binary_dict_page.cpp | 17 +++++-
 be/src/olap/rowset/segment_v2/binary_dict_page.h   | 20 +++++--
 .../olap/rowset/segment_v2/binary_prefix_page.cpp  |  6 +-
 be/src/olap/rowset/segment_v2/binary_prefix_page.h |  6 +-
 .../olap/rowset/segment_v2/bitmap_index_reader.cpp |  9 +++
 .../olap/rowset/segment_v2/bitmap_index_reader.h   | 19 +++---
 .../olap/rowset/segment_v2/bitmap_index_writer.cpp |  6 ++
 .../olap/rowset/segment_v2/bitmap_index_writer.h   |  6 +-
 be/src/olap/rowset/segment_v2/bitshuffle_page.cpp  |  2 -
 be/src/olap/rowset/segment_v2/bitshuffle_page.h    | 10 ++--
 .../rowset/segment_v2/block_split_bloom_filter.cpp |  2 +-
 .../rowset/segment_v2/block_split_bloom_filter.h   |  2 +
 be/src/olap/rowset/segment_v2/bloom_filter.cpp     | 11 ++--
 be/src/olap/rowset/segment_v2/bloom_filter.h       |  7 ++-
 .../segment_v2/bloom_filter_index_reader.cpp       |  6 ++
 .../rowset/segment_v2/bloom_filter_index_reader.h  | 15 +++--
 .../segment_v2/bloom_filter_index_writer.cpp       | 15 +++--
 .../rowset/segment_v2/bloom_filter_index_writer.h  |  9 ++-
 be/src/olap/rowset/segment_v2/column_reader.cpp    | 34 ++++++++++-
 be/src/olap/rowset/segment_v2/column_reader.h      | 55 ++++++++++-------
 be/src/olap/rowset/segment_v2/column_writer.cpp    | 13 +++-
 be/src/olap/rowset/segment_v2/column_writer.h      | 26 ++++----
 .../rowset/segment_v2/empty_segment_iterator.cpp   |  4 ++
 .../rowset/segment_v2/empty_segment_iterator.h     |  5 +-
 be/src/olap/rowset/segment_v2/encoding_info.cpp    |  7 ++-
 be/src/olap/rowset/segment_v2/encoding_info.h      |  8 ++-
 be/src/olap/rowset/segment_v2/index_page.cpp       |  6 +-
 be/src/olap/rowset/segment_v2/index_page.h         |  9 +--
 .../rowset/segment_v2/indexed_column_reader.cpp    | 10 +++-
 .../olap/rowset/segment_v2/indexed_column_reader.h | 15 +++--
 .../rowset/segment_v2/indexed_column_writer.cpp    |  6 +-
 .../olap/rowset/segment_v2/indexed_column_writer.h |  9 +--
 .../rowset/segment_v2/inverted_index_cache.cpp     | 14 +++++
 .../olap/rowset/segment_v2/inverted_index_cache.h  | 28 ++++++---
 .../inverted_index_compound_directory.cpp          | 26 ++++++--
 .../segment_v2/inverted_index_compound_directory.h | 22 +++++--
 .../segment_v2/inverted_index_compound_reader.cpp  | 20 +++++++
 .../segment_v2/inverted_index_compound_reader.h    | 21 ++++++-
 .../olap/rowset/segment_v2/inverted_index_desc.cpp |  3 +
 .../olap/rowset/segment_v2/inverted_index_desc.h   |  7 ++-
 .../rowset/segment_v2/inverted_index_reader.cpp    | 34 +++++++++--
 .../olap/rowset/segment_v2/inverted_index_reader.h | 30 +++++++---
 .../rowset/segment_v2/inverted_index_writer.cpp    | 17 +++++-
 .../olap/rowset/segment_v2/inverted_index_writer.h | 12 +++-
 .../olap/rowset/segment_v2/ngram_bloom_filter.cpp  |  5 +-
 be/src/olap/rowset/segment_v2/ngram_bloom_filter.h |  7 +++
 .../olap/rowset/segment_v2/ordinal_page_index.cpp  | 11 +++-
 be/src/olap/rowset/segment_v2/ordinal_page_index.h | 13 ++--
 be/src/olap/rowset/segment_v2/page_io.cpp          | 11 ++++
 be/src/olap/rowset/segment_v2/page_io.h            | 16 ++---
 be/src/olap/rowset/segment_v2/page_pointer.h       |  3 +-
 be/src/olap/rowset/segment_v2/parsed_page.h        |  3 +-
 be/src/olap/rowset/segment_v2/segment.cpp          | 31 ++++++++--
 be/src/olap/rowset/segment_v2/segment.h            | 31 ++++++----
 be/src/olap/rowset/segment_v2/segment_iterator.cpp | 38 ++++++++++++
 be/src/olap/rowset/segment_v2/segment_iterator.h   | 40 +++++++++----
 be/src/olap/rowset/segment_v2/segment_writer.cpp   | 22 ++++++-
 be/src/olap/rowset/segment_v2/segment_writer.h     | 25 +++++---
 be/src/olap/rowset/segment_v2/zone_map_index.cpp   | 15 +++++
 be/src/olap/rowset/segment_v2/zone_map_index.h     | 11 ++--
 be/src/olap/rowset/unique_rowset_id_generator.cpp  |  5 +-
 be/src/olap/rowset/unique_rowset_id_generator.h    |  4 ++
 be/src/olap/rowset/vertical_beta_rowset_writer.cpp | 21 +++++++
 be/src/olap/rowset/vertical_beta_rowset_writer.h   | 10 ++++
 be/src/olap/schema.cpp                             | 16 ++++-
 be/src/olap/schema.h                               | 14 ++++-
 be/src/olap/schema_change.cpp                      | 37 ++++++++++--
 be/src/olap/schema_change.h                        | 50 ++++++++++++----
 be/src/olap/segment_loader.cpp                     |  5 +-
 be/src/olap/segment_loader.h                       | 14 ++++-
 be/src/olap/short_key_index.cpp                    |  4 +-
 be/src/olap/short_key_index.h                      |  8 ++-
 be/src/olap/skiplist.h                             |  3 +-
 be/src/olap/snapshot_manager.cpp                   | 27 +++++++--
 be/src/olap/snapshot_manager.h                     | 22 +++----
 be/src/olap/storage_engine.cpp                     | 52 ++++++++++------
 be/src/olap/storage_engine.h                       | 40 +++++++------
 be/src/olap/storage_policy.cpp                     |  4 ++
 be/src/olap/storage_policy.h                       |  9 +++
 be/src/olap/tablet.cpp                             | 69 ++++++++++++++++++----
 be/src/olap/tablet.h                               | 42 +++++++++----
 be/src/olap/tablet_manager.cpp                     | 40 ++++++++++---
 be/src/olap/tablet_manager.h                       | 25 +++++---
 be/src/olap/tablet_meta.cpp                        | 34 +++++++----
 be/src/olap/tablet_meta.h                          | 27 ++++++---
 be/src/olap/tablet_meta_manager.cpp                | 17 +++++-
 be/src/olap/tablet_meta_manager.h                  |  9 ++-
 be/src/olap/tablet_schema.cpp                      | 16 ++++-
 be/src/olap/tablet_schema.h                        | 23 ++++++--
 be/src/olap/task/engine_alter_tablet_task.cpp      | 11 +++-
 be/src/olap/task/engine_alter_tablet_task.h        |  8 ++-
 be/src/olap/task/engine_batch_load_task.cpp        | 21 ++++++-
 be/src/olap/task/engine_batch_load_task.h          | 13 ++--
 be/src/olap/task/engine_checksum_task.cpp          | 19 ++++++
 be/src/olap/task/engine_checksum_task.h            |  9 ++-
 be/src/olap/task/engine_clone_task.cpp             | 32 +++++++++-
 be/src/olap/task/engine_clone_task.h               | 21 +++++--
 be/src/olap/task/engine_publish_version_task.cpp   | 21 +++++--
 be/src/olap/task/engine_publish_version_task.h     | 16 ++++-
 be/src/olap/task/engine_storage_migration_task.cpp | 26 +++++++-
 be/src/olap/task/engine_storage_migration_task.h   | 14 ++++-
 be/src/olap/txn_manager.cpp                        | 33 ++++-------
 be/src/olap/txn_manager.h                          | 25 ++++----
 be/src/olap/types.cpp                              |  5 +-
 be/src/olap/types.h                                | 25 ++++++--
 be/src/olap/utils.cpp                              | 22 +++----
 be/src/olap/utils.h                                | 15 ++---
 be/src/olap/version_graph.cpp                      |  9 ++-
 be/src/olap/version_graph.h                        | 11 +++-
 be/src/olap/wrapper_field.cpp                      |  9 +++
 be/src/olap/wrapper_field.h                        | 11 +++-
 be/src/pipeline/exec/aggregation_sink_operator.cpp |  4 +-
 be/src/pipeline/exec/aggregation_sink_operator.h   |  9 ++-
 .../pipeline/exec/aggregation_source_operator.cpp  |  4 +-
 be/src/pipeline/exec/aggregation_source_operator.h |  9 ++-
 be/src/pipeline/exec/analytic_sink_operator.cpp    |  4 ++
 be/src/pipeline/exec/analytic_sink_operator.h      |  6 +-
 be/src/pipeline/exec/analytic_source_operator.cpp  |  4 ++
 be/src/pipeline/exec/analytic_source_operator.h    |  9 +--
 be/src/pipeline/exec/data_queue.cpp                |  8 ++-
 be/src/pipeline/exec/data_queue.h                  |  7 ++-
 be/src/pipeline/exec/datagen_operator.cpp          |  8 +++
 be/src/pipeline/exec/datagen_operator.h            | 11 +++-
 be/src/pipeline/exec/empty_set_operator.cpp        |  4 +-
 be/src/pipeline/exec/empty_set_operator.h          |  3 +
 be/src/pipeline/exec/empty_source_operator.cpp     |  2 +
 be/src/pipeline/exec/empty_source_operator.h       | 16 ++++-
 be/src/pipeline/exec/exchange_sink_buffer.cpp      | 18 +++++-
 be/src/pipeline/exec/exchange_sink_buffer.h        | 13 +++-
 be/src/pipeline/exec/exchange_sink_operator.cpp    | 13 +++-
 be/src/pipeline/exec/exchange_sink_operator.h      |  8 +++
 be/src/pipeline/exec/exchange_source_operator.cpp  |  4 +-
 be/src/pipeline/exec/exchange_source_operator.h    |  9 ++-
 be/src/pipeline/exec/hashjoin_build_sink.cpp       |  4 +-
 be/src/pipeline/exec/hashjoin_build_sink.h         |  9 ++-
 be/src/pipeline/exec/hashjoin_probe_operator.cpp   |  4 +-
 be/src/pipeline/exec/hashjoin_probe_operator.h     |  9 ++-
 .../exec/nested_loop_join_build_operator.cpp       |  4 +-
 .../exec/nested_loop_join_build_operator.h         |  9 ++-
 .../exec/nested_loop_join_probe_operator.cpp       |  8 +++
 .../exec/nested_loop_join_probe_operator.h         | 12 ++--
 be/src/pipeline/exec/operator.cpp                  |  5 ++
 be/src/pipeline/exec/operator.h                    | 24 ++++++--
 be/src/pipeline/exec/repeat_operator.cpp           |  8 +++
 be/src/pipeline/exec/repeat_operator.h             | 12 ++--
 be/src/pipeline/exec/result_file_sink_operator.cpp |  7 +++
 be/src/pipeline/exec/result_file_sink_operator.h   |  7 ++-
 be/src/pipeline/exec/result_sink_operator.cpp      |  7 +++
 be/src/pipeline/exec/result_sink_operator.h        |  7 ++-
 be/src/pipeline/exec/scan_operator.cpp             |  5 ++
 be/src/pipeline/exec/scan_operator.h               | 14 +++--
 be/src/pipeline/exec/schema_scan_operator.cpp      |  8 +++
 be/src/pipeline/exec/schema_scan_operator.h        | 11 +++-
 be/src/pipeline/exec/select_operator.cpp           |  4 +-
 be/src/pipeline/exec/select_operator.h             | 10 ++--
 be/src/pipeline/exec/set_probe_sink_operator.cpp   | 14 +++++
 be/src/pipeline/exec/set_probe_sink_operator.h     | 11 +++-
 be/src/pipeline/exec/set_sink_operator.cpp         |  7 +++
 be/src/pipeline/exec/set_sink_operator.h           |  9 ++-
 be/src/pipeline/exec/set_source_operator.cpp       |  7 +++
 be/src/pipeline/exec/set_source_operator.h         | 11 ++--
 be/src/pipeline/exec/sort_sink_operator.cpp        |  4 +-
 be/src/pipeline/exec/sort_sink_operator.h          |  8 +--
 be/src/pipeline/exec/sort_source_operator.cpp      |  4 +-
 be/src/pipeline/exec/sort_source_operator.h        | 10 ++--
 .../exec/streaming_aggregation_sink_operator.cpp   | 13 ++++
 .../exec/streaming_aggregation_sink_operator.h     | 17 ++++--
 .../exec/streaming_aggregation_source_operator.cpp | 10 ++++
 .../exec/streaming_aggregation_source_operator.h   | 15 +++--
 be/src/pipeline/exec/table_function_operator.cpp   |  9 +++
 be/src/pipeline/exec/table_function_operator.h     |  8 +++
 be/src/pipeline/exec/union_sink_operator.cpp       | 12 ++++
 be/src/pipeline/exec/union_sink_operator.h         | 15 +++--
 be/src/pipeline/exec/union_source_operator.cpp     | 11 ++--
 be/src/pipeline/exec/union_source_operator.h       | 15 ++++-
 be/src/pipeline/pipeline.cpp                       |  6 +-
 be/src/pipeline/pipeline.h                         | 12 ++++
 be/src/pipeline/pipeline_fragment_context.cpp      | 59 ++++++++++++------
 be/src/pipeline/pipeline_fragment_context.h        | 30 +++++++---
 be/src/pipeline/pipeline_task.cpp                  | 20 +++++++
 be/src/pipeline/pipeline_task.h                    | 20 +++++++
 be/src/pipeline/task_queue.cpp                     |  6 ++
 be/src/pipeline/task_queue.h                       | 15 ++++-
 be/src/pipeline/task_scheduler.cpp                 | 23 +++++++-
 be/src/pipeline/task_scheduler.h                   | 25 +++++++-
 be/src/runtime/block_spill_manager.cpp             |  6 ++
 be/src/runtime/block_spill_manager.h               | 10 +++-
 be/src/runtime/broker_mgr.cpp                      | 16 ++++-
 be/src/runtime/broker_mgr.h                        |  8 +--
 be/src/runtime/buffer_control_block.cpp            | 15 ++++-
 be/src/runtime/buffer_control_block.h              |  7 ++-
 be/src/runtime/cache/result_cache.cpp              | 10 +++-
 be/src/runtime/cache/result_cache.h                | 18 +++---
 be/src/runtime/cache/result_node.cpp               | 11 +++-
 be/src/runtime/cache/result_node.h                 | 23 ++------
 be/src/runtime/client_cache.cpp                    |  5 +-
 be/src/runtime/client_cache.h                      | 21 +++++--
 be/src/runtime/collection_value.cpp                |  7 +--
 be/src/runtime/collection_value.h                  | 31 +---------
 be/src/runtime/datetime_value.h                    |  1 +
 be/src/runtime/decimalv2_value.cpp                 |  5 +-
 be/src/runtime/decimalv2_value.h                   | 10 ++--
 be/src/runtime/descriptor_helper.h                 |  5 +-
 be/src/runtime/descriptors.cpp                     | 13 ++--
 be/src/runtime/descriptors.h                       | 33 +++++------
 be/src/runtime/exec_env.cpp                        |  2 +-
 be/src/runtime/exec_env.h                          | 19 ++----
 be/src/runtime/exec_env_init.cpp                   | 38 +++++++++---
 be/src/runtime/export_task_mgr.h                   |  3 +-
 be/src/runtime/external_scan_context_mgr.cpp       | 10 +++-
 be/src/runtime/external_scan_context_mgr.h         |  8 +--
 be/src/runtime/fold_constant_executor.cpp          | 31 +++++++++-
 be/src/runtime/fold_constant_executor.h            | 18 ++++--
 be/src/runtime/fragment_mgr.cpp                    | 48 ++++++++++++---
 be/src/runtime/fragment_mgr.h                      | 32 +++++-----
 be/src/runtime/heartbeat_flags.h                   |  4 +-
 be/src/runtime/jsonb_value.cpp                     |  5 +-
 be/src/runtime/jsonb_value.h                       | 13 ++--
 be/src/runtime/large_int_value.cpp                 |  1 +
 be/src/runtime/large_int_value.h                   |  6 +-
 be/src/runtime/load_channel.cpp                    |  6 +-
 be/src/runtime/load_channel.h                      | 13 +++-
 be/src/runtime/load_channel_mgr.cpp                | 17 +++++-
 be/src/runtime/load_channel_mgr.h                  | 16 +++--
 be/src/runtime/load_path_mgr.cpp                   | 21 +++++--
 be/src/runtime/load_path_mgr.h                     |  7 ++-
 be/src/runtime/map_value.h                         |  4 +-
 be/src/runtime/memory/chunk_allocator.cpp          |  7 ++-
 be/src/runtime/memory/chunk_allocator.h            |  3 +-
 be/src/runtime/memory/jemalloc_hook.cpp            |  7 +++
 be/src/runtime/memory/mem_tracker.cpp              |  5 +-
 be/src/runtime/memory/mem_tracker.h                | 16 ++++-
 be/src/runtime/memory/mem_tracker_limiter.cpp      |  8 ++-
 be/src/runtime/memory/mem_tracker_limiter.h        | 18 +++++-
 be/src/runtime/memory/system_allocator.cpp         |  8 ++-
 be/src/runtime/memory/thread_mem_tracker_mgr.cpp   |  4 +-
 be/src/runtime/memory/thread_mem_tracker_mgr.h     | 12 +++-
 be/src/runtime/message_body_sink.cpp               |  9 ++-
 be/src/runtime/message_body_sink.h                 |  5 ++
 be/src/runtime/plan_fragment_executor.cpp          | 30 ++++++++--
 be/src/runtime/plan_fragment_executor.h            | 29 +++++----
 be/src/runtime/primitive_type.cpp                  | 10 ++--
 be/src/runtime/primitive_type.h                    |  9 ++-
 be/src/runtime/query_fragments_ctx.h               |  5 +-
 be/src/runtime/query_statistics.cpp                |  1 +
 be/src/runtime/query_statistics.h                  |  9 ++-
 be/src/runtime/record_batch_queue.cpp              |  2 +
 be/src/runtime/record_batch_queue.h                |  4 ++
 be/src/runtime/result_buffer_mgr.cpp               | 12 +++-
 be/src/runtime/result_buffer_mgr.h                 | 10 ++--
 be/src/runtime/result_queue_mgr.cpp                |  9 ++-
 be/src/runtime/result_queue_mgr.h                  | 12 ++--
 be/src/runtime/result_writer.h                     | 10 ++--
 be/src/runtime/routine_load/data_consumer.cpp      | 14 ++++-
 be/src/runtime/routine_load/data_consumer.h        | 15 ++++-
 .../runtime/routine_load/data_consumer_group.cpp   | 11 +++-
 be/src/runtime/routine_load/data_consumer_group.h  | 14 +++++
 be/src/runtime/routine_load/data_consumer_pool.cpp | 16 +++++
 be/src/runtime/routine_load/data_consumer_pool.h   |  7 ++-
 .../routine_load/routine_load_task_executor.cpp    | 33 +++++++++--
 .../routine_load/routine_load_task_executor.h      | 10 +++-
 be/src/runtime/runtime_filter_mgr.cpp              | 14 ++++-
 be/src/runtime/runtime_filter_mgr.h                | 23 ++++----
 be/src/runtime/runtime_predicate.cpp               |  5 ++
 be/src/runtime/runtime_predicate.h                 | 20 +++----
 be/src/runtime/runtime_state.cpp                   | 12 ++--
 be/src/runtime/runtime_state.h                     | 29 +++++----
 be/src/runtime/small_file_mgr.cpp                  | 12 +++-
 be/src/runtime/small_file_mgr.h                    |  4 --
 be/src/runtime/snapshot_loader.cpp                 | 30 ++++++++--
 be/src/runtime/snapshot_loader.h                   |  9 +--
 be/src/runtime/stream_load/new_load_stream_mgr.cpp |  3 +
 be/src/runtime/stream_load/new_load_stream_mgr.h   |  6 +-
 be/src/runtime/stream_load/stream_load_context.cpp | 11 ++++
 be/src/runtime/stream_load/stream_load_context.h   | 24 ++++----
 .../runtime/stream_load/stream_load_executor.cpp   | 20 ++++++-
 be/src/runtime/stream_load/stream_load_executor.h  |  3 +-
 .../runtime/stream_load/stream_load_recorder.cpp   |  9 ++-
 be/src/runtime/stream_load/stream_load_recorder.h  | 10 +++-
 be/src/runtime/struct_value.h                      |  4 +-
 be/src/runtime/tablets_channel.cpp                 | 20 ++++++-
 be/src/runtime/tablets_channel.h                   | 31 ++++++++--
 be/src/runtime/task_group/task_group.cpp           | 10 +++-
 be/src/runtime/task_group/task_group.h             |  8 ++-
 be/src/runtime/task_group/task_group_manager.cpp   |  5 ++
 be/src/runtime/task_group/task_group_manager.h     |  2 +
 be/src/runtime/thread_context.cpp                  |  3 +
 be/src/runtime/thread_context.h                    | 13 +++-
 be/src/runtime/threadlocal.cc                      |  2 +
 be/src/runtime/threadlocal.h                       |  2 +
 be/src/runtime/types.cpp                           |  7 +++
 be/src/runtime/types.h                             | 10 ++--
 be/src/runtime/user_function_cache.cpp             | 12 +++-
 be/src/runtime/user_function_cache.h               |  2 +
 be/src/service/backend_options.h                   |  1 -
 be/src/service/backend_service.h                   | 18 ------
 be/src/service/brpc_service.cpp                    |  3 +-
 be/src/service/doris_main.cpp                      |  4 +-
 be/src/service/internal_service.h                  |  5 --
 be/src/service/point_query_executor.h              |  3 -
 be/src/tools/meta_tool.cpp                         |  4 +-
 be/src/udf/udf.h                                   | 14 -----
 be/src/util/aligned_new.h                          |  3 +-
 be/src/util/arrow/block_convertor.cpp              | 40 ++++++++-----
 be/src/util/arrow/block_convertor.h                |  3 -
 be/src/util/arrow/row_batch.cpp                    | 20 +++----
 be/src/util/arrow/row_batch.h                      |  3 +-
 be/src/util/arrow/utils.cpp                        |  4 +-
 be/src/util/arrow/utils.h                          |  1 -
 be/src/util/bfd_parser.cpp                         |  5 ++
 be/src/util/bit_util.h                             |  3 +-
 be/src/util/bitmap.h                               |  9 +++
 be/src/util/block_compression.cpp                  | 10 ++++
 be/src/util/block_compression.h                    |  9 ++-
 be/src/util/brpc_client_cache.cpp                  |  7 ++-
 be/src/util/brpc_client_cache.h                    | 29 +++++++--
 be/src/util/cgroup_util.cpp                        |  4 +-
 be/src/util/cidr.cpp                               |  8 ++-
 be/src/util/cidr.h                                 |  3 +-
 be/src/util/cityhash102/city.cc                    |  8 ++-
 be/src/util/coding.h                               |  7 ++-
 be/src/util/container_util.hpp                     |  3 +-
 be/src/util/core_local.cpp                         |  5 ++
 be/src/util/core_local.h                           | 11 +++-
 be/src/util/countdown_latch.h                      |  1 +
 be/src/util/cpu_info.cpp                           | 13 ++--
 be/src/util/cpu_info.h                             |  1 +
 be/src/util/crc32c.cpp                             |  5 +-
 be/src/util/date_func.cpp                          |  7 ++-
 be/src/util/date_func.h                            |  3 -
 be/src/util/debug_util.cpp                         | 14 ++---
 be/src/util/debug_util.h                           | 15 ++---
 be/src/util/disk_info.cpp                          | 18 ++++--
 be/src/util/disk_info.h                            |  3 +
 be/src/util/doris_metrics.cpp                      | 16 ++++-
 be/src/util/doris_metrics.h                        |  2 +-
 be/src/util/dynamic_util.cpp                       |  2 -
 be/src/util/easy_json.cc                           |  1 +
 be/src/util/encryption_util.cpp                    |  1 +
 be/src/util/error_util.cc                          |  3 +-
 be/src/util/faststring.h                           |  3 +-
 be/src/util/frame_of_reference_coding.cpp          |  6 ++
 be/src/util/frame_of_reference_coding.h            |  7 +--
 be/src/util/hash_util.hpp                          |  5 +-
 be/src/util/hdfs_util.cpp                          |  4 +-
 be/src/util/hdfs_util.h                            |  6 +-
 be/src/util/histogram.cpp                          |  2 +
 be/src/util/histogram.h                            |  3 +
 be/src/util/jni-util.cpp                           |  8 ++-
 be/src/util/jni-util.h                             |  9 ++-
 be/src/util/jni_native_method.cpp                  |  3 +
 be/src/util/jni_native_method.h                    |  2 +
 be/src/util/jsonb_document.h                       |  3 +
 be/src/util/key_util.h                             |  3 +-
 be/src/util/libjvm_loader.cpp                      |  2 +
 be/src/util/libjvm_loader.h                        |  3 +-
 be/src/util/mem_info.cpp                           | 18 ++++--
 be/src/util/mem_info.h                             |  5 +-
 be/src/util/metrics.cpp                            |  7 +++
 be/src/util/metrics.h                              | 12 ++--
 be/src/util/mustache/mustache.cc                   | 19 +++++-
 be/src/util/mustache/mustache.h                    |  1 +
 be/src/util/mysql_row_buffer.cpp                   | 14 ++++-
 be/src/util/network_util.cpp                       | 10 +++-
 be/src/util/network_util.h                         |  5 +-
 be/src/util/os_info.cpp                            |  6 --
 be/src/util/os_util.cpp                            |  7 +--
 be/src/util/os_util.h                              |  1 -
 be/src/util/parse_util.h                           |  2 +
 be/src/util/path_util.cpp                          |  3 -
 be/src/util/perf_counters.cpp                      |  9 +--
 be/src/util/perf_counters.h                        |  5 +-
 be/src/util/pprof_utils.cpp                        |  7 ++-
 be/src/util/pprof_utils.h                          |  4 +-
 be/src/util/pretty_printer.h                       |  3 +-
 be/src/util/progress_updater.cpp                   |  2 +
 be/src/util/progress_updater.h                     |  2 +
 be/src/util/quantile_state.cpp                     |  4 ++
 be/src/util/quantile_state.h                       |  7 ++-
 be/src/util/radix_sort.h                           |  3 +-
 be/src/util/runtime_profile.cpp                    | 14 +++--
 be/src/util/runtime_profile.h                      | 24 ++++----
 be/src/util/s3_uri.cpp                             |  2 +-
 be/src/util/s3_util.cpp                            | 11 ++++
 be/src/util/s3_util.h                              |  4 ++
 be/src/util/slice.h                                |  1 +
 be/src/util/sm3.cpp                                |  3 +
 be/src/util/sm3.h                                  |  3 +-
 be/src/util/sort_heap.h                            |  3 +-
 be/src/util/sse_util.hpp                           |  2 +
 be/src/util/static_asserts.cpp                     |  4 +-
 be/src/util/string_parser.hpp                      | 19 ++++--
 be/src/util/string_util.h                          |  3 +
 be/src/util/system_metrics.cpp                     | 11 +++-
 be/src/util/system_metrics.h                       |  6 ++
 be/src/util/telemetry/brpc_carrier.cpp             |  2 +
 be/src/util/telemetry/brpc_carrier.h               | 16 +++++
 .../util/telemetry/open_telemetry_scop_wrapper.hpp |  3 +-
 be/src/util/telemetry/telemetry.cpp                | 15 +++++
 be/src/util/telemetry/telemetry.h                  | 13 +++-
 be/src/util/thread.cpp                             | 16 ++++-
 be/src/util/thread.h                               | 13 ++--
 be/src/util/threadpool.cpp                         |  4 +-
 be/src/util/threadpool.h                           | 13 ++--
 be/src/util/thrift_client.cpp                      |  6 +-
 be/src/util/thrift_client.h                        | 16 ++---
 be/src/util/thrift_rpc_helper.cpp                  | 27 +++++++--
 be/src/util/thrift_rpc_helper.h                    |  7 ++-
 be/src/util/thrift_server.cpp                      | 19 +++++-
 be/src/util/thrift_server.h                        | 10 +++-
 be/src/util/thrift_util.cpp                        | 28 ++++++---
 be/src/util/thrift_util.h                          | 17 +++++-
 be/src/util/time.cpp                               |  6 +-
 be/src/util/time_lut.h                             |  1 -
 be/src/util/timezone_utils.cpp                     |  3 +
 be/src/util/timezone_utils.h                       |  6 +-
 be/src/util/trace.cpp                              |  8 ++-
 be/src/util/trace.h                                |  6 +-
 be/src/util/trace_metrics.h                        |  3 +-
 be/src/util/uid_util.cpp                           |  6 ++
 be/src/util/uid_util.h                             | 12 +++-
 be/src/util/url_coding.cpp                         |  3 -
 be/src/util/url_coding.h                           |  3 +
 be/src/util/url_parser.cpp                         |  5 ++
 be/src/util/url_parser.h                           |  2 +-
 be/src/util/zlib.cpp                               |  7 +--
 .../vec/aggregate_functions/aggregate_function.h   |  1 +
 .../aggregate_function_approx_count_distinct.cpp   |  9 +++
 .../aggregate_function_approx_count_distinct.h     | 23 +++++++-
 .../aggregate_functions/aggregate_function_avg.cpp |  1 +
 .../aggregate_functions/aggregate_function_avg.h   | 30 +++++++++-
 .../aggregate_function_avg_weighted.h              | 21 +++++++
 .../aggregate_functions/aggregate_function_bit.h   | 20 ++++++-
 .../aggregate_function_bitmap.cpp                  |  2 +
 .../aggregate_function_bitmap.h                    | 21 ++++++-
 .../aggregate_function_collect.cpp                 |  5 ++
 .../aggregate_function_collect.h                   | 32 ++++++++--
 .../aggregate_function_combinator.h                |  6 +-
 .../aggregate_function_count.cpp                   |  2 +
 .../aggregate_functions/aggregate_function_count.h | 23 +++++++-
 .../aggregate_function_distinct.cpp                |  3 +
 .../aggregate_function_distinct.h                  | 32 ++++++++--
 .../aggregate_function_group_concat.cpp            |  3 +
 .../aggregate_function_group_concat.h              | 17 +++++-
 .../aggregate_function_histogram.cpp               |  7 +++
 .../aggregate_function_histogram.h                 | 30 ++++++++++
 .../aggregate_function_hll_union_agg.cpp           |  2 +
 .../aggregate_function_hll_union_agg.h             | 26 ++++++--
 .../aggregate_function_max_by.cpp                  |  2 +
 .../aggregate_function_min_by.cpp                  |  2 +
 .../aggregate_function_min_max.cpp                 |  1 +
 .../aggregate_function_min_max.h                   | 26 +++++++-
 .../aggregate_function_orthogonal_bitmap.cpp       | 10 +++-
 .../aggregate_function_orthogonal_bitmap.h         | 24 +++++++-
 .../aggregate_function_percentile_approx.cpp       |  1 -
 .../aggregate_function_percentile_approx.h         | 26 ++++++++
 .../aggregate_function_quantile_state.cpp          |  3 +
 .../aggregate_function_quantile_state.h            | 19 +++++-
 .../aggregate_function_reader.cpp                  | 12 ++++
 .../aggregate_function_reader.h                    | 12 ++--
 .../aggregate_function_retention.h                 | 24 +++++++-
 .../aggregate_functions/aggregate_function_rpc.h   |  6 +-
 .../aggregate_function_sequence_match.cpp          | 14 +++++
 .../aggregate_function_sequence_match.h            | 33 ++++++++++-
 .../aggregate_function_simple_factory.cpp          |  4 +-
 .../aggregate_function_simple_factory.h            |  6 +-
 .../aggregate_function_sort.cpp                    |  2 +
 .../aggregate_functions/aggregate_function_sort.h  | 21 +++++++
 .../aggregate_function_stddev.cpp                  |  7 +++
 .../aggregate_function_stddev.h                    | 31 +++++++++-
 .../aggregate_functions/aggregate_function_sum.h   | 27 ++++++++-
 .../aggregate_function_topn.cpp                    |  7 ++-
 .../aggregate_functions/aggregate_function_topn.h  | 29 ++++++++-
 .../aggregate_function_uniq.cpp                    |  8 ++-
 .../aggregate_functions/aggregate_function_uniq.h  | 35 +++++++++--
 .../aggregate_function_window.cpp                  |  6 +-
 .../aggregate_function_window.h                    | 30 ++++++++--
 .../aggregate_function_window_funnel.cpp           |  6 ++
 .../aggregate_function_window_funnel.h             | 28 ++++++++-
 be/src/vec/columns/column.cpp                      |  5 +-
 be/src/vec/columns/column.h                        | 18 +++++-
 be/src/vec/columns/column_array.cpp                | 16 +++++
 be/src/vec/columns/column_array.h                  | 26 +++++++-
 be/src/vec/columns/column_const.cpp                |  7 ++-
 be/src/vec/columns/column_const.h                  | 24 +++++++-
 be/src/vec/columns/column_decimal.cpp              | 13 +++-
 be/src/vec/columns/column_decimal.h                | 27 ++++++++-
 be/src/vec/columns/column_map.cpp                  | 14 +++++
 be/src/vec/columns/column_map.h                    | 26 +++++++-
 be/src/vec/columns/column_nullable.cpp             |  7 +++
 be/src/vec/columns/column_nullable.h               | 29 ++++++++-
 be/src/vec/columns/column_object.cpp               | 48 ++++++++++-----
 be/src/vec/columns/column_object.h                 | 36 ++++++++---
 be/src/vec/columns/column_string.cpp               |  7 ++-
 be/src/vec/columns/column_string.h                 | 25 +++++++-
 be/src/vec/columns/column_struct.cpp               | 12 ++++
 be/src/vec/columns/column_struct.h                 | 26 ++++++--
 be/src/vec/columns/column_vector.cpp               | 11 ++--
 be/src/vec/columns/column_vector.h                 | 31 ++++++++++
 be/src/vec/columns/columns_common.cpp              | 14 ++++-
 be/src/vec/columns/columns_common.h                | 13 ++++
 be/src/vec/columns/subcolumn_tree.h                |  8 +--
 be/src/vec/common/allocator.cpp                    | 11 ++++
 be/src/vec/common/allocator.h                      |  8 ++-
 be/src/vec/common/arena.h                          |  1 +
 be/src/vec/common/hash_table/hash_map.h            |  2 +-
 .../vec/common/hash_table/hash_table_allocator.h   |  1 +
 be/src/vec/common/hash_table/phmap_fwd_decl.h      |  2 +-
 be/src/vec/common/hex.h                            |  1 -
 be/src/vec/common/mremap.cpp                       |  4 +-
 be/src/vec/common/mremap.h                         |  3 -
 be/src/vec/common/pod_array.h                      | 14 +++--
 be/src/vec/common/schema_util.cpp                  | 40 +++++++++----
 be/src/vec/common/schema_util.h                    | 26 +++++---
 be/src/vec/common/sip_hash.h                       |  3 +-
 be/src/vec/common/sort/heap_sorter.cpp             | 18 ++++++
 be/src/vec/common/sort/heap_sorter.h               | 21 +++++++
 be/src/vec/common/sort/sorter.cpp                  | 22 +++++++
 be/src/vec/common/sort/sorter.h                    | 18 +++++-
 be/src/vec/common/sort/topn_sorter.cpp             | 20 +++++++
 be/src/vec/common/sort/topn_sorter.h               | 19 +++++-
 be/src/vec/common/sort/vsort_exec_exprs.cpp        | 15 +++++
 be/src/vec/common/sort/vsort_exec_exprs.h          | 12 +++-
 be/src/vec/common/string_ref.cpp                   |  3 +-
 be/src/vec/common/string_ref.h                     |  9 ++-
 be/src/vec/common/string_utils/string_utils.h      |  1 -
 be/src/vec/core/block.cpp                          | 29 +++++++--
 be/src/vec/core/block.h                            | 22 +++++--
 be/src/vec/core/block_spill_reader.cpp             | 17 +++++-
 be/src/vec/core/block_spill_reader.h               | 13 +++-
 be/src/vec/core/block_spill_writer.cpp             | 13 +++-
 be/src/vec/core/block_spill_writer.h               | 10 +++-
 be/src/vec/core/column_with_type_and_name.cpp      | 12 +++-
 be/src/vec/core/column_with_type_and_name.h        | 12 +++-
 be/src/vec/core/field.cpp                          | 10 ++++
 be/src/vec/core/field.h                            | 29 +++++++--
 be/src/vec/core/materialize_block.cpp              |  6 ++
 be/src/vec/core/sort_block.cpp                     |  3 +-
 be/src/vec/core/sort_block.h                       | 25 ++++++++
 be/src/vec/data_types/convert_field_to_type.cpp    | 41 +++++++++----
 be/src/vec/data_types/convert_field_to_type.h      |  4 +-
 be/src/vec/data_types/data_type.cpp                | 13 ++++
 be/src/vec/data_types/data_type.h                  | 20 ++++---
 be/src/vec/data_types/data_type_array.cpp          | 16 ++++-
 be/src/vec/data_types/data_type_array.h            | 20 +++++++
 be/src/vec/data_types/data_type_bitmap.cpp         |  4 ++
 be/src/vec/data_types/data_type_bitmap.h           | 20 ++++++-
 be/src/vec/data_types/data_type_date.cpp           | 11 +++-
 be/src/vec/data_types/data_type_date.h             | 19 ++++++
 be/src/vec/data_types/data_type_date_time.cpp      | 11 +++-
 be/src/vec/data_types/data_type_date_time.h        | 22 ++++++-
 be/src/vec/data_types/data_type_decimal.cpp        |  8 ++-
 be/src/vec/data_types/data_type_decimal.h          | 34 ++++++++++-
 be/src/vec/data_types/data_type_factory.cpp        | 30 ++++++++++
 be/src/vec/data_types/data_type_factory.hpp        | 41 ++++++-------
 .../data_types/data_type_fixed_length_object.cpp   |  8 +++
 .../vec/data_types/data_type_fixed_length_object.h | 16 +++++
 be/src/vec/data_types/data_type_hll.cpp            |  6 ++
 be/src/vec/data_types/data_type_hll.h              | 22 ++++++-
 be/src/vec/data_types/data_type_jsonb.cpp          | 17 ++++--
 be/src/vec/data_types/data_type_jsonb.h            | 21 ++++++-
 be/src/vec/data_types/data_type_map.cpp            | 16 +++++
 be/src/vec/data_types/data_type_map.h              | 31 +++++++---
 be/src/vec/data_types/data_type_nothing.cpp        |  2 +
 be/src/vec/data_types/data_type_nothing.h          | 17 ++++++
 be/src/vec/data_types/data_type_nullable.cpp       | 12 +++-
 be/src/vec/data_types/data_type_nullable.h         | 22 +++++++
 be/src/vec/data_types/data_type_number_base.cpp    |  8 +++
 be/src/vec/data_types/data_type_number_base.h      | 23 ++++++++
 be/src/vec/data_types/data_type_object.cpp         | 22 ++++++-
 be/src/vec/data_types/data_type_object.h           | 24 +++++++-
 be/src/vec/data_types/data_type_quantilestate.cpp  |  4 ++
 be/src/vec/data_types/data_type_quantilestate.h    | 24 +++++++-
 be/src/vec/data_types/data_type_string.cpp         |  9 ++-
 be/src/vec/data_types/data_type_string.h           | 21 ++++++-
 be/src/vec/data_types/data_type_struct.cpp         | 20 +++++++
 be/src/vec/data_types/data_type_struct.h           | 31 +++++++---
 be/src/vec/data_types/data_type_time.cpp           | 12 +++-
 be/src/vec/data_types/data_type_time.h             | 21 +++++++
 be/src/vec/data_types/data_type_time_v2.cpp        | 16 +++++
 be/src/vec/data_types/data_type_time_v2.h          | 27 +++++++++
 be/src/vec/data_types/get_least_supertype.cpp      | 13 +++-
 be/src/vec/data_types/get_least_supertype.h        |  8 ++-
 be/src/vec/data_types/nested_utils.cpp             |  2 -
 be/src/vec/data_types/nested_utils.h               |  3 +
 .../vec/data_types/serde/data_type_array_serde.h   | 10 ++++
 .../data_types/serde/data_type_bitmap_serde.cpp    |  9 ++-
 .../vec/data_types/serde/data_type_bitmap_serde.h  |  6 ++
 .../vec/data_types/serde/data_type_decimal_serde.h | 13 +++-
 .../serde/data_type_fixedlengthobject_serde.h      | 10 ++++
 .../vec/data_types/serde/data_type_hll_serde.cpp   | 10 ++++
 be/src/vec/data_types/serde/data_type_hll_serde.h  |  6 ++
 be/src/vec/data_types/serde/data_type_map_serde.h  | 10 ++++
 .../data_types/serde/data_type_nullable_serde.cpp  | 11 ++++
 .../data_types/serde/data_type_nullable_serde.h    |  6 ++
 .../vec/data_types/serde/data_type_number_serde.h  | 12 +++-
 .../vec/data_types/serde/data_type_object_serde.h  | 10 ++++
 .../serde/data_type_quantilestate_serde.h          |  9 +++
 be/src/vec/data_types/serde/data_type_serde.h      |  8 ++-
 .../data_types/serde/data_type_string_serde.cpp    |  5 ++
 .../vec/data_types/serde/data_type_string_serde.h  |  6 ++
 .../vec/data_types/serde/data_type_struct_serde.h  | 10 ++++
 .../data_gen_functions/vdata_gen_function_inf.h    |  1 +
 .../vec/exec/data_gen_functions/vnumbers_tvf.cpp   | 16 +++--
 be/src/vec/exec/data_gen_functions/vnumbers_tvf.h  |  9 ++-
 be/src/vec/exec/format/csv/csv_reader.cpp          | 32 +++++++++-
 be/src/vec/exec/format/csv/csv_reader.h            | 26 +++++++-
 .../file_reader/new_plain_binary_line_reader.cpp   |  5 +-
 .../file_reader/new_plain_binary_line_reader.h     | 14 ++++-
 .../file_reader/new_plain_text_line_reader.cpp     | 10 +++-
 .../file_reader/new_plain_text_line_reader.h       |  7 ++-
 be/src/vec/exec/format/json/new_json_reader.cpp    | 47 +++++++++++++--
 be/src/vec/exec/format/json/new_json_reader.h      | 54 +++++++++++++----
 be/src/vec/exec/format/orc/vorc_reader.cpp         | 45 +++++++++++++-
 be/src/vec/exec/format/orc/vorc_reader.h           | 53 ++++++++++++++++-
 .../vec/exec/format/parquet/bool_plain_decoder.cpp |  9 +++
 .../vec/exec/format/parquet/bool_plain_decoder.h   | 15 +++++
 .../vec/exec/format/parquet/bool_rle_decoder.cpp   | 12 +++-
 be/src/vec/exec/format/parquet/bool_rle_decoder.h  | 15 ++++-
 .../format/parquet/byte_array_dict_decoder.cpp     |  6 ++
 .../exec/format/parquet/byte_array_dict_decoder.h  | 21 ++++++-
 .../format/parquet/byte_array_plain_decoder.cpp    |  5 ++
 .../exec/format/parquet/byte_array_plain_decoder.h | 19 ++++++
 be/src/vec/exec/format/parquet/decoder.cpp         |  6 +-
 be/src/vec/exec/format/parquet/decoder.h           | 26 +++++++-
 .../exec/format/parquet/delta_bit_pack_decoder.cpp | 11 ++++
 .../exec/format/parquet/delta_bit_pack_decoder.h   | 20 ++++++-
 .../format/parquet/fix_length_plain_decoder.cpp    | 26 +++++++-
 .../exec/format/parquet/fix_length_plain_decoder.h | 13 ++--
 be/src/vec/exec/format/parquet/level_decoder.cpp   |  6 ++
 be/src/vec/exec/format/parquet/level_decoder.h     |  5 +-
 be/src/vec/exec/format/parquet/parquet_common.cpp  |  6 +-
 be/src/vec/exec/format/parquet/parquet_common.h    | 21 ++-----
 be/src/vec/exec/format/parquet/parquet_pred_cmp.h  |  1 +
 .../vec/exec/format/parquet/parquet_thrift_util.h  |  2 +-
 be/src/vec/exec/format/parquet/schema_desc.cpp     |  7 +++
 be/src/vec/exec/format/parquet/schema_desc.h       |  4 ++
 .../parquet/vparquet_column_chunk_reader.cpp       | 27 +++++++++
 .../format/parquet/vparquet_column_chunk_reader.h  | 27 +++++++--
 .../exec/format/parquet/vparquet_column_reader.cpp | 22 +++++++
 .../exec/format/parquet/vparquet_column_reader.h   | 29 ++++++++-
 .../exec/format/parquet/vparquet_file_metadata.cpp |  3 +
 .../exec/format/parquet/vparquet_file_metadata.h   |  5 +-
 .../exec/format/parquet/vparquet_group_reader.cpp  | 46 +++++++++++++++
 .../exec/format/parquet/vparquet_group_reader.h    | 46 +++++++++++++--
 .../exec/format/parquet/vparquet_page_index.cpp    | 19 ++++++
 .../vec/exec/format/parquet/vparquet_page_index.h  | 21 ++++++-
 .../exec/format/parquet/vparquet_page_reader.cpp   | 15 +++++
 .../vec/exec/format/parquet/vparquet_page_reader.h | 13 +++-
 be/src/vec/exec/format/parquet/vparquet_reader.cpp | 39 +++++++++++-
 be/src/vec/exec/format/parquet/vparquet_reader.h   | 43 +++++++++++---
 be/src/vec/exec/format/table/iceberg_reader.cpp    | 52 +++++++++++++++-
 be/src/vec/exec/format/table/iceberg_reader.h      | 41 ++++++++++---
 be/src/vec/exec/format/table/table_format_reader.h | 17 +++++-
 be/src/vec/exec/jni_connector.cpp                  | 20 +++++++
 be/src/vec/exec/jni_connector.h                    | 36 ++++++++++-
 be/src/vec/exec/join/cross_join_impl.cpp           |  3 +-
 be/src/vec/exec/join/full_outer_join_impl.cpp      |  3 +-
 be/src/vec/exec/join/inner_join_impl.cpp           |  3 +-
 be/src/vec/exec/join/left_anti_join_impl.cpp       |  3 +-
 be/src/vec/exec/join/left_outer_join_impl.cpp      |  3 +-
 be/src/vec/exec/join/left_semi_join_impl.cpp       |  3 +-
 .../exec/join/null_aware_left_anti_join_impl.cpp   |  3 +-
 .../vec/exec/join/process_hash_table_probe_impl.h  |  2 +
 be/src/vec/exec/join/right_anti_join_impl.cpp      |  3 +-
 be/src/vec/exec/join/right_outer_join_impl.cpp     |  3 +-
 be/src/vec/exec/join/right_semi_join_impl.cpp      |  3 +-
 be/src/vec/exec/join/vhash_join_node.cpp           | 42 ++++++++++++-
 be/src/vec/exec/join/vhash_join_node.h             | 36 +++++++++--
 be/src/vec/exec/join/vjoin_node_base.cpp           | 26 +++++++-
 be/src/vec/exec/join/vjoin_node_base.h             | 20 ++++++-
 be/src/vec/exec/join/vnested_loop_join_node.cpp    | 35 ++++++++++-
 be/src/vec/exec/join/vnested_loop_join_node.h      | 29 +++++++--
 be/src/vec/exec/scan/jni_reader.cpp                | 16 +++++
 be/src/vec/exec/scan/jni_reader.h                  | 20 +++++++
 be/src/vec/exec/scan/new_es_scan_node.cpp          | 19 +++++-
 be/src/vec/exec/scan/new_es_scan_node.h            | 24 +++++++-
 be/src/vec/exec/scan/new_es_scanner.cpp            | 18 ++++++
 be/src/vec/exec/scan/new_es_scanner.h              | 22 ++++++-
 be/src/vec/exec/scan/new_file_scan_node.cpp        | 15 +++++
 be/src/vec/exec/scan/new_file_scan_node.h          | 17 ++++++
 be/src/vec/exec/scan/new_jdbc_scan_node.cpp        | 18 +++++-
 be/src/vec/exec/scan/new_jdbc_scan_node.h          | 15 ++++-
 be/src/vec/exec/scan/new_jdbc_scanner.cpp          | 15 +++++
 be/src/vec/exec/scan/new_jdbc_scanner.h            | 18 +++++-
 be/src/vec/exec/scan/new_odbc_scan_node.cpp        | 15 +++++
 be/src/vec/exec/scan/new_odbc_scan_node.h          | 18 ++++++
 be/src/vec/exec/scan/new_odbc_scanner.cpp          | 25 ++++++++
 be/src/vec/exec/scan/new_odbc_scanner.h            | 21 ++++++-
 be/src/vec/exec/scan/new_olap_scan_node.cpp        | 44 +++++++++++++-
 be/src/vec/exec/scan/new_olap_scan_node.h          | 31 +++++++++-
 be/src/vec/exec/scan/new_olap_scanner.cpp          | 31 ++++++++++
 be/src/vec/exec/scan/new_olap_scanner.h            | 22 ++++++-
 be/src/vec/exec/scan/scanner_context.cpp           | 15 ++++-
 be/src/vec/exec/scan/scanner_context.h             | 14 +++--
 be/src/vec/exec/scan/scanner_scheduler.cpp         | 25 ++++++--
 be/src/vec/exec/scan/scanner_scheduler.h           | 17 +++++-
 be/src/vec/exec/scan/vfile_scanner.cpp             | 53 ++++++++++++++---
 be/src/vec/exec/scan/vfile_scanner.h               | 32 +++++++++-
 be/src/vec/exec/scan/vmeta_scan_node.cpp           | 11 ++++
 be/src/vec/exec/scan/vmeta_scan_node.h             | 19 +++++-
 be/src/vec/exec/scan/vmeta_scanner.cpp             | 32 +++++++++-
 be/src/vec/exec/scan/vmeta_scanner.h               | 26 +++++++-
 be/src/vec/exec/scan/vscan_node.cpp                | 34 ++++++++++-
 be/src/vec/exec/scan/vscan_node.h                  | 48 +++++++++++++--
 be/src/vec/exec/scan/vscanner.cpp                  |  7 +++
 be/src/vec/exec/scan/vscanner.h                    | 19 +++++-
 be/src/vec/exec/vaggregation_node.cpp              | 23 ++++++++
 be/src/vec/exec/vaggregation_node.h                | 42 ++++++++++++-
 be/src/vec/exec/vanalytic_eval_node.cpp            | 24 ++++++++
 be/src/vec/exec/vanalytic_eval_node.h              | 29 ++++++++-
 be/src/vec/exec/varrow_scanner.cpp                 | 39 +++++++++++-
 be/src/vec/exec/varrow_scanner.h                   | 32 +++++++---
 be/src/vec/exec/vassert_num_rows_node.cpp          | 18 +++++-
 be/src/vec/exec/vassert_num_rows_node.h            | 12 +++-
 be/src/vec/exec/vdata_gen_scan_node.cpp            | 14 ++++-
 be/src/vec/exec/vdata_gen_scan_node.h              | 11 +++-
 be/src/vec/exec/vempty_set_node.cpp                | 11 ++++
 be/src/vec/exec/vempty_set_node.h                  |  8 +++
 be/src/vec/exec/vexchange_node.cpp                 | 17 ++++--
 be/src/vec/exec/vexchange_node.h                   | 14 ++++-
 be/src/vec/exec/vjdbc_connector.cpp                | 30 ++++++++--
 be/src/vec/exec/vjdbc_connector.h                  | 17 +++++-
 be/src/vec/exec/vmysql_scan_node.cpp               |  3 +-
 be/src/vec/exec/vparquet_scanner.cpp               | 13 ++++
 be/src/vec/exec/vparquet_scanner.h                 | 28 +++++----
 be/src/vec/exec/vrepeat_node.cpp                   | 22 +++++++
 be/src/vec/exec/vrepeat_node.h                     | 11 ++++
 be/src/vec/exec/vschema_scan_node.cpp              | 34 ++++++++---
 be/src/vec/exec/vschema_scan_node.h                | 13 +++-
 be/src/vec/exec/vselect_node.cpp                   | 16 +++++
 be/src/vec/exec/vselect_node.h                     |  7 +++
 be/src/vec/exec/vset_operation_node.cpp            | 31 ++++++++++
 be/src/vec/exec/vset_operation_node.h              | 31 ++++++++--
 be/src/vec/exec/vsort_node.cpp                     | 28 +++++++--
 be/src/vec/exec/vsort_node.h                       | 23 +++++++-
 be/src/vec/exec/vtable_function_node.cpp           | 17 ++++++
 be/src/vec/exec/vtable_function_node.h             | 24 ++++++++
 be/src/vec/exec/vunion_node.cpp                    | 19 +++++-
 be/src/vec/exec/vunion_node.h                      | 17 +++++-
 .../lambda_function/varray_filter_function.cpp     | 22 ++++++-
 .../exprs/lambda_function/varray_map_function.cpp  | 22 ++++++-
 .../table_function/table_function_factory.cpp      |  8 +++
 .../exprs/table_function/table_function_factory.h  |  9 +--
 be/src/vec/exprs/table_function/vexplode.cpp       | 10 ++++
 be/src/vec/exprs/table_function/vexplode.h         | 14 +++--
 .../vec/exprs/table_function/vexplode_bitmap.cpp   | 11 ++++
 be/src/vec/exprs/table_function/vexplode_bitmap.h  | 13 +++-
 .../exprs/table_function/vexplode_json_array.cpp   | 10 ++++
 .../vec/exprs/table_function/vexplode_json_array.h | 18 +++++-
 .../vec/exprs/table_function/vexplode_numbers.cpp  | 11 ++++
 be/src/vec/exprs/table_function/vexplode_numbers.h | 16 ++++-
 be/src/vec/exprs/table_function/vexplode_split.cpp | 13 +++-
 be/src/vec/exprs/table_function/vexplode_split.h   | 17 +++++-
 be/src/vec/exprs/varray_literal.cpp                | 21 +++++++
 be/src/vec/exprs/varray_literal.h                  |  6 ++
 be/src/vec/exprs/vbitmap_predicate.cpp             | 27 +++++++++
 be/src/vec/exprs/vbitmap_predicate.h               | 19 ++++++
 be/src/vec/exprs/vbloom_predicate.cpp              | 25 ++++++++
 be/src/vec/exprs/vbloom_predicate.h                | 17 ++++++
 be/src/vec/exprs/vcase_expr.cpp                    | 22 ++++++-
 be/src/vec/exprs/vcase_expr.h                      | 18 +++++-
 be/src/vec/exprs/vcast_expr.cpp                    | 21 ++++++-
 be/src/vec/exprs/vcast_expr.h                      | 17 ++++++
 be/src/vec/exprs/vcolumn_ref.h                     |  1 +
 be/src/vec/exprs/vectorized_agg_fn.cpp             | 27 ++++++++-
 be/src/vec/exprs/vectorized_agg_fn.h               | 21 ++++++-
 be/src/vec/exprs/vectorized_fn_call.cpp            | 26 ++++++--
 be/src/vec/exprs/vectorized_fn_call.h              | 21 ++++++-
 be/src/vec/exprs/vexpr.cpp                         | 19 +++++-
 be/src/vec/exprs/vexpr.h                           | 26 ++++++--
 be/src/vec/exprs/vexpr_context.cpp                 | 15 +++++
 be/src/vec/exprs/vexpr_context.h                   | 13 +++-
 be/src/vec/exprs/vin_predicate.cpp                 | 25 ++++++--
 be/src/vec/exprs/vin_predicate.h                   | 15 +++++
 be/src/vec/exprs/vinfo_func.cpp                    | 21 ++++++-
 be/src/vec/exprs/vinfo_func.h                      |  9 ++-
 be/src/vec/exprs/vliteral.cpp                      | 23 +++++++-
 be/src/vec/exprs/vliteral.h                        | 10 +++-
 be/src/vec/exprs/vmap_literal.cpp                  | 20 +++++++
 be/src/vec/exprs/vmap_literal.h                    |  6 ++
 be/src/vec/exprs/vruntimefilter_wrapper.cpp        | 25 ++++++--
 be/src/vec/exprs/vruntimefilter_wrapper.h          | 20 +++++++
 be/src/vec/exprs/vschema_change_expr.cpp           | 19 ++++++
 be/src/vec/exprs/vschema_change_expr.h             | 21 ++++++-
 be/src/vec/exprs/vslot_ref.cpp                     | 14 +++++
 be/src/vec/exprs/vslot_ref.h                       | 13 +++-
 be/src/vec/exprs/vstruct_literal.cpp               | 16 +++++
 be/src/vec/exprs/vstruct_literal.h                 |  6 ++
 be/src/vec/exprs/vtuple_is_null_predicate.cpp      | 20 +++++--
 be/src/vec/exprs/vtuple_is_null_predicate.h        | 16 +++++
 .../functions/array/function_array_aggregation.cpp | 14 ++++-
 .../vec/functions/array/function_array_apply.cpp   | 41 ++++++++++---
 .../vec/functions/array/function_array_compact.h   | 23 +++++++-
 .../vec/functions/array/function_array_concat.cpp  | 20 +++++++
 .../functions/array/function_array_constructor.cpp | 29 +++++++--
 .../functions/array/function_array_difference.cpp  |  1 -
 .../functions/array/function_array_difference.h    | 25 ++++++++
 .../vec/functions/array/function_array_distinct.h  | 32 +++++++++-
 .../vec/functions/array/function_array_element.h   | 25 +++++++-
 .../functions/array/function_array_enumerate.cpp   | 41 ++++++++++---
 .../array/function_array_enumerate_uniq.cpp        | 56 ++++++++++++++----
 .../vec/functions/array/function_array_except.cpp  |  5 ++
 .../vec/functions/array/function_array_exists.cpp  | 37 ++++++++----
 .../functions/array/function_array_first_index.cpp | 36 +++++++----
 be/src/vec/functions/array/function_array_index.h  | 22 ++++++-
 .../functions/array/function_array_intersect.cpp   |  5 ++
 .../vec/functions/array/function_array_popback.cpp | 28 +++++++--
 .../functions/array/function_array_popfront.cpp    | 28 +++++++--
 .../functions/array/function_array_pushfront.cpp   | 18 +++++-
 .../vec/functions/array/function_array_range.cpp   | 24 +++++++-
 be/src/vec/functions/array/function_array_remove.h | 29 ++++++++-
 .../vec/functions/array/function_array_shuffle.cpp | 27 +++++++--
 be/src/vec/functions/array/function_array_size.h   | 25 +++++++-
 be/src/vec/functions/array/function_array_slice.h  | 25 ++++++--
 be/src/vec/functions/array/function_array_sort.cpp |  2 +
 be/src/vec/functions/array/function_array_sort.h   | 20 ++++++-
 .../vec/functions/array/function_array_sortby.cpp  | 24 +++++++-
 .../vec/functions/array/function_array_union.cpp   |  5 ++
 .../vec/functions/array/function_array_utils.cpp   |  9 +++
 be/src/vec/functions/array/function_array_utils.h  | 11 +++-
 .../array/function_array_with_constant.cpp         | 32 ++++++++--
 be/src/vec/functions/array/function_array_zip.cpp  | 29 ++++++++-
 .../vec/functions/array/function_arrays_overlap.h  | 37 +++++++++++-
 be/src/vec/functions/comparison_equal_for_null.cpp | 30 ++++++++--
 be/src/vec/functions/comparison_equals.cpp         |  3 +
 be/src/vec/functions/comparison_greater.cpp        |  3 +
 be/src/vec/functions/comparison_less.cpp           |  3 +
 be/src/vec/functions/divide.cpp                    |  8 +++
 be/src/vec/functions/function.cpp                  | 10 +++-
 be/src/vec/functions/function.h                    | 12 ++++
 be/src/vec/functions/function_bit.cpp              |  9 +++
 be/src/vec/functions/function_bitmap.cpp           | 42 +++++++++++++
 be/src/vec/functions/function_bitmap_variadic.cpp  | 31 +++++++++-
 be/src/vec/functions/function_case.cpp             |  2 +
 be/src/vec/functions/function_case.h               | 34 +++++++++--
 be/src/vec/functions/function_cast.h               | 57 ++++++++++++++++--
 be/src/vec/functions/function_coalesce.cpp         | 33 ++++++++++-
 be/src/vec/functions/function_conv.cpp             | 30 +++++++++-
 be/src/vec/functions/function_convert_tz.cpp       |  2 +
 be/src/vec/functions/function_convert_tz.h         | 39 +++++++++++-
 .../function_date_or_datetime_computation.h        | 26 +++++++-
 .../function_date_or_datetime_computation_v2.cpp   |  1 +
 .../function_date_or_datetime_to_string.cpp        |  3 +-
 .../function_date_or_datetime_to_string.h          | 29 ++++++++-
 .../vec/functions/function_datetime_floor_ceil.cpp | 48 +++++++++++++++
 .../function_datetime_string_to_string.cpp         |  2 +
 .../functions/function_datetime_string_to_string.h | 23 +++++++-
 be/src/vec/functions/function_encryption.cpp       | 33 +++++++++++
 be/src/vec/functions/function_fake.cpp             | 10 ++++
 be/src/vec/functions/function_fake.h               | 14 +++++
 be/src/vec/functions/function_grouping.h           | 20 +++++++
 be/src/vec/functions/function_hash.cpp             | 19 ++++++
 be/src/vec/functions/function_hash.h               | 10 +---
 be/src/vec/functions/function_helpers.cpp          | 12 ++++
 be/src/vec/functions/function_helpers.h            |  8 ++-
 be/src/vec/functions/function_hex.cpp              | 27 +++++++++
 be/src/vec/functions/function_ifnull.h             | 26 ++++++--
 be/src/vec/functions/function_java_udf.cpp         | 21 ++++---
 be/src/vec/functions/function_java_udf.h           | 16 ++++-
 be/src/vec/functions/function_json.cpp             | 31 ++++++++++
 be/src/vec/functions/function_jsonb.cpp            | 42 ++++++++++---
 be/src/vec/functions/function_map.cpp              | 28 ++++++++-
 be/src/vec/functions/function_math_unary.h         |  3 +-
 be/src/vec/functions/function_nonnullable.cpp      | 20 +++++--
 be/src/vec/functions/function_quantile_state.cpp   | 42 +++++++++++--
 be/src/vec/functions/function_regexp.cpp           | 24 +++++++-
 be/src/vec/functions/function_rpc.cpp              | 11 +++-
 be/src/vec/functions/function_rpc.h                | 24 +++++++-
 be/src/vec/functions/function_running_difference.h | 29 +++++----
 be/src/vec/functions/function_string.cpp           |  6 +-
 be/src/vec/functions/function_string.h             | 45 ++++++++++++--
 be/src/vec/functions/function_struct.cpp           | 26 +++++++-
 be/src/vec/functions/function_timestamp.cpp        | 31 ++++++++++
 be/src/vec/functions/function_utility.cpp          | 29 +++++++++
 be/src/vec/functions/function_width_bucket.cpp     | 22 ++++++-
 be/src/vec/functions/functions_geo.cpp             | 16 ++++-
 be/src/vec/functions/functions_geo.h               | 19 +++++-
 be/src/vec/functions/functions_logical.cpp         | 20 +++++--
 be/src/vec/functions/functions_logical.h           | 17 +++++-
 .../functions/functions_multi_string_position.cpp  | 30 +++++++++-
 .../functions/functions_multi_string_search.cpp    | 38 +++++++++---
 be/src/vec/functions/hll_cardinality.cpp           | 29 ++++++++-
 be/src/vec/functions/hll_empty.cpp                 |  6 +-
 be/src/vec/functions/hll_hash.cpp                  |  8 +++
 be/src/vec/functions/if.cpp                        | 37 +++++++++++-
 be/src/vec/functions/in.cpp                        |  2 +-
 be/src/vec/functions/in.h                          | 27 ++++++++-
 be/src/vec/functions/int_div.cpp                   |  2 +
 be/src/vec/functions/int_div.h                     |  7 +--
 be/src/vec/functions/is_not_null.cpp               | 23 ++++++++
 be/src/vec/functions/is_null.cpp                   | 19 ++++++
 be/src/vec/functions/least_greast.cpp              | 24 +++++++-
 be/src/vec/functions/like.cpp                      | 16 +++++
 be/src/vec/functions/like.h                        | 29 ++++++---
 be/src/vec/functions/match.cpp                     | 25 ++++++--
 be/src/vec/functions/math.cpp                      | 31 ++++++++++
 be/src/vec/functions/minus.cpp                     |  4 ++
 be/src/vec/functions/modulo.cpp                    |  9 ++-
 be/src/vec/functions/multiply.cpp                  |  9 ++-
 be/src/vec/functions/nullif.cpp                    | 30 ++++++++--
 be/src/vec/functions/plus.cpp                      |  4 ++
 be/src/vec/functions/random.cpp                    | 18 ++++++
 be/src/vec/functions/round.h                       |  3 +-
 be/src/vec/functions/time_of_function.cpp          | 10 +++-
 be/src/vec/functions/to_time_function.cpp          | 10 ++++
 be/src/vec/functions/url/domain.h                  |  3 +-
 be/src/vec/functions/url/function_url.cpp          |  2 +
 be/src/vec/functions/uuid.cpp                      | 21 ++++++-
 be/src/vec/io/io_helper.h                          |  2 +-
 be/src/vec/json/json_parser.cpp                    |  8 +++
 be/src/vec/json/json_parser.h                      | 16 ++++-
 be/src/vec/json/parse2column.cpp                   | 38 +++++++++---
 be/src/vec/json/parse2column.h                     | 18 +++++-
 be/src/vec/json/path_in_data.cpp                   |  9 +--
 be/src/vec/json/path_in_data.h                     | 11 +++-
 be/src/vec/json/simd_json_parser.h                 |  5 +-
 be/src/vec/jsonb/serialize.cpp                     | 24 +++++++-
 be/src/vec/jsonb/serialize.h                       | 12 +++-
 be/src/vec/olap/block_reader.cpp                   | 27 +++++++++
 be/src/vec/olap/block_reader.h                     | 12 ++++
 be/src/vec/olap/olap_data_convertor.cpp            | 18 ++++++
 be/src/vec/olap/olap_data_convertor.h              | 33 +++++++++--
 be/src/vec/olap/vcollect_iterator.cpp              | 27 ++++++++-
 be/src/vec/olap/vcollect_iterator.h                | 14 +++++
 be/src/vec/olap/vertical_block_reader.cpp          | 20 ++++++-
 be/src/vec/olap/vertical_block_reader.h            | 21 ++++++-
 be/src/vec/olap/vertical_merge_iterator.cpp        | 16 +++++
 be/src/vec/olap/vertical_merge_iterator.h          | 16 +++++
 be/src/vec/olap/vgeneric_iterators.cpp             | 13 +++-
 be/src/vec/olap/vgeneric_iterators.h               | 23 +++++++-
 .../vec/runtime/shared_hash_table_controller.cpp   |  4 ++
 be/src/vec/runtime/shared_hash_table_controller.h  |  8 ++-
 be/src/vec/runtime/vdata_stream_mgr.cpp            | 17 ++++--
 be/src/vec/runtime/vdata_stream_mgr.h              |  6 +-
 be/src/vec/runtime/vdata_stream_recvr.cpp          | 12 +++-
 be/src/vec/runtime/vdata_stream_recvr.h            | 31 +++++++---
 be/src/vec/runtime/vdatetime_value.cpp             | 12 ++--
 be/src/vec/runtime/vdatetime_value.h               | 15 ++++-
 be/src/vec/runtime/vfile_result_writer.cpp         | 27 ++++++++-
 be/src/vec/runtime/vfile_result_writer.h           | 26 +++++++-
 be/src/vec/runtime/vorc_writer.cpp                 | 27 ++++++++-
 be/src/vec/runtime/vorc_writer.h                   | 22 +++++--
 be/src/vec/runtime/vparquet_writer.cpp             | 27 ++++++++-
 be/src/vec/runtime/vparquet_writer.h               | 34 +++++++----
 be/src/vec/runtime/vsorted_run_merger.cpp          | 13 +++-
 be/src/vec/runtime/vsorted_run_merger.h            | 13 +++-
 be/src/vec/sink/vdata_stream_sender.cpp            | 23 +++++++-
 be/src/vec/sink/vdata_stream_sender.h              | 36 ++++++++---
 be/src/vec/sink/vjdbc_table_sink.cpp               | 16 ++++-
 be/src/vec/sink/vjdbc_table_sink.h                 | 10 ++++
 be/src/vec/sink/vmemory_scratch_sink.cpp           | 20 +++++--
 be/src/vec/sink/vmemory_scratch_sink.h             | 15 +++--
 be/src/vec/sink/vmysql_result_writer.cpp           | 34 ++++++++++-
 be/src/vec/sink/vmysql_result_writer.h             | 14 ++++-
 be/src/vec/sink/vmysql_table_sink.cpp              | 10 +++-
 be/src/vec/sink/vmysql_table_sink.h                |  8 +++
 be/src/vec/sink/vmysql_table_writer.cpp            | 21 ++++++-
 be/src/vec/sink/vmysql_table_writer.h              |  2 +
 be/src/vec/sink/vodbc_table_sink.cpp               | 13 +++-
 be/src/vec/sink/vodbc_table_sink.h                 | 10 ++++
 be/src/vec/sink/vresult_file_sink.cpp              | 18 ++++++
 be/src/vec/sink/vresult_file_sink.h                | 21 +++++++
 be/src/vec/sink/vresult_sink.cpp                   | 16 +++++
 be/src/vec/sink/vresult_sink.h                     | 22 +++++--
 be/src/vec/sink/vresult_writer.h                   |  5 +-
 be/src/vec/sink/vtable_sink.cpp                    |  9 +++
 be/src/vec/sink/vtable_sink.h                      |  9 ++-
 be/src/vec/sink/vtablet_sink.cpp                   | 40 ++++++++++++-
 be/src/vec/sink/vtablet_sink.h                     | 50 +++++++++++++---
 be/src/vec/utils/arrow_column_to_doris_column.cpp  | 25 ++++++--
 be/src/vec/utils/arrow_column_to_doris_column.h    | 16 +++--
 be/src/vec/utils/util.hpp                          |  1 +
 be/test/http/http_client_test.cpp                  |  2 +
 be/test/io/cache/remote_file_cache_test.cpp        |  1 +
 be/test/olap/delete_handler_test.cpp               |  3 +
 be/test/olap/delta_writer_test.cpp                 |  3 +
 .../olap/engine_storage_migration_task_test.cpp    |  1 +
 be/test/olap/ordered_data_compaction_test.cpp      |  1 +
 be/test/olap/remote_rowset_gc_test.cpp             |  3 +
 .../olap/rowset/segment_v2/encoding_info_test.cpp  |  1 +
 be/test/olap/tablet_cooldown_test.cpp              |  3 +
 be/test/olap/tablet_meta_manager_test.cpp          |  2 +
 be/test/olap/tablet_mgr_test.cpp                   |  1 +
 be/test/olap/tablet_schema_helper.cpp              |  2 +
 be/test/olap/timestamped_version_tracker_test.cpp  |  2 +
 be/test/runtime/external_scan_context_mgr_test.cpp |  1 +
 be/test/runtime/fragment_mgr_test.cpp              |  1 +
 be/test/runtime/result_queue_mgr_test.cpp          |  1 +
 .../runtime/routine_load_task_executor_test.cpp    |  1 +
 be/test/testutil/desc_tbl_builder.cc               |  1 +
 be/test/testutil/run_all_tests.cpp                 |  1 +
 be/test/util/block_compression_test.cpp            |  1 +
 be/test/util/brpc_client_cache_test.cpp            |  2 +
 be/test/util/date_func_test.cpp                    |  2 +
 .../vec/aggregate_functions/agg_replace_test.cpp   |  3 +
 be/test/vec/core/block_spill_test.cpp              |  1 +
 be/test/vec/core/block_test.cpp                    |  1 +
 be/test/vec/exec/parquet/parquet_reader_test.cpp   |  2 +
 be/test/vec/exec/parquet/parquet_thrift_test.cpp   |  1 +
 be/test/vec/exec/vtablet_sink_test.cpp             |  1 +
 be/test/vec/function/function_test_util.h          |  3 +
 be/test/vec/jsonb/serialize_test.cpp               |  3 +
 be/test/vec/olap/vertical_compaction_test.cpp      |  1 +
 1225 files changed, 14072 insertions(+), 2978 deletions(-)

diff --git a/be/src/agent/agent_server.h b/be/src/agent/agent_server.h
index 11521eb09a..3aebc3d1f7 100644
--- a/be/src/agent/agent_server.h
+++ b/be/src/agent/agent_server.h
@@ -18,14 +18,11 @@
 #pragma once
 
 #include <butil/macros.h>
-#include <gen_cpp/AgentService_types.h>
 
 #include <memory>
 #include <string>
 #include <vector>
 
-#include "runtime/exec_env.h"
-
 namespace doris {
 
 class TaskWorkerPool;
diff --git a/be/src/agent/heartbeat_server.h b/be/src/agent/heartbeat_server.h
index 65e228dd8c..e08603043f 100644
--- a/be/src/agent/heartbeat_server.h
+++ b/be/src/agent/heartbeat_server.h
@@ -24,8 +24,6 @@
 #include <mutex>
 
 #include "common/status.h"
-#include "olap/olap_define.h"
-#include "runtime/exec_env.h"
 
 namespace doris {
 class ExecEnv;
@@ -34,7 +32,6 @@ class TMasterInfo;
 
 const uint32_t HEARTBEAT_INTERVAL = 10;
 class StorageEngine;
-class Status;
 class ThriftServer;
 
 class HeartbeatServer : public HeartbeatServiceIf {
diff --git a/be/src/agent/task_worker_pool.cpp b/be/src/agent/task_worker_pool.cpp
index ab7877fbf2..f93cee6a6b 100644
--- a/be/src/agent/task_worker_pool.cpp
+++ b/be/src/agent/task_worker_pool.cpp
@@ -43,7 +43,7 @@
 #include "common/logging.h"
 #include "common/status.h"
 #include "gutil/ref_counted.h"
-#include "gutil/stringprintf.h"
+#include "gutil/strings/numbers.h"
 #include "gutil/strings/substitute.h"
 #include "io/fs/file_system.h"
 #include "io/fs/local_file_system.h"
diff --git a/be/src/agent/task_worker_pool.h b/be/src/agent/task_worker_pool.h
index cd9b274d98..2f90f7b685 100644
--- a/be/src/agent/task_worker_pool.h
+++ b/be/src/agent/task_worker_pool.h
@@ -19,7 +19,6 @@
 
 #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>
 
@@ -31,11 +30,8 @@
 #include <mutex>
 #include <set>
 #include <string>
-#include <utility>
-#include <vector>
 
 #include "common/status.h"
-#include "olap/data_dir.h"
 #include "olap/tablet.h"
 #include "util/countdown_latch.h"
 #include "util/metrics.h"
diff --git a/be/src/agent/topic_listener.h b/be/src/agent/topic_listener.h
index 1ad66b31a6..0ef9c597f1 100644
--- a/be/src/agent/topic_listener.h
+++ b/be/src/agent/topic_listener.h
@@ -17,7 +17,7 @@
 
 #pragma once
 
-#include "gen_cpp/AgentService_types.h"
+#include <gen_cpp/AgentService_types.h>
 
 namespace doris {
 
diff --git a/be/src/agent/topic_subscriber.h b/be/src/agent/topic_subscriber.h
index 3151cbe54c..490bd35d2b 100644
--- a/be/src/agent/topic_subscriber.h
+++ b/be/src/agent/topic_subscriber.h
@@ -20,13 +20,9 @@
 #include <gen_cpp/AgentService_types.h>
 
 #include <map>
-#include <mutex>
 #include <shared_mutex>
-#include <thread>
 #include <vector>
 
-#include "agent/topic_listener.h"
-
 namespace doris {
 class TopicListener;
 
diff --git a/be/src/agent/user_resource_listener.h b/be/src/agent/user_resource_listener.h
index b26ae3f279..6fd25bef67 100644
--- a/be/src/agent/user_resource_listener.h
+++ b/be/src/agent/user_resource_listener.h
@@ -18,13 +18,9 @@
 #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 "runtime/exec_env.h"
 
 namespace doris {
 
diff --git a/be/src/agent/utils.cpp b/be/src/agent/utils.cpp
index 0e91eeaa49..19792fd1f8 100644
--- a/be/src/agent/utils.cpp
+++ b/be/src/agent/utils.cpp
@@ -17,7 +17,8 @@
 
 #include "agent/utils.h"
 
-#include <errno.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
 #include <gen_cpp/FrontendService.h>
 #include <gen_cpp/HeartbeatService_types.h>
 #include <gen_cpp/Types_types.h>
diff --git a/be/src/agent/utils.h b/be/src/agent/utils.h
index 8cd1895d6a..eea8f9f8cf 100644
--- a/be/src/agent/utils.h
+++ b/be/src/agent/utils.h
@@ -18,15 +18,11 @@
 #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;
diff --git a/be/src/common/configbase.cpp b/be/src/common/configbase.cpp
index 066aa0352d..d965687a23 100644
--- a/be/src/common/configbase.cpp
+++ b/be/src/common/configbase.cpp
@@ -19,7 +19,8 @@
 
 #include <algorithm>
 #include <cctype>
-#include <cerrno>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <cerrno> // IWYU pragma: keep
 #include <cstdlib>
 #include <cstring>
 #include <fstream> // IWYU pragma: keep
@@ -36,6 +37,7 @@
 
 #define __IN_CONFIGBASE_CPP__
 #include "common/config.h" // IWYU pragma: keep
+
 #undef __IN_CONFIGBASE_CPP__
 
 #include "common/status.h"
diff --git a/be/src/common/daemon.cpp b/be/src/common/daemon.cpp
index 6ef0d751f3..5c832cfd77 100644
--- a/be/src/common/daemon.cpp
+++ b/be/src/common/daemon.cpp
@@ -17,7 +17,8 @@
 
 #include "common/daemon.h"
 
-#include <bthread/errno.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
 #include <gflags/gflags.h>
 #include <gperftools/malloc_extension.h> // IWYU pragma: keep
 // IWYU pragma: no_include <bits/std_abs.h>
@@ -31,7 +32,6 @@
 // IWYU pragma: no_include <bits/chrono.h>
 #include <chrono> // IWYU pragma: keep
 #include <map>
-#include <memory>
 #include <ostream>
 #include <set>
 #include <string>
@@ -41,6 +41,7 @@
 #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/load_channel_mgr.h"
@@ -53,8 +54,10 @@
 #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/daemon.h b/be/src/common/daemon.h
index ef7ece4620..6fd287a537 100644
--- a/be/src/common/daemon.h
+++ b/be/src/common/daemon.h
@@ -17,7 +17,6 @@
 
 #pragma once
 
-#include <memory>
 #include <vector>
 
 #include "gutil/ref_counted.h"
@@ -27,7 +26,6 @@
 namespace doris {
 
 struct StorePath;
-class Thread;
 
 class Daemon {
 public:
diff --git a/be/src/common/signal_handler.h b/be/src/common/signal_handler.h
index 85da4e7096..3be54d0d39 100644
--- a/be/src/common/signal_handler.h
+++ b/be/src/common/signal_handler.h
@@ -33,14 +33,13 @@
 
 #pragma once
 
+#include <gen_cpp/version.h>
 #include <glog/logging.h>
 #include <gutil/macros.h>
 
 #include <boost/stacktrace.hpp>
 #include <csignal>
 #include <ctime>
-
-#include "gen_cpp/version.h"
 #ifdef HAVE_UCONTEXT_H
 #include <ucontext.h>
 #endif
diff --git a/be/src/common/status.h b/be/src/common/status.h
index d989ba12c3..9f71f167ff 100644
--- a/be/src/common/status.h
+++ b/be/src/common/status.h
@@ -15,7 +15,8 @@
 #include <string_view>
 #include <utility>
 
-#include "common/compiler_util.h"
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #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 6696d5489c..8e0559ca78 100644
--- a/be/src/exec/arrow/arrow_reader.cpp
+++ b/be/src/exec/arrow/arrow_reader.cpp
@@ -16,9 +16,7 @@
 // under the License.
 #include "exec/arrow/arrow_reader.h"
 
-#include <arrow/buffer.h>
 #include <arrow/record_batch.h>
-#include <opentelemetry/common/threadlocal.h>
 
 #include <algorithm>
 // IWYU pragma: no_include <bits/chrono.h>
@@ -26,6 +24,8 @@
 #include <ostream>
 #include <utility>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/logging.h"
 #include "io/fs/file_reader.h"
 #include "runtime/descriptors.h"
diff --git a/be/src/exec/arrow/arrow_reader.h b/be/src/exec/arrow/arrow_reader.h
index e685e7edaf..ad4c40d26b 100644
--- a/be/src/exec/arrow/arrow_reader.h
+++ b/be/src/exec/arrow/arrow_reader.h
@@ -17,20 +17,8 @@
 
 #pragma once
 
-#include <arrow/api.h>
-#include <arrow/buffer.h>
-#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>
@@ -47,7 +35,6 @@
 
 #include "common/config.h"
 #include "common/status.h"
-#include "io/fs/file_reader.h"
 #include "io/fs/file_reader_writer_fwd.h"
 #include "vec/exec/format/generic_reader.h"
 
@@ -58,12 +45,8 @@ class RecordBatchReader;
 
 namespace doris {
 
-class ExecEnv;
-class TBrokerRangeDesc;
-class TNetworkAddress;
 class RuntimeState;
 class SlotDescriptor;
-class FileReader;
 class TupleDescriptor;
 
 namespace vectorized {
diff --git a/be/src/exec/arrow/parquet_reader.cpp b/be/src/exec/arrow/parquet_reader.cpp
index f0a1755324..4b924c0275 100644
--- a/be/src/exec/arrow/parquet_reader.cpp
+++ b/be/src/exec/arrow/parquet_reader.cpp
@@ -20,14 +20,12 @@
 #include <arrow/result.h>
 #include <arrow/status.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 <atomic>
 // IWYU pragma: no_include <bits/chrono.h>
 #include <chrono> // IWYU pragma: keep
@@ -38,6 +36,8 @@
 #include <ostream>
 #include <thread>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/logging.h"
 #include "common/status.h"
 #include "util/string_util.h"
diff --git a/be/src/exec/arrow/parquet_reader.h b/be/src/exec/arrow/parquet_reader.h
index 4f57fdc7b9..ac60a25eae 100644
--- a/be/src/exec/arrow/parquet_reader.h
+++ b/be/src/exec/arrow/parquet_reader.h
@@ -17,34 +17,14 @@
 
 #pragma once
 
-#include <arrow/api.h>
-#include <arrow/buffer.h>
-#include <arrow/io/api.h>
-#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>
-#include <parquet/arrow/writer.h>
-#include <parquet/exception.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 "exec/arrow/arrow_reader.h"
 #include "io/fs/file_reader_writer_fwd.h"
@@ -58,13 +38,8 @@ class FileMetaData;
 
 namespace doris {
 
-class ExecEnv;
-class TBrokerRangeDesc;
-class TNetworkAddress;
 class RuntimeState;
 class SlotDescriptor;
-class FileReader;
-class RowGroupReader;
 class TupleDescriptor;
 
 // Reader of parquet file
diff --git a/be/src/exec/base_scanner.cpp b/be/src/exec/base_scanner.cpp
index 20633d2c48..1f9b49a0f8 100644
--- a/be/src/exec/base_scanner.cpp
+++ b/be/src/exec/base_scanner.cpp
@@ -22,16 +22,18 @@
 #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 <algorithm>
 #include <boost/iterator/iterator_facade.hpp>
 #include <iterator>
 #include <map>
 #include <string>
 #include <utility>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/consts.h"
 #include "gutil/casts.h"
 #include "runtime/define_primitive_type.h"
diff --git a/be/src/exec/base_scanner.h b/be/src/exec/base_scanner.h
index 291f7d653d..ee4ae973ef 100644
--- a/be/src/exec/base_scanner.h
+++ b/be/src/exec/base_scanner.h
@@ -33,12 +33,9 @@
 #include "vec/common/schema_util.h"
 #include "vec/core/block.h"
 #include "vec/exprs/vexpr.h"
-#include "vec/exprs/vexpr_context.h"
 
 namespace doris {
 
-class TupleDescriptor;
-class RowDescriptor;
 class RuntimeState;
 class TBrokerRangeDesc;
 class TBrokerScanRangeParams;
@@ -46,7 +43,6 @@ class TNetworkAddress;
 
 namespace vectorized {
 class VExprContext;
-class IColumn;
 
 using MutableColumnPtr = IColumn::MutablePtr;
 } // namespace vectorized
diff --git a/be/src/exec/data_sink.h b/be/src/exec/data_sink.h
index 3ea5da0c3c..ee847da138 100644
--- a/be/src/exec/data_sink.h
+++ b/be/src/exec/data_sink.h
@@ -20,8 +20,6 @@
 
 #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>
@@ -30,8 +28,6 @@
 #include <vector>
 
 #include "common/status.h"
-#include "runtime/descriptors.h"
-#include "runtime/query_statistics.h"
 #include "util/runtime_profile.h"
 #include "util/telemetry/telemetry.h"
 
diff --git a/be/src/exec/es/es_scan_reader.h b/be/src/exec/es/es_scan_reader.h
index 95b3e37980..a29dced15f 100644
--- a/be/src/exec/es/es_scan_reader.h
+++ b/be/src/exec/es/es_scan_reader.h
@@ -21,7 +21,6 @@
 #include <memory>
 #include <string>
 
-#include "exec/es/es_scroll_parser.h"
 #include "http/http_client.h"
 
 namespace doris {
diff --git a/be/src/exec/es/es_scroll_parser.h b/be/src/exec/es/es_scroll_parser.h
index d4edcb9ed2..be3f9fa8c5 100644
--- a/be/src/exec/es/es_scroll_parser.h
+++ b/be/src/exec/es/es_scroll_parser.h
@@ -24,8 +24,6 @@
 #include <vector>
 
 #include "rapidjson/document.h"
-#include "runtime/descriptors.h"
-#include "vec/core/block.h"
 #include "vec/data_types/data_type.h"
 
 namespace doris {
diff --git a/be/src/exec/exec_node.cpp b/be/src/exec/exec_node.cpp
index aced73a595..68360adba2 100644
--- a/be/src/exec/exec_node.cpp
+++ b/be/src/exec/exec_node.cpp
@@ -22,7 +22,6 @@
 
 #include <gen_cpp/Metrics_types.h>
 #include <gen_cpp/PlanNodes_types.h>
-#include <opentelemetry/common/threadlocal.h>
 #include <thrift/protocol/TDebugProtocol.h>
 
 #include <map>
@@ -30,6 +29,8 @@
 #include <typeinfo>
 #include <utility>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/config.h"
 #include "common/logging.h"
 #include "common/object_pool.h"
@@ -43,7 +44,6 @@
 #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"
@@ -71,6 +71,7 @@
 #include "vec/exec/vunion_node.h"
 #include "vec/exprs/vexpr.h"
 #include "vec/exprs/vexpr_context.h"
+#include "vec/runtime/vdatetime_value.h"
 #include "vec/utils/util.hpp"
 
 namespace doris {
diff --git a/be/src/exec/exec_node.h b/be/src/exec/exec_node.h
index d5b9688361..68f84934ad 100644
--- a/be/src/exec/exec_node.h
+++ b/be/src/exec/exec_node.h
@@ -35,31 +35,21 @@
 #include "common/global_types.h"
 #include "common/status.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 {
 class ObjectPool;
-class Counters;
 class RuntimeState;
-class TPlan;
 class MemTracker;
 class QueryStatistics;
 
 namespace vectorized {
-class Block;
-class VExpr;
 class VExprContext;
 } // namespace vectorized
 
 namespace pipeline {
-class PipelineFragmentContext;
-class Pipeline;
 class OperatorBase;
 } // namespace pipeline
 
diff --git a/be/src/exec/olap_common.h b/be/src/exec/olap_common.h
index e160d54fa3..2260dac25c 100644
--- a/be/src/exec/olap_common.h
+++ b/be/src/exec/olap_common.h
@@ -25,12 +25,10 @@
 #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>
diff --git a/be/src/exec/olap_utils.h b/be/src/exec/olap_utils.h
index 610299cc0f..153d4f7963 100644
--- a/be/src/exec/olap_utils.h
+++ b/be/src/exec/olap_utils.h
@@ -17,10 +17,10 @@
 
 #pragma once
 
+#include <gen_cpp/Opcodes_types.h>
 #include <math.h>
 
 #include "common/logging.h"
-#include "gen_cpp/Opcodes_types.h"
 #include "olap/olap_tuple.h"
 #include "runtime/datetime_value.h"
 #include "runtime/primitive_type.h"
diff --git a/be/src/exec/rowid_fetcher.h b/be/src/exec/rowid_fetcher.h
index 19dabdf901..7f789b1c40 100644
--- a/be/src/exec/rowid_fetcher.h
+++ b/be/src/exec/rowid_fetcher.h
@@ -23,7 +23,6 @@
 #include <vector>
 
 #include "common/status.h"
-#include "vec/core/block.h"
 #include "vec/data_types/data_type.h"
 
 namespace doris {
diff --git a/be/src/exec/scan_node.h b/be/src/exec/scan_node.h
index aed701dbe9..6df382a975 100644
--- a/be/src/exec/scan_node.h
+++ b/be/src/exec/scan_node.h
@@ -20,8 +20,6 @@
 
 #pragma once
 
-#include <gen_cpp/PaloInternalService_types.h>
-
 #include <functional>
 #include <string>
 #include <vector>
@@ -32,7 +30,6 @@
 
 namespace doris {
 
-class TScanRange;
 class DescriptorTbl;
 class ObjectPool;
 class RuntimeState;
diff --git a/be/src/exec/schema_scanner.h b/be/src/exec/schema_scanner.h
index bc600bdf58..bc2d7bcfc0 100644
--- a/be/src/exec/schema_scanner.h
+++ b/be/src/exec/schema_scanner.h
@@ -18,7 +18,6 @@
 #pragma once
 
 #include <gen_cpp/Descriptors_types.h>
-#include <gen_cpp/Types_types.h>
 #include <stddef.h>
 #include <stdint.h>
 
@@ -26,11 +25,9 @@
 #include <string>
 #include <vector>
 
-#include "common/object_pool.h"
 #include "common/status.h"
 #include "runtime/define_primitive_type.h"
 #include "util/runtime_profile.h"
-#include "vec/core/block.h"
 
 namespace doris {
 
diff --git a/be/src/exec/schema_scanner/schema_helper.h b/be/src/exec/schema_scanner/schema_helper.h
index d6a340e1e4..72b7a9acf0 100644
--- a/be/src/exec/schema_scanner/schema_helper.h
+++ b/be/src/exec/schema_scanner/schema_helper.h
@@ -17,7 +17,6 @@
 
 #pragma once
 
-#include <gen_cpp/FrontendService_types.h>
 #include <stdint.h>
 
 #include <string>
diff --git a/be/src/exec/schema_scanner/schema_rowsets_scanner.h b/be/src/exec/schema_scanner/schema_rowsets_scanner.h
index 0a8dabc270..7a6b528ec2 100644
--- a/be/src/exec/schema_scanner/schema_rowsets_scanner.h
+++ b/be/src/exec/schema_scanner/schema_rowsets_scanner.h
@@ -19,14 +19,11 @@
 
 #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;
diff --git a/be/src/exec/schema_scanner/schema_tables_scanner.h b/be/src/exec/schema_scanner/schema_tables_scanner.h
index c295fc6ba2..7cdb363774 100644
--- a/be/src/exec/schema_scanner/schema_tables_scanner.h
+++ b/be/src/exec/schema_scanner/schema_tables_scanner.h
@@ -23,7 +23,6 @@
 
 #include "common/status.h"
 #include "exec/schema_scanner.h"
-#include "vec/core/block.h"
 
 namespace doris {
 class RuntimeState;
diff --git a/be/src/exec/schema_scanner/schema_variables_scanner.h b/be/src/exec/schema_scanner/schema_variables_scanner.h
index 2728b70530..d55f234df1 100644
--- a/be/src/exec/schema_scanner/schema_variables_scanner.h
+++ b/be/src/exec/schema_scanner/schema_variables_scanner.h
@@ -20,8 +20,6 @@
 #include <gen_cpp/FrontendService_types.h>
 #include <gen_cpp/Types_types.h>
 
-#include <map>
-#include <string>
 #include <vector>
 
 #include "common/status.h"
diff --git a/be/src/exec/table_connector.cpp b/be/src/exec/table_connector.cpp
index ef0b9db8c3..0a469defca 100644
--- a/be/src/exec/table_connector.cpp
+++ b/be/src/exec/table_connector.cpp
@@ -17,14 +17,13 @@
 
 #include "exec/table_connector.h"
 
-#include <bthread/errno.h>
-#include <errno.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
 #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>
diff --git a/be/src/exec/table_connector.h b/be/src/exec/table_connector.h
index 27d3061e75..8a1cdff7e3 100644
--- a/be/src/exec/table_connector.h
+++ b/be/src/exec/table_connector.h
@@ -21,18 +21,14 @@
 #include <gen_cpp/Types_types.h>
 #include <stdint.h>
 
-#include <boost/format.hpp>
-#include <cstdlib>
 #include <string>
 #include <vector>
 
 #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;
diff --git a/be/src/exec/tablet_info.h b/be/src/exec/tablet_info.h
index 6c9272787d..4840187e56 100644
--- a/be/src/exec/tablet_info.h
+++ b/be/src/exec/tablet_info.h
@@ -32,12 +32,9 @@
 
 #include "common/object_pool.h"
 #include "common/status.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;
diff --git a/be/src/exec/text_converter.cpp b/be/src/exec/text_converter.cpp
index 8249b42a98..1dcec677bf 100644
--- a/be/src/exec/text_converter.cpp
+++ b/be/src/exec/text_converter.cpp
@@ -21,9 +21,11 @@
 #include <sql.h>
 #include <stdint.h>
 
+#include <algorithm>
 #include <ostream>
 
-#include "common/compiler_util.h"
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "olap/hll.h"
 #include "runtime/decimalv2_value.h"
 #include "runtime/define_primitive_type.h"
diff --git a/be/src/exec/text_converter.h b/be/src/exec/text_converter.h
index 0bf3b3f16e..d70cfba982 100644
--- a/be/src/exec/text_converter.h
+++ b/be/src/exec/text_converter.h
@@ -24,9 +24,6 @@
 namespace doris {
 
 class SlotDescriptor;
-class Status;
-struct StringRef;
-class TupleDescriptor;
 
 // Helper class for dealing with text data, e.g., converting text data to
 // numeric types, etc.
diff --git a/be/src/exprs/bloom_filter_func.h b/be/src/exprs/bloom_filter_func.h
index d127a4c19b..eb8ee79e0d 100644
--- a/be/src/exprs/bloom_filter_func.h
+++ b/be/src/exprs/bloom_filter_func.h
@@ -19,6 +19,7 @@
 
 #include "exprs/block_bloom_filter.hpp"
 #include "exprs/runtime_filter.h"
+#include "olap/rowset/segment_v2/bloom_filter.h" // IWYU pragma: keep
 
 namespace doris {
 
@@ -473,4 +474,4 @@ private:
     typename BloomFilterTypeTraits<type>::FindOp dummy;
 };
 
-} // namespace doris
\ No newline at end of file
+} // namespace doris
diff --git a/be/src/exprs/function_filter.h b/be/src/exprs/function_filter.h
index a9c2f264b4..9802f1b408 100644
--- a/be/src/exprs/function_filter.h
+++ b/be/src/exprs/function_filter.h
@@ -19,6 +19,7 @@
 #include <memory>
 
 #include "udf/udf.h"
+#include "vec/common/string_ref.h" // IWYU pragma: keep
 
 namespace doris {
 
diff --git a/be/src/exprs/json_functions.cpp b/be/src/exprs/json_functions.cpp
index ebfc4b0ae8..107217ed4f 100644
--- a/be/src/exprs/json_functions.cpp
+++ b/be/src/exprs/json_functions.cpp
@@ -32,7 +32,8 @@
 #include <string>
 #include <vector>
 
-#include "common/compiler_util.h"
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/logging.h"
 
 namespace doris {
diff --git a/be/src/exprs/json_functions.h b/be/src/exprs/json_functions.h
index 2de0857219..fcec257142 100644
--- a/be/src/exprs/json_functions.h
+++ b/be/src/exprs/json_functions.h
@@ -17,10 +17,9 @@
 
 #pragma once
 
-#include <fmt/core.h>
 #include <fmt/format.h>
 #include <rapidjson/document.h>
-#include <simdjson.h>
+#include <simdjson.h> // IWYU pragma: keep
 
 #include <sstream>
 #include <string>
@@ -28,7 +27,6 @@
 #include <vector>
 
 #include "common/status.h"
-#include "udf/udf.h"
 
 namespace simdjson {
 namespace fallback {
@@ -49,8 +47,6 @@ enum JsonFunctionType {
     JSON_FUN_UNKNOWN //The last
 };
 
-class OpcodeRegistry;
-
 struct JsonPath {
     std::string key; // key of a json object
     int idx;         // array index of a json array, -1 means not set, -2 means *
diff --git a/be/src/exprs/math_functions.cpp b/be/src/exprs/math_functions.cpp
index e76cdde2a5..bbfdc6053d 100644
--- a/be/src/exprs/math_functions.cpp
+++ b/be/src/exprs/math_functions.cpp
@@ -22,12 +22,14 @@
 
 #include <stdlib.h>
 #include <string.h>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 // IWYU pragma: no_include <bits/std_abs.h>
 #include <cmath>
 #include <limits>
 #include <string_view>
 
-#include "common/compiler_util.h"
 #include "udf/udf.h"
 #include "util/string_parser.hpp"
 
diff --git a/be/src/exprs/runtime_filter.h b/be/src/exprs/runtime_filter.h
index 141df632c5..a76b02080f 100644
--- a/be/src/exprs/runtime_filter.h
+++ b/be/src/exprs/runtime_filter.h
@@ -50,15 +50,12 @@ class IOBufAsZeroCopyInputStream;
 namespace doris {
 class ObjectPool;
 class RuntimePredicateWrapper;
-class MemTracker;
 class PPublishFilterRequest;
 class PMergeFilterRequest;
 class TRuntimeFilterDesc;
 class RowDescriptor;
 class PInFilter;
 class PMinMaxFilter;
-class HashJoinNode;
-class RuntimeProfile;
 class BloomFilterFuncBase;
 class BitmapFilterFuncBase;
 class TNetworkAddress;
diff --git a/be/src/exprs/runtime_filter_slots.h b/be/src/exprs/runtime_filter_slots.h
index 71084bacfb..2d3b0c2c73 100644
--- a/be/src/exprs/runtime_filter_slots.h
+++ b/be/src/exprs/runtime_filter_slots.h
@@ -23,6 +23,7 @@
 #include "vec/columns/column_nullable.h"
 #include "vec/columns/columns_number.h"
 #include "vec/common/assert_cast.h"
+#include "vec/core/block.h" // IWYU pragma: keep
 #include "vec/runtime/shared_hash_table_controller.h"
 
 namespace doris {
diff --git a/be/src/exprs/string_functions.h b/be/src/exprs/string_functions.h
index 5a64790032..8ed917b82d 100644
--- a/be/src/exprs/string_functions.h
+++ b/be/src/exprs/string_functions.h
@@ -22,14 +22,9 @@
 
 #include <re2/re2.h>
 
-#include <iomanip>
-#include <locale>
 #include <memory>
-#include <sstream>
 #include <string>
-#include <string_view>
 
-#include "gutil/strings/numbers.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
diff --git a/be/src/geo/ByteOrderValues.h b/be/src/geo/ByteOrderValues.h
index c78f6c8856..50915953e0 100644
--- a/be/src/geo/ByteOrderValues.h
+++ b/be/src/geo/ByteOrderValues.h
@@ -19,8 +19,6 @@
 
 #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.h b/be/src/geo/geo_tobinary.h
index 8b861a519a..ad4ee9d0a4 100644
--- a/be/src/geo/geo_tobinary.h
+++ b/be/src/geo/geo_tobinary.h
@@ -21,10 +21,6 @@
 
 #include <string>
 
-#include "geo/geo_common.h"
-#include "geo/geo_tobinary_type.h"
-#include "geo/wkt_parse_type.h"
-
 struct ToBinaryContext;
 
 namespace doris {
diff --git a/be/src/geo/geo_types.h b/be/src/geo/geo_types.h
index 7416dccb35..e3d16d67c1 100644
--- a/be/src/geo/geo_types.h
+++ b/be/src/geo/geo_types.h
@@ -21,7 +21,6 @@
 
 #include <memory>
 #include <string>
-#include <vector>
 
 #include "geo/geo_common.h"
 #include "geo/wkt_parse_type.h"
diff --git a/be/src/geo/wkb_parse.h b/be/src/geo/wkb_parse.h
index c27537966b..966e290733 100644
--- a/be/src/geo/wkb_parse.h
+++ b/be/src/geo/wkb_parse.h
@@ -22,9 +22,7 @@
 #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;
 
diff --git a/be/src/geo/wkt_parse.h b/be/src/geo/wkt_parse.h
index 0bb999af73..9dfcca98dd 100644
--- a/be/src/geo/wkt_parse.h
+++ b/be/src/geo/wkt_parse.h
@@ -19,8 +19,6 @@
 
 #include <stddef.h>
 
-#include <memory>
-
 #include "geo/geo_common.h"
 
 namespace doris {
diff --git a/be/src/gutil/atomicops.h b/be/src/gutil/atomicops.h
index 7873a39170..4c6d93e28c 100644
--- a/be/src/gutil/atomicops.h
+++ b/be/src/gutil/atomicops.h
@@ -72,13 +72,13 @@
 
 // ThreadSanitizer provides own implementation of atomicops.
 #if defined(THREAD_SANITIZER)
-#include "gutil/atomicops-internals-tsan.h"
+#include "gutil/atomicops-internals-tsan.h" // IWYU pragma: export
 #elif defined(__GNUC__) && (defined(__i386) || defined(__x86_64__))
-#include "gutil/atomicops-internals-x86.h"
+#include "gutil/atomicops-internals-x86.h" // IWYU pragma: export
 #elif defined(__GNUC__) && GCC_VERSION >= 40700
-#include "gutil/atomicops-internals-gcc.h"
+#include "gutil/atomicops-internals-gcc.h" // IWYU pragma: export
 #elif defined(__clang__) && CLANG_VERSION >= 30400
-#include "gutil/atomicops-internals-gcc.h"
+#include "gutil/atomicops-internals-gcc.h" // IWYU pragma: export
 #else
 #error You need to implement atomic operations for this architecture
 #endif
diff --git a/be/src/http/action/check_tablet_segment_action.h b/be/src/http/action/check_tablet_segment_action.h
index a4c6f422ee..0cc26e8199 100644
--- a/be/src/http/action/check_tablet_segment_action.h
+++ b/be/src/http/action/check_tablet_segment_action.h
@@ -20,7 +20,6 @@
 #include <string>
 
 #include "http/http_handler.h"
-#include "util/easy_json.h"
 
 namespace doris {
 class HttpRequest;
diff --git a/be/src/http/action/checksum_action.h b/be/src/http/action/checksum_action.h
index 5afacbfe6d..4ec478acfc 100644
--- a/be/src/http/action/checksum_action.h
+++ b/be/src/http/action/checksum_action.h
@@ -23,7 +23,6 @@
 
 namespace doris {
 
-class ExecEnv;
 class HttpRequest;
 
 class ChecksumAction : public HttpHandler {
diff --git a/be/src/http/action/download_action.h b/be/src/http/action/download_action.h
index 86bee3e2b1..3965461844 100644
--- a/be/src/http/action/download_action.h
+++ b/be/src/http/action/download_action.h
@@ -21,9 +21,7 @@
 #include <vector>
 
 #include "common/status.h"
-#include "exec/scan_node.h"
 #include "http/http_handler.h"
-#include "runtime/descriptors.h"
 
 namespace doris {
 
diff --git a/be/src/http/action/health_action.h b/be/src/http/action/health_action.h
index cdee0f12b4..6724ef0856 100644
--- a/be/src/http/action/health_action.h
+++ b/be/src/http/action/health_action.h
@@ -21,7 +21,6 @@
 
 namespace doris {
 
-class ExecEnv;
 class HttpRequest;
 
 // Get BE health state from http API.
diff --git a/be/src/http/action/meta_action.h b/be/src/http/action/meta_action.h
index c4809cd3b5..fe59ed2744 100644
--- a/be/src/http/action/meta_action.h
+++ b/be/src/http/action/meta_action.h
@@ -24,7 +24,6 @@
 
 namespace doris {
 
-class ExecEnv;
 class HttpRequest;
 
 // Get Meta Info
diff --git a/be/src/http/action/metrics_action.h b/be/src/http/action/metrics_action.h
index 25664a98aa..2051aed53a 100644
--- a/be/src/http/action/metrics_action.h
+++ b/be/src/http/action/metrics_action.h
@@ -21,8 +21,6 @@
 
 namespace doris {
 
-class Webserver;
-class ExecEnv;
 class HttpRequest;
 class MetricRegistry;
 
diff --git a/be/src/http/action/monitor_action.h b/be/src/http/action/monitor_action.h
index 8d3f1c87d7..b4bbe7a09c 100644
--- a/be/src/http/action/monitor_action.h
+++ b/be/src/http/action/monitor_action.h
@@ -25,7 +25,6 @@
 namespace doris {
 
 class HttpRequest;
-class HttpChannel;
 class RestMonitorIface;
 
 class MonitorAction : public HttpHandler {
diff --git a/be/src/http/action/pad_rowset_action.h b/be/src/http/action/pad_rowset_action.h
index 13090dcd8c..26ff6b6854 100644
--- a/be/src/http/action/pad_rowset_action.h
+++ b/be/src/http/action/pad_rowset_action.h
@@ -19,7 +19,6 @@
 
 #include "common/status.h"
 #include "http/http_handler.h"
-#include "http/http_request.h"
 #include "olap/tablet.h"
 
 namespace doris {
diff --git a/be/src/http/action/pprof_actions.cpp b/be/src/http/action/pprof_actions.cpp
index 56ae5e49e9..1d71281273 100644
--- a/be/src/http/action/pprof_actions.cpp
+++ b/be/src/http/action/pprof_actions.cpp
@@ -25,6 +25,7 @@
 #include <fstream>
 #include <memory>
 #include <mutex>
+#include <string>
 
 #include "common/config.h"
 #include "common/object_pool.h"
diff --git a/be/src/http/action/reload_tablet_action.h b/be/src/http/action/reload_tablet_action.h
index aa36a474dd..8ecc946bb0 100644
--- a/be/src/http/action/reload_tablet_action.h
+++ b/be/src/http/action/reload_tablet_action.h
@@ -17,7 +17,6 @@
 
 #pragma once
 
-#include <gen_cpp/AgentService_types.h>
 #include <stdint.h>
 
 #include <string>
diff --git a/be/src/http/action/restore_tablet_action.cpp b/be/src/http/action/restore_tablet_action.cpp
index d710a2b36b..7ff9aa37f3 100644
--- a/be/src/http/action/restore_tablet_action.cpp
+++ b/be/src/http/action/restore_tablet_action.cpp
@@ -21,6 +21,7 @@
 #include <gen_cpp/AgentService_types.h>
 #include <glog/logging.h>
 
+#include <algorithm>
 #include <cstdlib>
 #include <filesystem>
 #include <memory>
diff --git a/be/src/http/action/restore_tablet_action.h b/be/src/http/action/restore_tablet_action.h
index a11d7783b7..2eccb22303 100644
--- a/be/src/http/action/restore_tablet_action.h
+++ b/be/src/http/action/restore_tablet_action.h
@@ -17,7 +17,6 @@
 
 #pragma once
 
-#include <gen_cpp/AgentService_types.h>
 #include <stdint.h>
 
 #include <map>
diff --git a/be/src/http/action/snapshot_action.h b/be/src/http/action/snapshot_action.h
index 0d1399604d..b1b58bee10 100644
--- a/be/src/http/action/snapshot_action.h
+++ b/be/src/http/action/snapshot_action.h
@@ -24,7 +24,6 @@
 
 namespace doris {
 
-class ExecEnv;
 class HttpRequest;
 
 // make snapshot
diff --git a/be/src/http/action/stream_load.h b/be/src/http/action/stream_load.h
index 3c44a77bb4..4319d722d1 100644
--- a/be/src/http/action/stream_load.h
+++ b/be/src/http/action/stream_load.h
@@ -17,15 +17,10 @@
 
 #pragma once
 
-#include <gen_cpp/PlanNodes_types.h>
-
-#include <functional>
 #include <memory>
 #include <string>
 
 #include "http/http_handler.h"
-#include "runtime/client_cache.h"
-#include "runtime/message_body_sink.h"
 #include "util/metrics.h"
 
 namespace doris {
diff --git a/be/src/http/action/tablet_migration_action.h b/be/src/http/action/tablet_migration_action.h
index aee9a65d12..11933e7fc7 100644
--- a/be/src/http/action/tablet_migration_action.h
+++ b/be/src/http/action/tablet_migration_action.h
@@ -17,7 +17,6 @@
 
 #pragma once
 
-#include <gen_cpp/Status_types.h>
 #include <stdint.h>
 
 #include <deque>
@@ -29,10 +28,8 @@
 #include <utility>
 
 #include "common/status.h"
-#include "gutil/stringprintf.h"
-#include "gutil/strings/numbers.h"
+#include "gutil/strings/substitute.h"
 #include "http/http_handler.h"
-#include "olap/data_dir.h"
 #include "olap/tablet.h"
 #include "util/threadpool.h"
 
diff --git a/be/src/http/action/tablets_info_action.cpp b/be/src/http/action/tablets_info_action.cpp
index 656fbdf158..374f7b2136 100644
--- a/be/src/http/action/tablets_info_action.cpp
+++ b/be/src/http/action/tablets_info_action.cpp
@@ -26,7 +26,7 @@
 #include <string>
 #include <vector>
 
-#include "gutil/strings/numbers.h"
+#include "gutil/strings/substitute.h"
 #include "http/http_channel.h"
 #include "http/http_headers.h"
 #include "http/http_request.h"
diff --git a/be/src/http/action/version_action.h b/be/src/http/action/version_action.h
index e78e19f37c..ed9a48ec61 100644
--- a/be/src/http/action/version_action.h
+++ b/be/src/http/action/version_action.h
@@ -22,7 +22,6 @@
 
 namespace doris {
 
-class ExecEnv;
 class HttpRequest;
 
 // Get BE version info from http API.
diff --git a/be/src/http/default_path_handlers.h b/be/src/http/default_path_handlers.h
index 1ff038350b..f9d022e793 100644
--- a/be/src/http/default_path_handlers.h
+++ b/be/src/http/default_path_handlers.h
@@ -17,13 +17,8 @@
 
 #pragma once
 
-#include <stdio.h>
-
-#include <memory>
-
 namespace doris {
 
-class MemTracker;
 class WebPageHandler;
 
 // Adds a set of default path handlers to the webserver to display
diff --git a/be/src/http/ev_http_server.cpp b/be/src/http/ev_http_server.cpp
index ccea181a8f..b0743baee3 100644
--- a/be/src/http/ev_http_server.cpp
+++ b/be/src/http/ev_http_server.cpp
@@ -18,9 +18,10 @@
 #include "http/ev_http_server.h"
 
 #include <arpa/inet.h>
-#include <bthread/errno.h>
 #include <butil/endpoint.h>
 #include <butil/fd_utility.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
 #include <event2/event.h>
 #include <event2/http.h>
 #include <event2/http_struct.h>
diff --git a/be/src/http/ev_http_server.h b/be/src/http/ev_http_server.h
index 5ba634b219..bf6b200bdc 100644
--- a/be/src/http/ev_http_server.h
+++ b/be/src/http/ev_http_server.h
@@ -20,7 +20,6 @@
 #include <memory>
 #include <mutex>
 #include <string>
-#include <thread>
 #include <vector>
 
 #include "common/status.h"
diff --git a/be/src/http/http_channel.h b/be/src/http/http_channel.h
index a12eddb535..478f013af8 100644
--- a/be/src/http/http_channel.h
+++ b/be/src/http/http_channel.h
@@ -19,13 +19,10 @@
 
 #include <stddef.h>
 
-#include <cstdint>
 #include <string>
 
 #include "http/http_status.h"
 
-struct mg_connection;
-
 namespace doris {
 
 class HttpRequest;
diff --git a/be/src/http/http_client.h b/be/src/http/http_client.h
index 7ec714587a..c194c29c88 100644
--- a/be/src/http/http_client.h
+++ b/be/src/http/http_client.h
@@ -26,10 +26,7 @@
 #include <string>
 
 #include "common/status.h"
-#include "http/http_headers.h"
 #include "http/http_method.h"
-#include "http/http_response.h"
-#include "http/utils.h"
 
 namespace doris {
 
diff --git a/be/src/http/http_request.h b/be/src/http/http_request.h
index a26be3a22c..a9286410af 100644
--- a/be/src/http/http_request.h
+++ b/be/src/http/http_request.h
@@ -19,17 +19,13 @@
 
 #include <glog/logging.h>
 
-#include <boost/algorithm/string.hpp>
 #include <map>
 #include <memory>
 #include <string>
 
-#include "http/http_common.h"
-#include "http/http_headers.h"
 #include "http/http_method.h"
 #include "util/string_util.h"
 
-struct mg_connection;
 struct evhttp_request;
 
 namespace doris {
diff --git a/be/src/http/utils.h b/be/src/http/utils.h
index f9b09b3017..dd62a9b8a9 100644
--- a/be/src/http/utils.h
+++ b/be/src/http/utils.h
@@ -19,13 +19,10 @@
 
 #include <string>
 
-#include "common/utils.h"
-#include "http/http_common.h"
 #include "http/http_request.h"
 
 namespace doris {
 
-class HttpRequest;
 struct AuthInfo;
 
 std::string encode_basic_auth(const std::string& user, const std::string& passwd);
diff --git a/be/src/http/web_page_handler.h b/be/src/http/web_page_handler.h
index 9ab304d96f..3fab082847 100644
--- a/be/src/http/web_page_handler.h
+++ b/be/src/http/web_page_handler.h
@@ -23,10 +23,8 @@
 #include <sstream>
 #include <string>
 #include <utility>
-#include <vector>
 
 #include "http/http_handler.h"
-#include "util/easy_json.h"
 
 namespace doris {
 
diff --git a/be/src/io/cache/block/block_file_cache.cpp b/be/src/io/cache/block/block_file_cache.cpp
index 0b97facff5..9868c5fee3 100644
--- a/be/src/io/cache/block/block_file_cache.cpp
+++ b/be/src/io/cache/block/block_file_cache.cpp
@@ -20,7 +20,11 @@
 
 #include "io/cache/block/block_file_cache.h"
 
+#include <glog/logging.h>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
 #include <filesystem>
+#include <utility>
 
 #include "io/cache/block/block_file_cache_fwd.h"
 #include "io/cache/block/block_file_cache_settings.h"
diff --git a/be/src/io/cache/block/block_file_cache.h b/be/src/io/cache/block/block_file_cache.h
index 81050c49b4..965a510717 100644
--- a/be/src/io/cache/block/block_file_cache.h
+++ b/be/src/io/cache/block/block_file_cache.h
@@ -20,20 +20,32 @@
 
 #pragma once
 
+#include <gen_cpp/Types_types.h>
+#include <stdint.h>
+
+#include <cstddef>
 #include <list>
 #include <memory>
+#include <mutex>
+#include <string>
+#include <tuple>
 #include <unordered_map>
+#include <vector>
 
 #include "common/config.h"
+#include "common/status.h"
 #include "io/cache/block/block_file_cache_fwd.h"
+#include "util/hash_util.hpp"
+#include "vec/common/uint128.h"
 
 namespace doris {
 namespace io {
 class FileBlock;
+struct FileCacheSettings;
+
 using FileBlockSPtr = std::shared_ptr<FileBlock>;
 using FileBlocks = std::list<FileBlockSPtr>;
 struct FileBlocksHolder;
-struct ReadSettings;
 
 /**
  * Local cache for remote filesystem files, represented as a set of non-overlapping non-empty file segments.
diff --git a/be/src/io/cache/block/block_file_cache_factory.cpp b/be/src/io/cache/block/block_file_cache_factory.cpp
index 2aee79fc50..5c6c569f21 100644
--- a/be/src/io/cache/block/block_file_cache_factory.cpp
+++ b/be/src/io/cache/block/block_file_cache_factory.cpp
@@ -20,14 +20,21 @@
 
 #include "io/cache/block/block_file_cache_factory.h"
 
-#include <cstddef>
+#include <glog/logging.h>
+
+#include <algorithm>
+#include <ostream>
+#include <utility>
 
 #include "common/config.h"
 #include "io/cache/block/block_file_cache.h"
+#include "io/cache/block/block_file_cache_settings.h"
 #include "io/cache/block/block_lru_file_cache.h"
 #include "io/fs/local_file_system.h"
 
 namespace doris {
+class TUniqueId;
+
 namespace io {
 
 FileCacheFactory& FileCacheFactory::instance() {
diff --git a/be/src/io/cache/block/block_file_cache_factory.h b/be/src/io/cache/block/block_file_cache_factory.h
index e37a6eebf0..62c23335b7 100644
--- a/be/src/io/cache/block/block_file_cache_factory.h
+++ b/be/src/io/cache/block/block_file_cache_factory.h
@@ -20,13 +20,18 @@
 
 #pragma once
 
+#include <memory>
+#include <string>
 #include <vector>
 
+#include "common/status.h"
 #include "io/cache/block/block_file_cache.h"
-#include "io/cache/block/block_file_cache_fwd.h"
-#include "io/cache/block/block_file_cache_settings.h"
+
 namespace doris {
+class TUniqueId;
+
 namespace io {
+struct FileCacheSettings;
 
 enum FileCacheType {
     NORMAL,
diff --git a/be/src/io/cache/block/block_file_cache_profile.cpp b/be/src/io/cache/block/block_file_cache_profile.cpp
index 61b0ef72ce..ef245be350 100644
--- a/be/src/io/cache/block/block_file_cache_profile.cpp
+++ b/be/src/io/cache/block/block_file_cache_profile.cpp
@@ -17,7 +17,9 @@
 
 #include "io/cache/block/block_file_cache_profile.h"
 
+#include <functional>
 #include <memory>
+#include <string>
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/cache/block/block_file_cache_profile.h b/be/src/io/cache/block/block_file_cache_profile.h
index 858a07aed5..7635413cd9 100644
--- a/be/src/io/cache/block/block_file_cache_profile.h
+++ b/be/src/io/cache/block/block_file_cache_profile.h
@@ -17,15 +17,15 @@
 
 #pragma once
 
+#include <gen_cpp/Metrics_types.h>
+
 #include <atomic>
 #include <cstdint>
-#include <cstdlib>
-#include <functional>
 #include <memory>
 #include <mutex>
-#include <string>
 #include <unordered_map>
 
+#include "io/io_common.h"
 #include "olap/olap_common.h"
 #include "util/doris_metrics.h"
 #include "util/metrics.h"
diff --git a/be/src/io/cache/block/block_file_segment.cpp b/be/src/io/cache/block/block_file_segment.cpp
index 020fc85de1..46a1cedc53 100644
--- a/be/src/io/cache/block/block_file_segment.cpp
+++ b/be/src/io/cache/block/block_file_segment.cpp
@@ -20,16 +20,17 @@
 
 #include "io/cache/block/block_file_segment.h"
 
-#include <filesystem>
+#include <glog/logging.h>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
 #include <sstream>
 #include <string>
 #include <thread>
 
 #include "common/status.h"
+#include "io/fs/file_reader.h"
 #include "io/fs/file_writer.h"
 #include "io/fs/local_file_system.h"
-#include "olap/iterators.h"
-#include "vec/common/hex.h"
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/cache/block/block_file_segment.h b/be/src/io/cache/block/block_file_segment.h
index 47732cb70e..7cbc238f93 100644
--- a/be/src/io/cache/block/block_file_segment.h
+++ b/be/src/io/cache/block/block_file_segment.h
@@ -20,20 +20,28 @@
 
 #pragma once
 
+#include <fmt/format.h>
+#include <stddef.h>
+
+#include <atomic>
 #include <condition_variable>
 #include <list>
 #include <memory>
 #include <mutex>
+#include <string>
+#include <utility>
 
 #include "common/status.h"
 #include "io/cache/block/block_file_cache.h"
-#include "io/fs/file_reader.h"
 #include "io/fs/file_writer.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
 
 class FileBlock;
+class FileReader;
+
 using FileBlockSPtr = std::shared_ptr<FileBlock>;
 using FileBlocks = std::list<FileBlockSPtr>;
 
diff --git a/be/src/io/cache/block/block_lru_file_cache.cpp b/be/src/io/cache/block/block_lru_file_cache.cpp
index c13e74664f..431410c42e 100644
--- a/be/src/io/cache/block/block_lru_file_cache.cpp
+++ b/be/src/io/cache/block/block_lru_file_cache.cpp
@@ -20,19 +20,43 @@
 
 #include "io/cache/block/block_lru_file_cache.h"
 
+#include <fmt/format.h>
+#include <gen_cpp/Types_types.h>
+#include <glog/logging.h>
+#include <stdint.h>
+
+#include <algorithm>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <cstring>
 #include <filesystem>
+#include <iterator>
+#include <list>
+#include <ostream>
 #include <random>
 #include <system_error>
 #include <utility>
 
 #include "common/status.h"
 #include "io/cache/block/block_file_cache.h"
-#include "io/cache/block/block_file_cache_settings.h"
+#include "io/cache/block/block_file_cache_fwd.h"
+#include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "io/fs/file_system.h"
+#include "io/fs/file_writer.h"
 #include "io/fs/local_file_system.h"
-#include "olap/iterators.h"
-#include "util/time.h"
+#include "io/fs/path.h"
+#include "util/slice.h"
 #include "vec/common/hex.h"
-#include "vec/common/sip_hash.h"
+
+namespace doris {
+namespace io {
+struct FileCacheSettings;
+} // namespace io
+} // namespace doris
 
 namespace fs = std::filesystem;
 
diff --git a/be/src/io/cache/block/block_lru_file_cache.h b/be/src/io/cache/block/block_lru_file_cache.h
index ac6c09371e..6742a8c0d6 100644
--- a/be/src/io/cache/block/block_lru_file_cache.h
+++ b/be/src/io/cache/block/block_lru_file_cache.h
@@ -20,17 +20,25 @@
 
 #pragma once
 
-#include <chrono>
+#include <cstddef>
 #include <map>
 #include <memory>
+#include <mutex>
 #include <optional>
+#include <string>
 #include <unordered_map>
+#include <utility>
+#include <vector>
 
+#include "common/status.h"
 #include "io/cache/block/block_file_cache.h"
 #include "io/cache/block/block_file_segment.h"
 
 namespace doris {
+class TUniqueId;
+
 namespace io {
+struct FileCacheSettings;
 
 /**
  * Local cache for remote filesystem files, represented as a set of non-overlapping non-empty file segments.
diff --git a/be/src/io/cache/block/cached_remote_file_reader.cpp b/be/src/io/cache/block/cached_remote_file_reader.cpp
index e456811430..1c35375526 100644
--- a/be/src/io/cache/block/cached_remote_file_reader.cpp
+++ b/be/src/io/cache/block/cached_remote_file_reader.cpp
@@ -17,12 +17,26 @@
 
 #include "io/cache/block/cached_remote_file_reader.h"
 
+#include <fmt/format.h>
+#include <gen_cpp/Types_types.h>
+#include <glog/logging.h>
+#include <string.h>
+
+#include <algorithm>
+#include <list>
+#include <vector>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/config.h"
 #include "io/cache/block/block_file_cache.h"
 #include "io/cache/block/block_file_cache_factory.h"
+#include "io/cache/block/block_file_segment.h"
 #include "io/fs/file_reader.h"
-#include "olap/iterators.h"
-#include "olap/olap_common.h"
-#include "util/async_io.h"
+#include "io/io_common.h"
+#include "util/bit_util.h"
+#include "util/doris_metrics.h"
+#include "util/runtime_profile.h"
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/cache/block/cached_remote_file_reader.h b/be/src/io/cache/block/cached_remote_file_reader.h
index 95fe00e936..6d9323f5c8 100644
--- a/be/src/io/cache/block/cached_remote_file_reader.h
+++ b/be/src/io/cache/block/cached_remote_file_reader.h
@@ -17,17 +17,25 @@
 
 #pragma once
 
-#include "gutil/macros.h"
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <utility>
+
+#include "common/status.h"
 #include "io/cache/block/block_file_cache.h"
-#include "io/cache/block/block_file_cache_fwd.h"
-#include "io/cache/block/block_file_cache_profile.h"
-#include "io/cache/block/block_file_segment.h"
 #include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "io/fs/file_system.h"
 #include "io/fs/path.h"
-#include "io/fs/s3_file_system.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
+struct FileCacheStatistics;
 
 class CachedRemoteFileReader final : public FileReader {
 public:
diff --git a/be/src/io/cache/dummy_file_cache.cpp b/be/src/io/cache/dummy_file_cache.cpp
index 5150fa1db7..14dda6898a 100644
--- a/be/src/io/cache/dummy_file_cache.cpp
+++ b/be/src/io/cache/dummy_file_cache.cpp
@@ -17,9 +17,12 @@
 
 #include "io/cache/dummy_file_cache.h"
 
-#include "gutil/strings/util.h"
+#include <time.h>
+
+#include <memory>
+#include <string>
+
 #include "io/fs/local_file_system.h"
-#include "util/string_util.h"
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/cache/dummy_file_cache.h b/be/src/io/cache/dummy_file_cache.h
index 653d47b1d6..46d21d99a2 100644
--- a/be/src/io/cache/dummy_file_cache.h
+++ b/be/src/io/cache/dummy_file_cache.h
@@ -17,17 +17,23 @@
 
 #pragma once
 
-#include <future>
-#include <memory>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <filesystem>
 #include <queue>
+#include <vector>
 
 #include "common/status.h"
 #include "io/cache/file_cache.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_system.h"
 #include "io/fs/path.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 // Only used for GC
 class DummyFileCache final : public FileCache {
diff --git a/be/src/io/cache/file_cache.cpp b/be/src/io/cache/file_cache.cpp
index 91379a2f1d..d37eba7724 100644
--- a/be/src/io/cache/file_cache.cpp
+++ b/be/src/io/cache/file_cache.cpp
@@ -17,12 +17,25 @@
 
 #include "io/cache/file_cache.h"
 
+#include <fmt/format.h>
+#include <glog/logging.h>
+#include <string.h>
+
+#include <algorithm>
+#include <filesystem>
+#include <list>
+#include <ostream>
+#include <set>
+#include <utility>
+
 #include "common/config.h"
 #include "common/status.h"
 #include "gutil/strings/util.h"
+#include "io/fs/file_system.h"
+#include "io/fs/file_writer.h"
 #include "io/fs/local_file_system.h"
-#include "io/fs/local_file_writer.h"
-#include "olap/iterators.h"
+#include "runtime/exec_env.h"
+#include "util/string_util.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/io/cache/file_cache.h b/be/src/io/cache/file_cache.h
index 68ffc1a3a1..2b2156ea46 100644
--- a/be/src/io/cache/file_cache.h
+++ b/be/src/io/cache/file_cache.h
@@ -17,17 +17,23 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <stddef.h>
+#include <stdint.h>
+
 #include <memory>
-#include <queue>
-#include <shared_mutex>
 #include <string>
+#include <vector>
 
 #include "common/status.h"
 #include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/path.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 const std::string CACHE_DONE_FILE_SUFFIX = "_DONE";
 
diff --git a/be/src/io/cache/file_cache_manager.cpp b/be/src/io/cache/file_cache_manager.cpp
index b14a02c1cb..f581b7d651 100644
--- a/be/src/io/cache/file_cache_manager.cpp
+++ b/be/src/io/cache/file_cache_manager.cpp
@@ -17,14 +17,27 @@
 
 #include "io/cache/file_cache_manager.h"
 
-#include "gutil/strings/util.h"
+#include <fmt/format.h>
+#include <glog/logging.h>
+#include <stddef.h>
+
+#include <memory>
+#include <mutex>
+#include <ostream>
+#include <utility>
+
+#include "common/config.h"
 #include "io/cache/dummy_file_cache.h"
 #include "io/cache/sub_file_cache.h"
 #include "io/cache/whole_file_cache.h"
+#include "io/fs/file_reader_options.h"
+#include "io/fs/file_system.h"
 #include "io/fs/local_file_system.h"
+#include "olap/data_dir.h"
 #include "olap/rowset/beta_rowset.h"
 #include "olap/storage_engine.h"
-#include "util/string_util.h"
+#include "olap/tablet.h"
+#include "olap/tablet_manager.h"
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/cache/file_cache_manager.h b/be/src/io/cache/file_cache_manager.h
index 6bf49c0dc7..7ac5e652d4 100644
--- a/be/src/io/cache/file_cache_manager.h
+++ b/be/src/io/cache/file_cache_manager.h
@@ -17,17 +17,22 @@
 
 #pragma once
 
+#include <stdint.h>
+
 #include <list>
-#include <memory>
+#include <map>
 #include <queue>
+#include <shared_mutex>
+#include <string>
+#include <vector>
 
-#include "common/config.h"
 #include "common/status.h"
 #include "io/cache/file_cache.h"
-#include "io/fs/file_reader_options.h"
+#include "io/fs/file_reader_writer_fwd.h"
 
 namespace doris {
 namespace io {
+enum class FileCachePolicy : uint8_t;
 
 class GCContextPerDisk {
 public:
diff --git a/be/src/io/cache/sub_file_cache.cpp b/be/src/io/cache/sub_file_cache.cpp
index fc075bf490..d7d09f3448 100644
--- a/be/src/io/cache/sub_file_cache.cpp
+++ b/be/src/io/cache/sub_file_cache.cpp
@@ -17,20 +17,27 @@
 
 #include "io/cache/sub_file_cache.h"
 
+#include <fmt/format.h>
 #include <glog/logging.h>
-#include <sys/types.h>
+#include <time.h>
 
 #include <algorithm>
 #include <cstdlib>
+#include <filesystem>
+#include <future>
+#include <mutex>
+#include <ostream>
+#include <string>
 #include <utility>
 #include <vector>
 
 #include "common/config.h"
 #include "common/status.h"
 #include "io/fs/local_file_system.h"
-#include "olap/iterators.h"
-#include "util/async_io.h"
+#include "io/io_common.h"
+#include "runtime/exec_env.h"
 #include "util/string_util.h"
+#include "util/threadpool.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/io/cache/sub_file_cache.h b/be/src/io/cache/sub_file_cache.h
index 4766a4b6a6..96dc873a88 100644
--- a/be/src/io/cache/sub_file_cache.h
+++ b/be/src/io/cache/sub_file_cache.h
@@ -17,16 +17,28 @@
 
 #pragma once
 
-#include <future>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
+#include <map>
 #include <memory>
+#include <queue>
+#include <shared_mutex>
+#include <utility>
+#include <vector>
 
 #include "common/status.h"
 #include "io/cache/file_cache.h"
+#include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_system.h"
 #include "io/fs/path.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 class SubFileCache final : public FileCache {
 public:
diff --git a/be/src/io/cache/whole_file_cache.cpp b/be/src/io/cache/whole_file_cache.cpp
index ef24295e68..59494d9cbd 100644
--- a/be/src/io/cache/whole_file_cache.cpp
+++ b/be/src/io/cache/whole_file_cache.cpp
@@ -17,9 +17,19 @@
 
 #include "io/cache/whole_file_cache.h"
 
+#include <fmt/format.h>
+#include <glog/logging.h>
+
+#include <filesystem>
+#include <future>
+#include <mutex>
+#include <ostream>
+#include <string>
+
 #include "io/fs/local_file_system.h"
-#include "olap/iterators.h"
-#include "util/async_io.h"
+#include "io/io_common.h"
+#include "runtime/exec_env.h"
+#include "util/threadpool.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/io/cache/whole_file_cache.h b/be/src/io/cache/whole_file_cache.h
index 0036678114..866e6e142e 100644
--- a/be/src/io/cache/whole_file_cache.h
+++ b/be/src/io/cache/whole_file_cache.h
@@ -17,16 +17,23 @@
 
 #pragma once
 
-#include <future>
+#include <stdint.h>
+#include <time.h>
+
 #include <memory>
+#include <shared_mutex>
 
 #include "common/status.h"
 #include "io/cache/file_cache.h"
+#include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_system.h"
 #include "io/fs/path.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 class WholeFileCache final : public FileCache {
 public:
diff --git a/be/src/io/file_factory.cpp b/be/src/io/file_factory.cpp
index c539f9ae50..e8fe4b2cec 100644
--- a/be/src/io/file_factory.cpp
+++ b/be/src/io/file_factory.cpp
@@ -17,24 +17,34 @@
 
 #include "io/file_factory.h"
 
+#include <gen_cpp/PaloInternalService_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
+
+#include <utility>
+
 #include "common/config.h"
 #include "common/status.h"
 #include "io/fs/broker_file_system.h"
-#include "io/fs/broker_file_writer.h"
 #include "io/fs/file_reader_options.h"
-#include "io/fs/file_system.h"
 #include "io/fs/hdfs_file_system.h"
-#include "io/fs/hdfs_file_writer.h"
 #include "io/fs/local_file_system.h"
 #include "io/fs/s3_file_system.h"
+#include "io/fs/stream_load_pipe.h"
+#include "io/hdfs_builder.h"
 #include "runtime/exec_env.h"
 #include "runtime/runtime_state.h"
 #include "runtime/stream_load/new_load_stream_mgr.h"
 #include "runtime/stream_load/stream_load_context.h"
-#include "util/runtime_profile.h"
 #include "util/s3_uri.h"
+#include "util/s3_util.h"
+#include "util/uid_util.h"
 
 namespace doris {
+namespace io {
+class FileWriter;
+} // namespace io
+
 io::FileCachePolicy FileFactory::get_cache_policy(RuntimeState* state) {
     if (state != nullptr) {
         if (config::enable_file_cache && state->query_options().enable_file_cache) {
diff --git a/be/src/io/file_factory.h b/be/src/io/file_factory.h
index 01b13cc521..2510b5e30d 100644
--- a/be/src/io/file_factory.h
+++ b/be/src/io/file_factory.h
@@ -16,19 +16,29 @@
 // under the License.
 #pragma once
 
-#include "gen_cpp/PlanNodes_types.h"
-#include "gen_cpp/Types_types.h"
-#include "io/fs/file_reader.h"
-#include "io/fs/file_writer.h"
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
+#include <glog/logging.h>
+#include <stdint.h>
+
+#include <map>
+#include <memory>
+#include <ostream>
+#include <string>
+#include <vector>
+
+#include "common/status.h"
+#include "io/fs/file_reader_options.h"
+#include "io/fs/file_reader_writer_fwd.h"
 
 namespace doris {
 namespace io {
 class FileSystem;
-class FileReaderOptions;
+class FileWriter;
 } // namespace io
 class ExecEnv;
-class TNetworkAddress;
 class RuntimeProfile;
+class RuntimeState;
 
 struct FileSystemProperties {
     TFileType::type system_type;
diff --git a/be/src/io/fs/broker_file_reader.cpp b/be/src/io/fs/broker_file_reader.cpp
index 40ddfe6b44..ffd4c5154e 100644
--- a/be/src/io/fs/broker_file_reader.cpp
+++ b/be/src/io/fs/broker_file_reader.cpp
@@ -18,13 +18,26 @@
 #include "io/fs/broker_file_reader.h"
 
 #include <gen_cpp/TPaloBrokerService.h>
-
+#include <string.h>
+#include <thrift/Thrift.h>
+#include <thrift/transport/TTransportException.h>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <ostream>
+#include <string>
+#include <thread>
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/logging.h"
 #include "common/status.h"
 #include "io/fs/broker_file_system.h"
 #include "util/doris_metrics.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 BrokerFileReader::BrokerFileReader(const TNetworkAddress& broker_addr, const Path& path,
                                    size_t file_size, TBrokerFD fd,
diff --git a/be/src/io/fs/broker_file_reader.h b/be/src/io/fs/broker_file_reader.h
index e16e6e336f..a7f126ba0d 100644
--- a/be/src/io/fs/broker_file_reader.h
+++ b/be/src/io/fs/broker_file_reader.h
@@ -19,16 +19,23 @@
 
 #include <gen_cpp/PaloBrokerService_types.h>
 #include <gen_cpp/Types_types.h>
+#include <stddef.h>
 
 #include <atomic>
+#include <memory>
 
+#include "common/status.h"
 #include "io/fs/broker_file_system.h"
 #include "io/fs/file_reader.h"
+#include "io/fs/file_system.h"
+#include "io/fs/path.h"
 #include "runtime/client_cache.h"
+#include "util/slice.h"
+
 namespace doris {
 namespace io {
 
-class BrokerFileSystem;
+class IOContext;
 
 class BrokerFileReader : public FileReader {
 public:
diff --git a/be/src/io/fs/broker_file_system.cpp b/be/src/io/fs/broker_file_system.cpp
index d7e87e9930..cf7f34a9df 100644
--- a/be/src/io/fs/broker_file_system.cpp
+++ b/be/src/io/fs/broker_file_system.cpp
@@ -17,15 +17,33 @@
 
 #include "io/fs/broker_file_system.h"
 
+#include <fmt/format.h>
 #include <gen_cpp/PaloBrokerService_types.h>
 #include <gen_cpp/TPaloBrokerService.h>
-
+#include <gen_cpp/Types_types.h>
+#include <glog/logging.h>
+#include <stddef.h>
+#include <thrift/Thrift.h>
+#include <thrift/transport/TTransportException.h>
+
+#include <algorithm>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <filesystem>
+#include <ostream>
+#include <thread>
+#include <utility>
+
+#include "common/config.h"
 #include "io/fs/broker_file_reader.h"
 #include "io/fs/broker_file_writer.h"
+#include "io/fs/file_reader.h"
+#include "io/fs/file_system.h"
+#include "io/fs/file_writer.h"
 #include "io/fs/local_file_system.h"
 #include "runtime/broker_mgr.h"
 #include "runtime/exec_env.h"
-#include "util/defer_op.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/fs/broker_file_system.h b/be/src/io/fs/broker_file_system.h
index fa39964878..6b04bbc61c 100644
--- a/be/src/io/fs/broker_file_system.h
+++ b/be/src/io/fs/broker_file_system.h
@@ -17,11 +17,25 @@
 
 #pragma once
 
+#include <stdint.h>
+
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "common/status.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "io/fs/path.h"
 #include "io/fs/remote_file_system.h"
 #include "runtime/client_cache.h"
+
 namespace doris {
+class TNetworkAddress;
 
 namespace io {
+struct FileInfo;
+
 class BrokerFileSystem final : public RemoteFileSystem {
 public:
     static Status create(const TNetworkAddress& broker_addr,
diff --git a/be/src/io/fs/broker_file_writer.cpp b/be/src/io/fs/broker_file_writer.cpp
index 463c44946f..ac34f381d3 100644
--- a/be/src/io/fs/broker_file_writer.cpp
+++ b/be/src/io/fs/broker_file_writer.cpp
@@ -17,13 +17,17 @@
 
 #include "io/fs/broker_file_writer.h"
 
+#include <gen_cpp/PaloBrokerService_types.h>
+#include <gen_cpp/TPaloBrokerService.h>
+#include <gen_cpp/Types_types.h>
+#include <thrift/Thrift.h>
 #include <thrift/protocol/TDebugProtocol.h>
+#include <thrift/transport/TTransportException.h>
 
 #include <sstream>
 
+#include "common/config.h"
 #include "common/logging.h"
-#include "gen_cpp/PaloBrokerService_types.h"
-#include "gen_cpp/TPaloBrokerService.h"
 #include "runtime/broker_mgr.h"
 #include "runtime/client_cache.h"
 #include "runtime/exec_env.h"
diff --git a/be/src/io/fs/broker_file_writer.h b/be/src/io/fs/broker_file_writer.h
index 5705cc18df..95773f0a04 100644
--- a/be/src/io/fs/broker_file_writer.h
+++ b/be/src/io/fs/broker_file_writer.h
@@ -17,21 +17,23 @@
 
 #pragma once
 
+#include <gen_cpp/PaloBrokerService_types.h>
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
 #include <stdint.h>
 
 #include <map>
 #include <string>
 
 #include "common/status.h"
-#include "gen_cpp/PaloBrokerService_types.h"
-#include "gen_cpp/Types_types.h"
+#include "io/fs/file_system.h"
 #include "io/fs/file_writer.h"
+#include "util/hash_util.hpp" // IWYU pragma: keep
+#include "util/slice.h"
 
 namespace doris {
 
 class ExecEnv;
-class TBrokerRangeDesc;
-class TNetworkAddress;
 
 namespace io {
 
diff --git a/be/src/io/fs/buffered_reader.cpp b/be/src/io/fs/buffered_reader.cpp
index 63d4f10f77..0ab588f68f 100644
--- a/be/src/io/fs/buffered_reader.cpp
+++ b/be/src/io/fs/buffered_reader.cpp
@@ -17,15 +17,22 @@
 
 #include "io/fs/buffered_reader.h"
 
+#include <bvar/reducer.h>
+#include <bvar/window.h>
+#include <string.h>
+
 #include <algorithm>
-#include <sstream>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/config.h"
-#include "olap/iterators.h"
-#include "olap/olap_define.h"
+#include "runtime/exec_env.h"
+#include "util/runtime_profile.h"
+#include "util/threadpool.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 // add bvar to capture the download bytes per second by buffered reader
 bvar::Adder<uint64_t> g_bytes_downloaded("buffered_reader", "bytes_downloaded");
diff --git a/be/src/io/fs/buffered_reader.h b/be/src/io/fs/buffered_reader.h
index 434058e32e..670f64a0db 100644
--- a/be/src/io/fs/buffered_reader.h
+++ b/be/src/io/fs/buffered_reader.h
@@ -17,21 +17,28 @@
 
 #pragma once
 
+#include <stddef.h>
 #include <stdint.h>
 
 #include <condition_variable>
 #include <memory>
+#include <mutex>
+#include <string>
+#include <utility>
+#include <vector>
 
-#include "common/config.h"
 #include "common/status.h"
 #include "io/fs/file_reader.h"
-#include "olap/olap_define.h"
-#include "util/runtime_profile.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "io/fs/path.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
 
-class PrefetchBufferedReader;
+class FileSystem;
+class IOContext;
+
 struct PrefetchBuffer : std::enable_shared_from_this<PrefetchBuffer> {
     enum class BufferStatus { RESET, PENDING, PREFETCHED, CLOSED };
     PrefetchBuffer() = default;
diff --git a/be/src/io/fs/err_utils.cpp b/be/src/io/fs/err_utils.cpp
index d01c7e7488..5530b25a0d 100644
--- a/be/src/io/fs/err_utils.cpp
+++ b/be/src/io/fs/err_utils.cpp
@@ -17,7 +17,10 @@
 
 #include "io/fs/err_utils.h"
 
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
 #include <fmt/format.h>
+#include <string.h>
 
 #include <sstream>
 
diff --git a/be/src/io/fs/file_reader.cpp b/be/src/io/fs/file_reader.cpp
index fba531630f..eff62210d5 100644
--- a/be/src/io/fs/file_reader.cpp
+++ b/be/src/io/fs/file_reader.cpp
@@ -17,8 +17,10 @@
 
 #include "io/fs/file_reader.h"
 
+#include <bthread/bthread.h>
+#include <glog/logging.h>
+
 #include "io/fs/file_system.h"
-#include "io/io_common.h"
 #include "util/async_io.h"
 
 namespace doris {
diff --git a/be/src/io/fs/file_reader.h b/be/src/io/fs/file_reader.h
index c429b36ed3..d4f7c5d530 100644
--- a/be/src/io/fs/file_reader.h
+++ b/be/src/io/fs/file_reader.h
@@ -17,9 +17,12 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <stddef.h>
+
+#include <memory>
+
 #include "common/status.h"
-#include "gutil/macros.h"
-#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/path.h"
 #include "util/slice.h"
 
diff --git a/be/src/io/fs/file_reader_options.h b/be/src/io/fs/file_reader_options.h
index c12ce727bf..ca50bcb1dd 100644
--- a/be/src/io/fs/file_reader_options.h
+++ b/be/src/io/fs/file_reader_options.h
@@ -17,7 +17,9 @@
 
 #pragma once
 
-#include "io/cache/block/block_file_cache.h"
+#include <stdint.h>
+
+#include <string>
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/fs/file_system.cpp b/be/src/io/fs/file_system.cpp
index 1f34500035..d399fbbc57 100644
--- a/be/src/io/fs/file_system.cpp
+++ b/be/src/io/fs/file_system.cpp
@@ -17,8 +17,7 @@
 
 #include "io/fs/file_system.h"
 
-#include "olap/olap_define.h"
-#include "util/async_io.h"
+#include "util/async_io.h" // IWYU pragma: keep
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/fs/file_system.h b/be/src/io/fs/file_system.h
index 3dbf741a05..30ac5f5a4a 100644
--- a/be/src/io/fs/file_system.h
+++ b/be/src/io/fs/file_system.h
@@ -17,17 +17,26 @@
 
 #pragma once
 
+#include <bthread/bthread.h>
+#include <butil/macros.h>
+#include <glog/logging.h>
+#include <stdint.h>
+
+#include <filesystem>
+#include <functional>
 #include <memory>
+#include <string>
+#include <utility>
+#include <vector>
 
 #include "common/status.h"
-#include "gutil/macros.h"
 #include "io/fs/file_reader_options.h"
 #include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/path.h"
-#include "io/io_common.h"
 
 namespace doris {
 namespace io {
+class FileSystem;
 
 #ifndef FILESYSTEM_M
 #define FILESYSTEM_M(stmt)                    \
diff --git a/be/src/io/fs/fs_utils.cpp b/be/src/io/fs/fs_utils.cpp
index 066dbaa63a..7f12c6767e 100644
--- a/be/src/io/fs/fs_utils.cpp
+++ b/be/src/io/fs/fs_utils.cpp
@@ -17,7 +17,12 @@
 
 #include "io/fs/fs_utils.h"
 
+#include <stddef.h>
+
+#include <memory>
+
 #include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_system.h"
 
 namespace doris {
diff --git a/be/src/io/fs/fs_utils.h b/be/src/io/fs/fs_utils.h
index 866b3cfaea..39744d25a0 100644
--- a/be/src/io/fs/fs_utils.h
+++ b/be/src/io/fs/fs_utils.h
@@ -17,8 +17,15 @@
 
 #pragma once
 
+#include <gen_cpp/Types_types.h>
+#include <stdint.h>
+
+#include <ostream>
+#include <string>
+
 #include "common/status.h"
 #include "io/fs/file_system.h"
+#include "io/fs/path.h"
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/fs/hdfs_file_reader.cpp b/be/src/io/fs/hdfs_file_reader.cpp
index ddd035213b..901d51bd9c 100644
--- a/be/src/io/fs/hdfs_file_reader.cpp
+++ b/be/src/io/fs/hdfs_file_reader.cpp
@@ -17,6 +17,16 @@
 
 #include "io/fs/hdfs_file_reader.h"
 
+#include <stdint.h>
+
+#include <algorithm>
+#include <filesystem>
+#include <ostream>
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/logging.h"
 #include "io/fs/err_utils.h"
 #include "io/fs/hdfs_file_system.h"
 #include "service/backend_options.h"
diff --git a/be/src/io/fs/hdfs_file_system.cpp b/be/src/io/fs/hdfs_file_system.cpp
index 0d33bd30c9..c338390af4 100644
--- a/be/src/io/fs/hdfs_file_system.cpp
+++ b/be/src/io/fs/hdfs_file_system.cpp
@@ -17,16 +17,32 @@
 
 #include "io/fs/hdfs_file_system.h"
 
+#include <fcntl.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <limits.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <filesystem>
+#include <map>
+#include <mutex>
+#include <ostream>
+#include <unordered_map>
+#include <utility>
+
+#include "common/config.h"
 #include "gutil/hash/hash.h"
-#include "io/cache/block/cached_remote_file_reader.h"
+#include "gutil/integral_types.h"
 #include "io/fs/err_utils.h"
+#include "io/fs/file_reader.h"
+#include "io/fs/file_system.h"
+#include "io/fs/file_writer.h"
 #include "io/fs/hdfs_file_reader.h"
 #include "io/fs/hdfs_file_writer.h"
 #include "io/fs/local_file_system.h"
 #include "io/hdfs_builder.h"
-#include "service/backend_options.h"
 #include "util/hdfs_util.h"
-#include "util/stack_util.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/fs/hdfs_file_system.h b/be/src/io/fs/hdfs_file_system.h
index 9cec56b86c..4928f193c3 100644
--- a/be/src/io/fs/hdfs_file_system.h
+++ b/be/src/io/fs/hdfs_file_system.h
@@ -17,15 +17,27 @@
 
 #pragma once
 
-#include <gen_cpp/PlanNodes_types.h>
+#include <glog/logging.h>
+#include <stdint.h>
 
 #include <atomic>
-
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "common/status.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/hdfs.h"
+#include "io/fs/path.h"
 #include "io/fs/remote_file_system.h"
 
 namespace doris {
+class THdfsParams;
+
 namespace io {
+struct FileInfo;
 
 class HdfsFileSystemHandle {
 public:
diff --git a/be/src/io/fs/hdfs_file_writer.cpp b/be/src/io/fs/hdfs_file_writer.cpp
index 723856fa25..5eaaa8a404 100644
--- a/be/src/io/fs/hdfs_file_writer.cpp
+++ b/be/src/io/fs/hdfs_file_writer.cpp
@@ -17,7 +17,13 @@
 
 #include "io/fs/hdfs_file_writer.h"
 
+#include <fcntl.h>
+#include <stdint.h>
+
 #include <filesystem>
+#include <ostream>
+#include <string>
+#include <utility>
 
 #include "common/logging.h"
 #include "io/fs/err_utils.h"
diff --git a/be/src/io/fs/hdfs_file_writer.h b/be/src/io/fs/hdfs_file_writer.h
index c9b3ff9def..371cae6e0c 100644
--- a/be/src/io/fs/hdfs_file_writer.h
+++ b/be/src/io/fs/hdfs_file_writer.h
@@ -19,16 +19,11 @@
 
 #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 {
diff --git a/be/src/io/fs/local_file_reader.cpp b/be/src/io/fs/local_file_reader.cpp
index c62633e8cb..bed46e0c28 100644
--- a/be/src/io/fs/local_file_reader.cpp
+++ b/be/src/io/fs/local_file_reader.cpp
@@ -17,14 +17,28 @@
 
 #include "io/fs/local_file_reader.h"
 
+#include <bthread/bthread.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
+#include <fmt/format.h>
+#include <glog/logging.h>
+#include <unistd.h>
+
+#include <algorithm>
 #include <atomic>
+#include <cstring>
+#include <string>
+#include <utility>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "io/fs/err_utils.h"
 #include "util/async_io.h"
 #include "util/doris_metrics.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 LocalFileReader::LocalFileReader(Path path, size_t file_size, int fd,
                                  std::shared_ptr<LocalFileSystem> fs)
diff --git a/be/src/io/fs/local_file_reader.h b/be/src/io/fs/local_file_reader.h
index 1f74e7b4be..a42c0e3c07 100644
--- a/be/src/io/fs/local_file_reader.h
+++ b/be/src/io/fs/local_file_reader.h
@@ -17,14 +17,21 @@
 
 #pragma once
 
+#include <stddef.h>
+
 #include <atomic>
+#include <memory>
 
+#include "common/status.h"
 #include "io/fs/file_reader.h"
+#include "io/fs/file_system.h"
 #include "io/fs/local_file_system.h"
 #include "io/fs/path.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 class LocalFileReader final : public FileReader {
 public:
diff --git a/be/src/io/fs/local_file_system.cpp b/be/src/io/fs/local_file_system.cpp
index 0b7747caf4..9b5c8eec85 100644
--- a/be/src/io/fs/local_file_system.cpp
+++ b/be/src/io/fs/local_file_system.cpp
@@ -17,18 +17,33 @@
 
 #include "io/fs/local_file_system.h"
 
+#include <fcntl.h>
+#include <fmt/format.h>
+#include <glog/logging.h>
 #include <openssl/md5.h>
 #include <sys/mman.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
+#include <filesystem>
+#include <iomanip>
+#include <istream>
+#include <system_error>
+#include <utility>
+
+#include "gutil/macros.h"
 #include "io/fs/err_utils.h"
 #include "io/fs/file_system.h"
+#include "io/fs/file_writer.h"
 #include "io/fs/local_file_reader.h"
 #include "io/fs/local_file_writer.h"
 #include "runtime/thread_context.h"
-#include "util/async_io.h"
+#include "util/async_io.h" // IWYU pragma: keep
+#include "util/defer_op.h"
 
 namespace doris {
 namespace io {
+class FileReaderOptions;
 
 std::shared_ptr<LocalFileSystem> LocalFileSystem::create(Path path, std::string id) {
     return std::shared_ptr<LocalFileSystem>(new LocalFileSystem(std::move(path), std::move(id)));
diff --git a/be/src/io/fs/local_file_system.h b/be/src/io/fs/local_file_system.h
index 15b4c875c2..bcebd48a65 100644
--- a/be/src/io/fs/local_file_system.h
+++ b/be/src/io/fs/local_file_system.h
@@ -17,10 +17,22 @@
 
 #pragma once
 
+#include <stdint.h>
+#include <time.h>
+
+#include <functional>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "common/status.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_system.h"
+#include "io/fs/path.h"
 
 namespace doris {
 namespace io {
+class FileReaderOptions;
 
 class LocalFileSystem final : public FileSystem {
 public:
diff --git a/be/src/io/fs/local_file_writer.cpp b/be/src/io/fs/local_file_writer.cpp
index c141471d98..62536dd687 100644
--- a/be/src/io/fs/local_file_writer.cpp
+++ b/be/src/io/fs/local_file_writer.cpp
@@ -17,12 +17,23 @@
 
 #include "io/fs/local_file_writer.h"
 
-#include <fmt/core.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
+#include <fcntl.h>
+#include <glog/logging.h>
+#include <limits.h>
+#include <stdint.h>
 #include <sys/uio.h>
+#include <unistd.h>
 
-#include <cerrno>
+#include <algorithm>
+#include <cstring>
+#include <memory>
+#include <ostream>
+#include <utility>
 
-#include "common/compiler_util.h"
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/status.h"
 #include "gutil/macros.h"
 #include "io/fs/file_writer.h"
diff --git a/be/src/io/fs/local_file_writer.h b/be/src/io/fs/local_file_writer.h
index e4745893dd..11b2f16434 100644
--- a/be/src/io/fs/local_file_writer.h
+++ b/be/src/io/fs/local_file_writer.h
@@ -19,9 +19,11 @@
 
 #include <cstddef>
 
+#include "common/status.h"
 #include "io/fs/file_system.h"
 #include "io/fs/file_writer.h"
-#include "io/fs/local_file_system.h"
+#include "io/fs/path.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/fs/remote_file_system.cpp b/be/src/io/fs/remote_file_system.cpp
index 9e4e777639..53f7ced5f9 100644
--- a/be/src/io/fs/remote_file_system.cpp
+++ b/be/src/io/fs/remote_file_system.cpp
@@ -17,11 +17,18 @@
 
 #include "io/fs/remote_file_system.h"
 
+#include <glog/logging.h>
+
+#include <algorithm>
+
+#include "common/config.h"
 #include "gutil/strings/stringpiece.h"
 #include "io/cache/block/cached_remote_file_reader.h"
+#include "io/cache/file_cache.h"
 #include "io/cache/file_cache_manager.h"
+#include "io/fs/file_reader.h"
 #include "io/fs/file_reader_options.h"
-#include "util/async_io.h"
+#include "util/async_io.h" // IWYU pragma: keep
 
 namespace doris {
 namespace io {
diff --git a/be/src/io/fs/remote_file_system.h b/be/src/io/fs/remote_file_system.h
index 8626d0840a..44ecde4041 100644
--- a/be/src/io/fs/remote_file_system.h
+++ b/be/src/io/fs/remote_file_system.h
@@ -17,10 +17,21 @@
 
 #pragma once
 
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "common/status.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_system.h"
+#include "io/fs/path.h"
 
 namespace doris {
 namespace io {
+class FileReaderOptions;
 
 class RemoteFileSystem : public FileSystem {
 public:
diff --git a/be/src/io/fs/s3_file_reader.cpp b/be/src/io/fs/s3_file_reader.cpp
index b60e038d39..77a3bfcd22 100644
--- a/be/src/io/fs/s3_file_reader.cpp
+++ b/be/src/io/fs/s3_file_reader.cpp
@@ -17,15 +17,25 @@
 
 #include "io/fs/s3_file_reader.h"
 
+#include <aws/core/utils/Outcome.h>
 #include <aws/s3/S3Client.h>
+#include <aws/s3/S3Errors.h>
 #include <aws/s3/model/GetObjectRequest.h>
+#include <aws/s3/model/GetObjectResult.h>
+#include <fmt/format.h>
+#include <glog/logging.h>
 
+#include <algorithm>
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "io/fs/s3_common.h"
-#include "util/async_io.h"
 #include "util/doris_metrics.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 S3FileReader::S3FileReader(Path path, size_t file_size, std::string key, std::string bucket,
                            std::shared_ptr<S3FileSystem> fs)
diff --git a/be/src/io/fs/s3_file_reader.h b/be/src/io/fs/s3_file_reader.h
index c21084ae8d..1f53fb5814 100644
--- a/be/src/io/fs/s3_file_reader.h
+++ b/be/src/io/fs/s3_file_reader.h
@@ -17,13 +17,22 @@
 
 #pragma once
 
-#include "gutil/macros.h"
+#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/path.h"
 #include "io/fs/s3_file_system.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 class S3FileReader final : public FileReader {
 public:
diff --git a/be/src/io/fs/s3_file_system.cpp b/be/src/io/fs/s3_file_system.cpp
index 3236e3f826..c7efcc414a 100644
--- a/be/src/io/fs/s3_file_system.cpp
+++ b/be/src/io/fs/s3_file_system.cpp
@@ -17,25 +17,57 @@
 
 #include "io/fs/s3_file_system.h"
 
+#include <aws/core/client/AWSError.h>
+#include <aws/core/http/HttpResponse.h>
+#include <aws/core/utils/Outcome.h>
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
+#include <aws/core/utils/memory/stl/AWSMap.h>
+#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
+#include <aws/core/utils/memory/stl/AWSString.h>
+#include <aws/core/utils/memory/stl/AWSStringStream.h>
+#include <aws/core/utils/memory/stl/AWSVector.h>
 #include <aws/core/utils/threading/Executor.h>
 #include <aws/s3/S3Client.h>
+#include <aws/s3/S3Errors.h>
 #include <aws/s3/model/CopyObjectRequest.h>
+#include <aws/s3/model/CopyObjectResult.h>
+#include <aws/s3/model/Delete.h>
 #include <aws/s3/model/DeleteObjectRequest.h>
+#include <aws/s3/model/DeleteObjectResult.h>
 #include <aws/s3/model/DeleteObjectsRequest.h>
+#include <aws/s3/model/DeleteObjectsResult.h>
+#include <aws/s3/model/Error.h>
+#include <aws/s3/model/GetObjectRequest.h>
+#include <aws/s3/model/GetObjectResult.h>
 #include <aws/s3/model/HeadObjectRequest.h>
+#include <aws/s3/model/HeadObjectResult.h>
 #include <aws/s3/model/ListObjectsV2Request.h>
+#include <aws/s3/model/ListObjectsV2Result.h>
+#include <aws/s3/model/Object.h>
+#include <aws/s3/model/ObjectIdentifier.h>
 #include <aws/s3/model/PutObjectRequest.h>
+#include <aws/s3/model/PutObjectResult.h>
+#include <aws/transfer/TransferHandle.h>
 #include <aws/transfer/TransferManager.h>
-#include <opentelemetry/common/threadlocal.h>
+#include <fmt/format.h>
+#include <stddef.h>
 
+#include <algorithm>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
 #include <filesystem>
-#include <fstream>
+#include <fstream> // IWYU pragma: keep
 #include <memory>
+#include <sstream>
 
 #include "common/config.h"
+#include "common/logging.h"
 #include "common/status.h"
-#include "gutil/strings/stringpiece.h"
-#include "io/cache/block/cached_remote_file_reader.h"
+#include "io/fs/file_system.h"
+#include "io/fs/file_writer.h"
 #include "io/fs/remote_file_system.h"
 #include "io/fs/s3_file_reader.h"
 #include "io/fs/s3_file_writer.h"
diff --git a/be/src/io/fs/s3_file_system.h b/be/src/io/fs/s3_file_system.h
index 0ae687e44d..0c7e3d17e1 100644
--- a/be/src/io/fs/s3_file_system.h
+++ b/be/src/io/fs/s3_file_system.h
@@ -17,8 +17,18 @@
 
 #pragma once
 
+#include <stdint.h>
+
+#include <filesystem>
+#include <memory>
 #include <mutex>
+#include <string>
+#include <utility>
+#include <vector>
 
+#include "common/status.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "io/fs/path.h"
 #include "io/fs/remote_file_system.h"
 #include "util/s3_util.h"
 
@@ -31,6 +41,7 @@ class PooledThreadExecutor;
 
 namespace doris {
 namespace io {
+struct FileInfo;
 
 // File system for S3 compatible object storage
 // When creating S3FileSystem, all required info should be set in S3Conf,
diff --git a/be/src/io/fs/s3_file_writer.cpp b/be/src/io/fs/s3_file_writer.cpp
index f613b14e17..989f9c0c2e 100644
--- a/be/src/io/fs/s3_file_writer.cpp
+++ b/be/src/io/fs/s3_file_writer.cpp
@@ -17,29 +17,41 @@
 
 #include "io/fs/s3_file_writer.h"
 
-#include <aws/core/Aws.h>
+#include <aws/core/http/HttpResponse.h>
+#include <aws/core/utils/Array.h>
 #include <aws/core/utils/HashingUtils.h>
+#include <aws/core/utils/Outcome.h>
+#include <aws/core/utils/memory/stl/AWSAllocator.h>
 #include <aws/s3/S3Client.h>
+#include <aws/s3/S3Errors.h>
 #include <aws/s3/model/AbortMultipartUploadRequest.h>
+#include <aws/s3/model/AbortMultipartUploadResult.h>
 #include <aws/s3/model/CompleteMultipartUploadRequest.h>
+#include <aws/s3/model/CompleteMultipartUploadResult.h>
+#include <aws/s3/model/CompletedMultipartUpload.h>
+#include <aws/s3/model/CompletedPart.h>
 #include <aws/s3/model/CreateMultipartUploadRequest.h>
-#include <aws/s3/model/DeleteObjectRequest.h>
-#include <aws/s3/model/DeleteObjectsRequest.h>
-#include <aws/s3/model/GetObjectRequest.h>
+#include <aws/s3/model/CreateMultipartUploadResult.h>
 #include <aws/s3/model/UploadPartRequest.h>
-#include <fmt/core.h>
-#include <sys/uio.h>
+#include <aws/s3/model/UploadPartResult.h>
+#include <glog/logging.h>
 
-#include <cerrno>
+#include <sstream>
+#include <utility>
 
-#include "common/compiler_util.h"
 #include "common/status.h"
-#include "gutil/macros.h"
 #include "io/fs/file_writer.h"
 #include "io/fs/path.h"
-#include "io/fs/s3_file_system.h"
 #include "util/doris_metrics.h"
 
+namespace Aws {
+namespace S3 {
+namespace Model {
+class DeleteObjectRequest;
+} // namespace Model
+} // namespace S3
+} // namespace Aws
+
 using Aws::S3::Model::AbortMultipartUploadRequest;
 using Aws::S3::Model::CompletedPart;
 using Aws::S3::Model::CompletedMultipartUpload;
diff --git a/be/src/io/fs/s3_file_writer.h b/be/src/io/fs/s3_file_writer.h
index 87aa58680f..d8dc9cc800 100644
--- a/be/src/io/fs/s3_file_writer.h
+++ b/be/src/io/fs/s3_file_writer.h
@@ -17,12 +17,19 @@
 
 #pragma once
 
+#include <aws/core/utils/memory/stl/AWSStringStream.h>
+
 #include <cstddef>
 #include <list>
+#include <memory>
+#include <string>
 
+#include "common/status.h"
+#include "io/fs/file_system.h"
 #include "io/fs/file_writer.h"
-#include "io/fs/s3_file_system.h"
+#include "io/fs/path.h"
 #include "util/s3_util.h"
+#include "util/slice.h"
 
 namespace Aws::S3 {
 namespace Model {
diff --git a/be/src/io/fs/stream_load_pipe.cpp b/be/src/io/fs/stream_load_pipe.cpp
index f0e1be2c6e..25099c8796 100644
--- a/be/src/io/fs/stream_load_pipe.cpp
+++ b/be/src/io/fs/stream_load_pipe.cpp
@@ -17,12 +17,22 @@
 
 #include "stream_load_pipe.h"
 
-#include "olap/iterators.h"
+#include <glog/logging.h>
+
+#include <algorithm>
+#include <ostream>
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "runtime/exec_env.h"
 #include "runtime/thread_context.h"
 #include "util/bit_util.h"
 
 namespace doris {
 namespace io {
+class IOContext;
+
 StreamLoadPipe::StreamLoadPipe(size_t max_buffered_bytes, size_t min_chunk_size,
                                int64_t total_length, bool use_proto)
         : _buffered_bytes(0),
diff --git a/be/src/io/fs/stream_load_pipe.h b/be/src/io/fs/stream_load_pipe.h
index 33e72c57a1..e06e7dfc6e 100644
--- a/be/src/io/fs/stream_load_pipe.h
+++ b/be/src/io/fs/stream_load_pipe.h
@@ -18,16 +18,26 @@
 #pragma once
 
 #include <gen_cpp/internal_service.pb.h>
+#include <stddef.h>
+#include <stdint.h>
 
 #include <condition_variable>
 #include <deque>
+#include <memory>
+#include <mutex>
+#include <string>
 
+#include "common/status.h"
 #include "io/fs/file_reader.h"
 #include "io/fs/file_system.h"
+#include "io/fs/path.h"
 #include "runtime/message_body_sink.h"
+#include "util/byte_buffer.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace io {
+class IOContext;
 
 const size_t kMaxPipeBufferedBytes = 4 * 1024 * 1024;
 
diff --git a/be/src/io/hdfs_builder.cpp b/be/src/io/hdfs_builder.cpp
index 3ce48eede7..ca629e4401 100644
--- a/be/src/io/hdfs_builder.cpp
+++ b/be/src/io/hdfs_builder.cpp
@@ -18,14 +18,18 @@
 #include "io/hdfs_builder.h"
 
 #include <fmt/format.h>
+#include <gen_cpp/PlanNodes_types.h>
 
+#include <cstdlib>
 #include <fstream>
+#include <utility>
+#include <vector>
 
 #include "agent/utils.h"
 #include "common/logging.h"
+#include "io/fs/hdfs.h"
 #include "util/string_util.h"
 #include "util/uid_util.h"
-#include "util/url_coding.h"
 
 namespace doris {
 
diff --git a/be/src/io/hdfs_builder.h b/be/src/io/hdfs_builder.h
index 7d448cb1cb..d3f7c35017 100644
--- a/be/src/io/hdfs_builder.h
+++ b/be/src/io/hdfs_builder.h
@@ -17,9 +17,15 @@
 
 #pragma once
 
+#include <gen_cpp/PlanNodes_types.h>
+
+#include <map>
+#include <string>
+
 #include "common/status.h"
-#include "gen_cpp/PlanNodes_types.h"
-#include "io/fs/hdfs.h"
+#include "io/fs/hdfs.h" // IWYU pragma: keep
+
+struct hdfsBuilder;
 
 namespace doris {
 
diff --git a/be/src/io/io_common.h b/be/src/io/io_common.h
index d99b4bb1fb..b3b95853f0 100644
--- a/be/src/io/io_common.h
+++ b/be/src/io/io_common.h
@@ -17,7 +17,7 @@
 
 #pragma once
 
-#include "gen_cpp/Types_types.h"
+#include <gen_cpp/Types_types.h>
 
 namespace doris {
 
diff --git a/be/src/olap/base_compaction.cpp b/be/src/olap/base_compaction.cpp
index d67f8a2d72..c1fcbe3f33 100644
--- a/be/src/olap/base_compaction.cpp
+++ b/be/src/olap/base_compaction.cpp
@@ -17,7 +17,21 @@
 
 #include "olap/base_compaction.h"
 
+#include <gen_cpp/olap_file.pb.h>
+#include <stdint.h>
+#include <time.h>
+
+#include <memory>
+#include <mutex>
+#include <ostream>
+
+#include "common/config.h"
+#include "common/logging.h"
+#include "olap/olap_define.h"
+#include "olap/rowset/rowset_meta.h"
+#include "runtime/thread_context.h"
 #include "util/doris_metrics.h"
+#include "util/thread.h"
 #include "util/trace.h"
 
 namespace doris {
diff --git a/be/src/olap/base_compaction.h b/be/src/olap/base_compaction.h
index da53a89d95..ecee304449 100644
--- a/be/src/olap/base_compaction.h
+++ b/be/src/olap/base_compaction.h
@@ -17,7 +17,16 @@
 
 #pragma once
 
+#include <butil/macros.h>
+
+#include <string>
+#include <vector>
+
+#include "common/status.h"
+#include "io/io_common.h"
 #include "olap/compaction.h"
+#include "olap/rowset/rowset.h"
+#include "olap/tablet.h"
 
 namespace doris {
 
diff --git a/be/src/olap/base_tablet.cpp b/be/src/olap/base_tablet.cpp
index ee2e9539ab..3af9615168 100644
--- a/be/src/olap/base_tablet.cpp
+++ b/be/src/olap/base_tablet.cpp
@@ -17,11 +17,18 @@
 
 #include "olap/base_tablet.h"
 
+#include <fmt/format.h>
+#include <glog/logging.h>
+
+#include <ostream>
+#include <vector>
+
 #include "gutil/strings/substitute.h"
 #include "olap/data_dir.h"
+#include "olap/olap_define.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/tablet_schema_cache.h"
 #include "util/doris_metrics.h"
-#include "util/path_util.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/olap/base_tablet.h b/be/src/olap/base_tablet.h
index 05707e81a6..164215989b 100644
--- a/be/src/olap/base_tablet.h
+++ b/be/src/olap/base_tablet.h
@@ -17,13 +17,17 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <stdint.h>
+
 #include <memory>
 #include <string>
 
-#include "olap/olap_define.h"
+#include "common/status.h"
+#include "olap/olap_common.h"
 #include "olap/tablet_meta.h"
 #include "olap/tablet_schema.h"
-#include "olap/utils.h"
 #include "util/metrics.h"
 
 namespace doris {
diff --git a/be/src/olap/block_column_predicate.cpp b/be/src/olap/block_column_predicate.cpp
index ff7e0ba694..1bcde94de3 100644
--- a/be/src/olap/block_column_predicate.cpp
+++ b/be/src/olap/block_column_predicate.cpp
@@ -17,9 +17,17 @@
 
 #include "block_column_predicate.h"
 
-#include "olap/rowset/segment_v2/bloom_filter.h"
+#include <string.h>
+
+namespace roaring {
+class Roaring;
+} // namespace roaring
 
 namespace doris {
+class WrapperField;
+namespace segment_v2 {
+class InvertedIndexIterator;
+} // namespace segment_v2
 
 uint16_t SingleColumnBlockPredicate::evaluate(vectorized::MutableColumns& block, uint16_t* sel,
                                               uint16_t selected_size) const {
diff --git a/be/src/olap/block_column_predicate.h b/be/src/olap/block_column_predicate.h
index 18c957e3c4..467962e809 100644
--- a/be/src/olap/block_column_predicate.h
+++ b/be/src/olap/block_column_predicate.h
@@ -17,15 +17,33 @@
 
 #pragma once
 
+#include <glog/logging.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
+#include <ostream>
+#include <set>
+#include <string>
+#include <utility>
 #include <vector>
 
+#include "common/status.h"
 #include "olap/column_predicate.h"
+#include "olap/olap_common.h"
+#include "vec/columns/column.h"
+
+namespace roaring {
+class Roaring;
+} // namespace roaring
 
 namespace doris {
+class WrapperField;
 
 namespace segment_v2 {
 class BloomFilter;
-}
+class InvertedIndexIterator;
+} // namespace segment_v2
 
 // Block Column Predicate support do column predicate and support OR and AND predicate
 // Block Column Predicate will replace column predicate as a unified external vectorized interface
diff --git a/be/src/olap/cold_data_compaction.cpp b/be/src/olap/cold_data_compaction.cpp
index 2a27d92acb..6757691d84 100644
--- a/be/src/olap/cold_data_compaction.cpp
+++ b/be/src/olap/cold_data_compaction.cpp
@@ -17,10 +17,25 @@
 
 #include "olap/cold_data_compaction.h"
 
-#include "common/compiler_util.h"
+#include <stdint.h>
+
+#include <algorithm>
+#include <memory>
+#include <mutex>
+#include <shared_mutex>
+#include <utility>
+#include <vector>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/config.h"
 #include "olap/compaction.h"
-#include "olap/rowset/beta_rowset.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/rowset.h"
+#include "olap/tablet_meta.h"
+#include "runtime/thread_context.h"
+#include "util/thread.h"
+#include "util/uid_util.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/olap/cold_data_compaction.h b/be/src/olap/cold_data_compaction.h
index b9e8465273..0b2eddf234 100644
--- a/be/src/olap/cold_data_compaction.h
+++ b/be/src/olap/cold_data_compaction.h
@@ -17,7 +17,13 @@
 
 #pragma once
 
+#include <string>
+
+#include "common/status.h"
+#include "io/io_common.h"
 #include "olap/compaction.h"
+#include "olap/merger.h"
+#include "olap/tablet.h"
 
 namespace doris {
 
diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp
index cacf3a9b66..608c89f6ae 100644
--- a/be/src/olap/compaction.cpp
+++ b/be/src/olap/compaction.cpp
@@ -17,14 +17,39 @@
 
 #include "olap/compaction.h"
 
+#include <fmt/format.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <glog/logging.h>
+
+#include <algorithm>
+#include <cstdlib>
+#include <list>
+#include <map>
+#include <mutex>
+#include <ostream>
+#include <set>
+#include <shared_mutex>
+#include <utility>
+
+#include "common/config.h"
 #include "common/status.h"
-#include "gutil/strings/substitute.h"
+#include "io/fs/file_system.h"
+#include "io/fs/remote_file_system.h"
+#include "olap/cumulative_compaction_policy.h"
+#include "olap/data_dir.h"
+#include "olap/olap_define.h"
 #include "olap/rowset/beta_rowset.h"
 #include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_meta.h"
+#include "olap/rowset/rowset_writer.h"
 #include "olap/rowset/rowset_writer_context.h"
+#include "olap/storage_engine.h"
+#include "olap/storage_policy.h"
 #include "olap/tablet.h"
+#include "olap/tablet_meta.h"
 #include "olap/task/engine_checksum_task.h"
+#include "olap/utils.h"
+#include "runtime/memory/mem_tracker_limiter.h"
 #include "util/time.h"
 #include "util/trace.h"
 
diff --git a/be/src/olap/compaction.h b/be/src/olap/compaction.h
index cf35ee8aa6..17acb45710 100644
--- a/be/src/olap/compaction.h
+++ b/be/src/olap/compaction.h
@@ -17,21 +17,27 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <stdint.h>
+
+#include <memory>
+#include <string>
 #include <vector>
 
+#include "common/status.h"
+#include "io/io_common.h"
 #include "olap/merger.h"
 #include "olap/olap_common.h"
-#include "olap/olap_define.h"
-#include "olap/storage_engine.h"
+#include "olap/rowid_conversion.h"
+#include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_reader.h"
 #include "olap/tablet.h"
-#include "olap/tablet_meta.h"
-#include "olap/utils.h"
-#include "rowset/rowset_id_generator.h"
+#include "olap/tablet_schema.h"
 
 namespace doris {
 
-class DataDir;
-class Merger;
+class MemTrackerLimiter;
+class RowsetWriter;
 
 // This class is a base class for compaction.
 // The entrance of this class is compact()
diff --git a/be/src/olap/compaction_permit_limiter.cpp b/be/src/olap/compaction_permit_limiter.cpp
index 2d6309ae6c..0986730059 100644
--- a/be/src/olap/compaction_permit_limiter.cpp
+++ b/be/src/olap/compaction_permit_limiter.cpp
@@ -17,6 +17,9 @@
 
 #include "olap/compaction_permit_limiter.h"
 
+#include "common/config.h"
+#include "util/doris_metrics.h"
+
 namespace doris {
 
 CompactionPermitLimiter::CompactionPermitLimiter() : _used_permits(0) {}
diff --git a/be/src/olap/compaction_permit_limiter.h b/be/src/olap/compaction_permit_limiter.h
index 21c819830d..c00e0aae27 100644
--- a/be/src/olap/compaction_permit_limiter.h
+++ b/be/src/olap/compaction_permit_limiter.h
@@ -17,13 +17,12 @@
 
 #pragma once
 
+#include <stdint.h>
+
+#include <atomic>
 #include <condition_variable>
 #include <mutex>
 
-#include "common/config.h"
-#include "olap/utils.h"
-#include "util/doris_metrics.h"
-
 namespace doris {
 
 /*
diff --git a/be/src/olap/comparison_predicate.h b/be/src/olap/comparison_predicate.h
index 0371b27282..c74b06eaf3 100644
--- a/be/src/olap/comparison_predicate.h
+++ b/be/src/olap/comparison_predicate.h
@@ -21,6 +21,7 @@
 
 #include "olap/column_predicate.h"
 #include "olap/rowset/segment_v2/bloom_filter.h"
+#include "olap/rowset/segment_v2/inverted_index_cache.h" // IWYU pragma: keep
 #include "olap/rowset/segment_v2/inverted_index_reader.h"
 #include "olap/wrapper_field.h"
 #include "vec/columns/column_dictionary.h"
diff --git a/be/src/olap/cumulative_compaction.cpp b/be/src/olap/cumulative_compaction.cpp
index 745b316cab..303b58eefe 100644
--- a/be/src/olap/cumulative_compaction.cpp
+++ b/be/src/olap/cumulative_compaction.cpp
@@ -17,6 +17,19 @@
 
 #include "olap/cumulative_compaction.h"
 
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
+#include <mutex>
+#include <ostream>
+
+#include "common/config.h"
+#include "common/logging.h"
+#include "olap/cumulative_compaction_policy.h"
+#include "olap/olap_define.h"
+#include "olap/rowset/rowset_meta.h"
+#include "runtime/thread_context.h"
 #include "util/doris_metrics.h"
 #include "util/time.h"
 #include "util/trace.h"
diff --git a/be/src/olap/cumulative_compaction.h b/be/src/olap/cumulative_compaction.h
index fdfc9dbe46..d74542a2ff 100644
--- a/be/src/olap/cumulative_compaction.h
+++ b/be/src/olap/cumulative_compaction.h
@@ -17,10 +17,17 @@
 
 #pragma once
 
+#include <butil/macros.h>
+
 #include <string>
+#include <vector>
 
+#include "common/status.h"
+#include "io/io_common.h"
 #include "olap/compaction.h"
-#include "olap/cumulative_compaction_policy.h"
+#include "olap/olap_common.h"
+#include "olap/rowset/rowset.h"
+#include "olap/tablet.h"
 
 namespace doris {
 
diff --git a/be/src/olap/cumulative_compaction_policy.cpp b/be/src/olap/cumulative_compaction_policy.cpp
index b38271fd1a..d5d86ad142 100644
--- a/be/src/olap/cumulative_compaction_policy.cpp
+++ b/be/src/olap/cumulative_compaction_policy.cpp
@@ -17,10 +17,15 @@
 
 #include "olap/cumulative_compaction_policy.h"
 
-#include <boost/algorithm/string.hpp>
+#include <algorithm>
+#include <list>
+#include <ostream>
 #include <string>
 
-#include "util/time.h"
+#include "common/logging.h"
+#include "olap/olap_common.h"
+#include "olap/tablet.h"
+#include "olap/tablet_meta.h"
 
 namespace doris {
 
diff --git a/be/src/olap/cumulative_compaction_policy.h b/be/src/olap/cumulative_compaction_policy.h
index 20a9d64b61..a12d1d8e8b 100644
--- a/be/src/olap/cumulative_compaction_policy.h
+++ b/be/src/olap/cumulative_compaction_policy.h
@@ -17,17 +17,21 @@
 
 #pragma once
 
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
 #include <string>
+#include <vector>
 
+#include "common/config.h"
 #include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_meta.h"
-#include "olap/tablet.h"
-#include "olap/tablet_meta.h"
-#include "olap/utils.h"
 
 namespace doris {
 
 class Tablet;
+struct Version;
 
 const static std::string CUMULATIVE_SIZE_BASED_POLICY = "SIZE_BASED";
 
diff --git a/be/src/olap/data_dir.cpp b/be/src/olap/data_dir.cpp
index c1f6e807d7..b83ce43635 100644
--- a/be/src/olap/data_dir.cpp
+++ b/be/src/olap/data_dir.cpp
@@ -17,42 +17,50 @@
 
 #include "olap/data_dir.h"
 
-#include "olap/storage_policy.h"
-
-#ifndef __APPLE__
-#include <mntent.h>
-#include <sys/statfs.h>
-#endif
-
-#include <ctype.h>
+#include <fmt/format.h>
+#include <gen_cpp/Types_types.h>
 #include <gen_cpp/olap_file.pb.h>
 #include <stdio.h>
-#include <sys/file.h>
-#include <utime.h>
 
 #include <atomic>
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/predicate.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <boost/algorithm/string/trim.hpp>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <filesystem>
 #include <memory>
+#include <new>
 #include <set>
 #include <sstream>
 #include <string>
+#include <thread>
+#include <utility>
 
+#include "common/config.h"
+#include "common/logging.h"
 #include "gutil/strings/substitute.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "io/fs/file_writer.h"
 #include "io/fs/fs_utils.h"
 #include "io/fs/local_file_system.h"
 #include "io/fs/path.h"
+#include "io/fs/remote_file_system.h"
 #include "olap/olap_define.h"
+#include "olap/olap_meta.h"
 #include "olap/rowset/beta_rowset.h"
+#include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_id_generator.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/rowset/rowset_meta_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_manager.h"
+#include "olap/txn_manager.h"
 #include "olap/utils.h" // for check_dir_existed
 #include "service/backend_options.h"
-#include "util/errno.h"
+#include "util/doris_metrics.h"
 #include "util/string_util.h"
+#include "util/uid_util.h"
 
 using strings::Substitute;
 
diff --git a/be/src/olap/data_dir.h b/be/src/olap/data_dir.h
index f9aa644b91..9c6adab9c5 100644
--- a/be/src/olap/data_dir.h
+++ b/be/src/olap/data_dir.h
@@ -17,28 +17,32 @@
 
 #pragma once
 
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <atomic>
 #include <condition_variable>
 #include <cstdint>
+#include <memory>
 #include <mutex>
 #include <set>
 #include <shared_mutex>
 #include <string>
+#include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/Types_types.h"
-#include "gen_cpp/olap_file.pb.h"
 #include "io/fs/file_system.h"
 #include "io/fs/fs_utils.h"
 #include "olap/olap_common.h"
-#include "olap/rowset/rowset_id_generator.h"
 #include "util/metrics.h"
 
 namespace doris {
 
 class Tablet;
 class TabletManager;
-class TabletMeta;
 class TxnManager;
+class OlapMeta;
+class RowsetIdGenerator;
 
 // A DataDir used to manage data in same path.
 // Now, After DataDir was created, it will never be deleted for easy implementation.
diff --git a/be/src/olap/delete_handler.cpp b/be/src/olap/delete_handler.cpp
index 655670e9a8..9beafe634f 100644
--- a/be/src/olap/delete_handler.cpp
+++ b/be/src/olap/delete_handler.cpp
@@ -17,20 +17,24 @@
 
 #include "olap/delete_handler.h"
 
-#include <errno.h>
-#include <json2pb/pb_to_json.h>
+#include <gen_cpp/PaloInternalService_types.h>
+#include <gen_cpp/olap_file.pb.h>
 #include <thrift/protocol/TDebugProtocol.h>
 
+#include <algorithm>
 #include <limits>
 #include <regex>
 #include <sstream>
 #include <string>
+#include <utility>
 #include <vector>
 
-#include "gen_cpp/olap_file.pb.h"
+#include "common/config.h"
+#include "common/logging.h"
+#include "olap/block_column_predicate.h"
+#include "olap/column_predicate.h"
 #include "olap/olap_common.h"
 #include "olap/predicate_creator.h"
-#include "olap/tablet.h"
 #include "olap/utils.h"
 
 using apache::thrift::ThriftDebugString;
diff --git a/be/src/olap/delete_handler.h b/be/src/olap/delete_handler.h
index f18b7c69bd..7239f4326b 100644
--- a/be/src/olap/delete_handler.h
+++ b/be/src/olap/delete_handler.h
@@ -17,23 +17,25 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <stdint.h>
+
+#include <memory>
 #include <string>
+#include <unordered_map>
 #include <vector>
 
-#include "gen_cpp/AgentService_types.h"
-#include "gen_cpp/olap_file.pb.h"
-#include "olap/block_column_predicate.h"
-#include "olap/column_predicate.h"
-#include "olap/olap_define.h"
+#include "common/status.h"
 #include "olap/rowset/rowset_meta.h"
 #include "olap/tablet_schema.h"
+#include "vec/common/arena.h"
 
 namespace doris {
 
-class RowCursor;
-class Tablet;
-class TabletReader;
-class TabletSchema;
+class AndBlockColumnPredicate;
+class ColumnPredicate;
+class DeletePredicatePB;
+class TCondition;
 
 // Represent a delete condition.
 struct DeleteConditions {
diff --git a/be/src/olap/delta_writer.cpp b/be/src/olap/delta_writer.cpp
index 5f339a5471..b846a5479f 100644
--- a/be/src/olap/delta_writer.cpp
+++ b/be/src/olap/delta_writer.cpp
@@ -17,21 +17,49 @@
 
 #include "olap/delta_writer.h"
 
+#include <brpc/controller.h>
+#include <butil/errno.h>
+#include <fmt/format.h>
+#include <gen_cpp/internal_service.pb.h>
+#include <gen_cpp/olap_file.pb.h>
+
+#include <filesystem>
+#include <ostream>
+#include <string>
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/config.h"
+#include "common/logging.h"
 #include "common/status.h"
 #include "exec/tablet_info.h"
+#include "gutil/strings/numbers.h"
+#include "io/fs/file_writer.h" // IWYU pragma: keep
 #include "olap/data_dir.h"
 #include "olap/memtable.h"
 #include "olap/memtable_flush_executor.h"
+#include "olap/olap_define.h"
 #include "olap/rowset/beta_rowset.h"
 #include "olap/rowset/beta_rowset_writer.h"
+#include "olap/rowset/rowset_meta.h"
+#include "olap/rowset/rowset_writer.h"
 #include "olap/rowset/rowset_writer_context.h"
+#include "olap/rowset/segment_v2/segment.h"
 #include "olap/schema.h"
 #include "olap/schema_change.h"
 #include "olap/storage_engine.h"
+#include "olap/tablet_manager.h"
+#include "olap/txn_manager.h"
+#include "runtime/exec_env.h"
 #include "runtime/load_channel_mgr.h"
+#include "runtime/memory/mem_tracker.h"
 #include "service/backend_options.h"
 #include "util/brpc_client_cache.h"
 #include "util/ref_count_closure.h"
+#include "util/stopwatch.hpp"
+#include "util/time.h"
+#include "vec/core/block.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/olap/delta_writer.h b/be/src/olap/delta_writer.h
index 0b133e6ac9..03b30160fe 100644
--- a/be/src/olap/delta_writer.h
+++ b/be/src/olap/delta_writer.h
@@ -17,10 +17,26 @@
 
 #pragma once
 
-#include "gen_cpp/internal_service.pb.h"
-#include "olap/rowset/rowset_writer.h"
+#include <gen_cpp/Types_types.h>
+#include <gen_cpp/internal_service.pb.h>
+#include <gen_cpp/types.pb.h>
+#include <stdint.h>
+
+#include <atomic>
+#include <memory>
+#include <mutex>
+#include <shared_mutex>
+#include <unordered_set>
+#include <vector>
+
+#include "common/status.h"
+#include "olap/olap_common.h"
+#include "olap/rowset/rowset.h"
 #include "olap/tablet.h"
+#include "olap/tablet_meta.h"
+#include "olap/tablet_schema.h"
 #include "util/spinlock.h"
+#include "util/uid_util.h"
 
 namespace doris {
 
@@ -31,6 +47,12 @@ class Schema;
 class StorageEngine;
 class TupleDescriptor;
 class SlotDescriptor;
+class OlapTableSchemaParam;
+class RowsetWriter;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 enum WriteType { LOAD = 1, LOAD_DELETE = 2, DELETE = 3 };
 
diff --git a/be/src/olap/hll.cpp b/be/src/olap/hll.cpp
index 8f7a61e712..bfbe954217 100644
--- a/be/src/olap/hll.cpp
+++ b/be/src/olap/hll.cpp
@@ -17,12 +17,14 @@
 
 #include "olap/hll.h"
 
-#include <algorithm>
+#include <cmath>
 #include <map>
+#include <new>
+#include <ostream>
 
 #include "common/logging.h"
 #include "util/coding.h"
-#include "vec/common/string_ref.h"
+#include "util/slice.h"
 
 using std::map;
 using std::nothrow;
diff --git a/be/src/olap/hll.h b/be/src/olap/hll.h
index f1ad81100b..7c88abfbb5 100644
--- a/be/src/olap/hll.h
+++ b/be/src/olap/hll.h
@@ -17,18 +17,17 @@
 
 #pragma once
 
-#include <math.h>
-#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
 
 #include <map>
-#include <set>
 #include <string>
+#include <utility>
 
 #ifdef __x86_64__
 #include <immintrin.h>
 #endif
 
-#include "gutil/macros.h"
 #include "vec/common/hash_table/phmap_fwd_decl.h"
 
 namespace doris {
diff --git a/be/src/olap/in_list_predicate.h b/be/src/olap/in_list_predicate.h
index e207bf28d5..abecd69077 100644
--- a/be/src/olap/in_list_predicate.h
+++ b/be/src/olap/in_list_predicate.h
@@ -25,6 +25,7 @@
 #include "olap/column_predicate.h"
 #include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/bloom_filter.h"
+#include "olap/rowset/segment_v2/inverted_index_cache.h" // IWYU pragma: keep
 #include "olap/rowset/segment_v2/inverted_index_reader.h"
 #include "olap/wrapper_field.h"
 #include "runtime/define_primitive_type.h"
diff --git a/be/src/olap/itoken_extractor.cpp b/be/src/olap/itoken_extractor.cpp
index 90ad29d291..fefe86ec27 100644
--- a/be/src/olap/itoken_extractor.cpp
+++ b/be/src/olap/itoken_extractor.cpp
@@ -17,6 +17,8 @@
 
 #include "itoken_extractor.h"
 
+#include <stdint.h>
+
 #include "util/simd/vstring_function.h"
 
 namespace doris {
diff --git a/be/src/olap/key_coder.cpp b/be/src/olap/key_coder.cpp
index 450c805a8d..803b353375 100644
--- a/be/src/olap/key_coder.cpp
+++ b/be/src/olap/key_coder.cpp
@@ -17,7 +17,9 @@
 
 #include "olap/key_coder.h"
 
+#include <cstddef>
 #include <unordered_map>
+#include <utility>
 
 namespace doris {
 
diff --git a/be/src/olap/key_coder.h b/be/src/olap/key_coder.h
index 411517bd05..87c2748688 100644
--- a/be/src/olap/key_coder.h
+++ b/be/src/olap/key_coder.h
@@ -17,13 +17,23 @@
 
 #pragma once
 
+#include <glog/logging.h>
+#include <limits.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <algorithm>
+#include <ostream>
 #include <string>
 #include <type_traits>
 
 #include "common/status.h"
 #include "gutil/endian.h"
 #include "gutil/strings/substitute.h"
+#include "olap/decimal12.h"
+#include "olap/olap_common.h"
 #include "olap/types.h"
+#include "util/slice.h"
 
 namespace doris {
 
diff --git a/be/src/olap/like_column_predicate.cpp b/be/src/olap/like_column_predicate.cpp
index 049a419fbf..ef1374d445 100644
--- a/be/src/olap/like_column_predicate.cpp
+++ b/be/src/olap/like_column_predicate.cpp
@@ -17,8 +17,10 @@
 
 #include "olap/like_column_predicate.h"
 
-#include "olap/field.h"
+#include "runtime/define_primitive_type.h"
 #include "udf/udf.h"
+#include "vec/columns/columns_number.h"
+#include "vec/columns/predicate_column.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
diff --git a/be/src/olap/like_column_predicate.h b/be/src/olap/like_column_predicate.h
index 11e4c9f07f..ddbe892303 100644
--- a/be/src/olap/like_column_predicate.h
+++ b/be/src/olap/like_column_predicate.h
@@ -16,14 +16,36 @@
 // under the License.
 #pragma once
 
+#include <glog/logging.h>
+#include <stdint.h>
+
+#include <boost/iterator/iterator_facade.hpp>
+#include <functional>
+#include <memory>
+#include <ostream>
+#include <string>
+#include <utility>
+
+#include "common/status.h"
 #include "olap/column_predicate.h"
-#include "udf/udf.h"
+#include "olap/rowset/segment_v2/bloom_filter.h"
+#include "vec/columns/column.h"
 #include "vec/columns/column_dictionary.h"
+#include "vec/columns/column_nullable.h"
 #include "vec/common/string_ref.h"
 #include "vec/core/types.h"
 #include "vec/functions/like.h"
 
+namespace roaring {
+class Roaring;
+} // namespace roaring
+
 namespace doris {
+class FunctionContext;
+
+namespace segment_v2 {
+class BitmapIndexIterator;
+} // namespace segment_v2
 
 class LikeColumnPredicate : public ColumnPredicate {
 public:
diff --git a/be/src/olap/lru_cache.cpp b/be/src/olap/lru_cache.cpp
index 2132db5b2d..000315f773 100644
--- a/be/src/olap/lru_cache.cpp
+++ b/be/src/olap/lru_cache.cpp
@@ -4,17 +4,14 @@
 
 #include "olap/lru_cache.h"
 
-#include <rapidjson/document.h>
-#include <stdio.h>
 #include <stdlib.h>
 
+#include <mutex>
+#include <new>
 #include <sstream>
 #include <string>
 
 #include "gutil/bits.h"
-#include "olap/olap_common.h"
-#include "olap/olap_define.h"
-#include "olap/utils.h"
 #include "runtime/thread_context.h"
 #include "util/doris_metrics.h"
 
diff --git a/be/src/olap/lru_cache.h b/be/src/olap/lru_cache.h
index 599f386e1b..654b9e8964 100644
--- a/be/src/olap/lru_cache.h
+++ b/be/src/olap/lru_cache.h
@@ -4,18 +4,22 @@
 
 #pragma once
 
+#include <assert.h>
+#include <butil/macros.h>
+#include <glog/logging.h>
 #include <gtest/gtest_prod.h>
-#include <rapidjson/document.h>
 #include <stdint.h>
+#include <stdlib.h>
 #include <string.h>
 
+#include <atomic>
 #include <functional>
-#include <queue>
+#include <memory>
+#include <set>
 #include <string>
-#include <vector>
+#include <utility>
 
-#include "olap/olap_common.h"
-#include "runtime/memory/mem_tracker.h"
+#include "runtime/memory/mem_tracker_limiter.h"
 #include "runtime/thread_context.h"
 #include "util/doris_metrics.h"
 #include "util/lock.h"
@@ -49,7 +53,6 @@ namespace doris {
     } while (0)
 
 class Cache;
-class CacheKey;
 
 enum LRUCacheType {
     SIZE,  // The capacity of cache is based on the size of cache entry.
diff --git a/be/src/olap/match_predicate.cpp b/be/src/olap/match_predicate.cpp
index 22d56cd1ff..6837d78f4e 100644
--- a/be/src/olap/match_predicate.cpp
+++ b/be/src/olap/match_predicate.cpp
@@ -17,14 +17,16 @@
 
 #include "olap/match_predicate.h"
 
-#include <string.h>
-
-#include <memory>
-#include <sstream>
+#include <roaring/roaring.hh>
 
 #include "exec/olap_utils.h"
-#include "exprs/string_functions.h"
+#include "olap/field.h"
+#include "olap/olap_common.h"
+#include "olap/rowset/segment_v2/inverted_index_cache.h"
+#include "olap/rowset/segment_v2/inverted_index_reader.h"
 #include "olap/schema.h"
+#include "olap/types.h"
+#include "olap/utils.h"
 #include "vec/common/string_ref.h"
 
 namespace doris {
diff --git a/be/src/olap/match_predicate.h b/be/src/olap/match_predicate.h
index ff41fb00eb..ad793b90f8 100644
--- a/be/src/olap/match_predicate.h
+++ b/be/src/olap/match_predicate.h
@@ -18,17 +18,30 @@
 #ifndef DORIS_BE_SRC_QUERY_EXPRS_MATCH_PREDICATE_H
 #define DORIS_BE_SRC_QUERY_EXPRS_MATCH_PREDICATE_H
 
-#include <memory>
+#include <glog/logging.h>
+#include <stdint.h>
+
+#include <ostream>
 #include <string>
 
-#include "gen_cpp/Exprs_types.h"
+#include "common/status.h"
 #include "olap/column_predicate.h"
-#include "runtime/string_search.hpp"
+#include "olap/schema.h"
+
+namespace roaring {
+class Roaring;
+} // namespace roaring
 
 namespace doris {
 
 enum class MatchType;
 
+namespace segment_v2 {
+class BitmapIndexIterator;
+class InvertedIndexIterator;
+enum class InvertedIndexQueryType;
+} // namespace segment_v2
+
 class MatchPredicate : public ColumnPredicate {
 public:
     MatchPredicate(uint32_t column_id, const std::string& value, MatchType match_type);
diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp
index db18782dc3..9084cc617a 100644
--- a/be/src/olap/memtable.cpp
+++ b/be/src/olap/memtable.cpp
@@ -17,18 +17,41 @@
 
 #include "olap/memtable.h"
 
+#include <fmt/format.h>
+#include <gen_cpp/olap_file.pb.h>
+
+#include <algorithm>
+#include <limits>
+#include <shared_mutex>
+#include <string>
+#include <utility>
+
+#include "common/config.h"
+#include "common/consts.h"
 #include "common/logging.h"
+#include "olap/olap_define.h"
 #include "olap/rowset/beta_rowset.h"
 #include "olap/rowset/rowset_writer.h"
+#include "olap/rowset/segment_v2/segment.h"
 #include "olap/schema.h"
 #include "olap/schema_change.h"
+#include "olap/tablet_schema.h"
+#include "runtime/descriptors.h"
+#include "runtime/exec_env.h"
 #include "runtime/load_channel_mgr.h"
+#include "runtime/thread_context.h"
 #include "util/doris_metrics.h"
+#include "util/runtime_profile.h"
+#include "util/stopwatch.hpp"
 #include "vec/aggregate_functions/aggregate_function_reader.h"
 #include "vec/aggregate_functions/aggregate_function_simple_factory.h"
+#include "vec/columns/column.h"
 #include "vec/columns/column_object.h"
-#include "vec/core/columns_with_type_and_name.h"
-#include "vec/core/field.h"
+#include "vec/columns/column_string.h"
+#include "vec/common/assert_cast.h"
+#include "vec/core/column_with_type_and_name.h"
+#include "vec/data_types/data_type.h"
+#include "vec/json/path_in_data.h"
 #include "vec/jsonb/serialize.h"
 
 namespace doris {
diff --git a/be/src/olap/memtable.h b/be/src/olap/memtable.h
index e47e696bb0..f50b78c0b1 100644
--- a/be/src/olap/memtable.h
+++ b/be/src/olap/memtable.h
@@ -17,16 +17,22 @@
 
 #pragma once
 
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
 #include <ostream>
+#include <vector>
 
 #include "common/object_pool.h"
-#include "olap/olap_define.h"
+#include "common/status.h"
+#include "olap/olap_common.h"
 #include "olap/skiplist.h"
 #include "olap/tablet.h"
+#include "olap/tablet_meta.h"
 #include "runtime/memory/mem_tracker.h"
 #include "vec/aggregate_functions/aggregate_function.h"
 #include "vec/common/arena.h"
-#include "vec/common/string_ref.h"
 #include "vec/core/block.h"
 
 namespace doris {
@@ -36,6 +42,7 @@ class Schema;
 class SlotDescriptor;
 class TabletSchema;
 class TupleDescriptor;
+enum KeysType : int;
 
 class MemTable {
 public:
diff --git a/be/src/olap/memtable_flush_executor.cpp b/be/src/olap/memtable_flush_executor.cpp
index b40ca93d9d..9c5b92ed10 100644
--- a/be/src/olap/memtable_flush_executor.cpp
+++ b/be/src/olap/memtable_flush_executor.cpp
@@ -17,11 +17,16 @@
 
 #include "olap/memtable_flush_executor.h"
 
-#include <functional>
+#include <gen_cpp/olap_file.pb.h>
+#include <stddef.h>
 
+#include <algorithm>
+#include <ostream>
+
+#include "common/config.h"
+#include "common/logging.h"
 #include "olap/memtable.h"
-#include "runtime/thread_context.h"
-#include "util/scoped_cleanup.h"
+#include "util/stopwatch.hpp"
 #include "util/time.h"
 
 namespace doris {
diff --git a/be/src/olap/memtable_flush_executor.h b/be/src/olap/memtable_flush_executor.h
index ff5e1e08e8..7608fa4d19 100644
--- a/be/src/olap/memtable_flush_executor.h
+++ b/be/src/olap/memtable_flush_executor.h
@@ -17,21 +17,22 @@
 
 #pragma once
 
+#include <stdint.h>
+
 #include <atomic>
+#include <iosfwd>
 #include <memory>
+#include <utility>
 #include <vector>
 
-#include "gen_cpp/olap_file.pb.h"
-#include "olap/olap_define.h"
+#include "common/status.h"
 #include "util/threadpool.h"
 
 namespace doris {
 
 class DataDir;
-class DeltaWriter;
-class ExecEnv;
 class MemTable;
-class MemTrackerLimiter;
+enum RowsetTypePB : int;
 
 // the statistic of a certain flush handler.
 // use atomic because it may be updated by multi threads
diff --git a/be/src/olap/merger.cpp b/be/src/olap/merger.cpp
index a12cc4cc16..437d9ba9eb 100644
--- a/be/src/olap/merger.cpp
+++ b/be/src/olap/merger.cpp
@@ -17,15 +17,39 @@
 
 #include "olap/merger.h"
 
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/types.pb.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <iterator>
 #include <memory>
+#include <numeric>
+#include <ostream>
+#include <shared_mutex>
+#include <string>
+#include <utility>
 #include <vector>
 
+#include "common/config.h"
+#include "common/logging.h"
+#include "olap/olap_common.h"
 #include "olap/olap_define.h"
-#include "olap/row_cursor.h"
+#include "olap/reader.h"
+#include "olap/rowid_conversion.h"
+#include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_meta.h"
+#include "olap/rowset/rowset_writer.h"
+#include "olap/rowset/segment_v2/segment_writer.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet.h"
+#include "olap/utils.h"
+#include "util/slice.h"
 #include "util/trace.h"
+#include "vec/core/block.h"
 #include "vec/olap/block_reader.h"
+#include "vec/olap/vertical_block_reader.h"
+#include "vec/olap/vertical_merge_iterator.h"
 
 namespace doris {
 
diff --git a/be/src/olap/merger.h b/be/src/olap/merger.h
index 467c126304..37291c548c 100644
--- a/be/src/olap/merger.h
+++ b/be/src/olap/merger.h
@@ -17,20 +17,29 @@
 
 #pragma once
 
+#include <stdint.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "io/io_common.h"
-#include "olap/olap_define.h"
-#include "olap/rowid_conversion.h"
-#include "olap/rowset/rowset_writer.h"
-#include "olap/rowset/segment_v2/segment_writer.h"
+#include "olap/rowset/rowset_reader.h"
 #include "olap/tablet.h"
-#include "vec/olap/vertical_block_reader.h"
-#include "vec/olap/vertical_merge_iterator.h"
+#include "olap/tablet_schema.h"
 
 namespace doris {
+class KeyBoundsPB;
+class RowIdConversion;
+class RowsetWriter;
+
+namespace segment_v2 {
+class SegmentWriter;
+} // namespace segment_v2
 
 namespace vectorized {
 class RowSourcesBuffer;
-};
+class VerticalBlockReader;
+}; // namespace vectorized
 
 class Merger {
 public:
diff --git a/be/src/olap/null_predicate.cpp b/be/src/olap/null_predicate.cpp
index e9a9bf9705..e4130f0d32 100644
--- a/be/src/olap/null_predicate.cpp
+++ b/be/src/olap/null_predicate.cpp
@@ -17,9 +17,16 @@
 
 #include "olap/null_predicate.h"
 
-#include "olap/field.h"
+#include <string.h>
+
+#include <roaring/roaring.hh>
+
+#include "olap/rowset/segment_v2/bitmap_index_reader.h"
+#include "olap/rowset/segment_v2/inverted_index_cache.h"
+#include "olap/rowset/segment_v2/inverted_index_reader.h"
+#include "vec/columns/column.h"
 #include "vec/columns/column_nullable.h"
-#include "vec/common/string_ref.h"
+#include "vec/runtime/vdatetime_value.h"
 
 using namespace doris::vectorized;
 
diff --git a/be/src/olap/null_predicate.h b/be/src/olap/null_predicate.h
index e878907228..ed81cc6f1b 100644
--- a/be/src/olap/null_predicate.h
+++ b/be/src/olap/null_predicate.h
@@ -17,15 +17,31 @@
 
 #pragma once
 
+#include <glog/logging.h>
 #include <stdint.h>
 
-#include <roaring/roaring.hh>
+#include <ostream>
+#include <string>
+#include <utility>
 
+#include "common/status.h"
 #include "olap/column_predicate.h"
 #include "olap/rowset/segment_v2/bloom_filter.h"
+#include "olap/schema.h"
 #include "olap/wrapper_field.h"
 
+namespace roaring {
+class Roaring;
+} // namespace roaring
+
 namespace doris {
+namespace segment_v2 {
+class BitmapIndexIterator;
+class InvertedIndexIterator;
+} // namespace segment_v2
+namespace vectorized {
+class IColumn;
+} // namespace vectorized
 
 class NullPredicate : public ColumnPredicate {
 public:
diff --git a/be/src/olap/olap_common.h b/be/src/olap/olap_common.h
index afb2bdcf22..ad81578a6a 100644
--- a/be/src/olap/olap_common.h
+++ b/be/src/olap/olap_common.h
@@ -17,6 +17,7 @@
 
 #pragma once
 
+#include <gen_cpp/Types_types.h>
 #include <netinet/in.h>
 
 #include <cstdint>
@@ -31,7 +32,6 @@
 #include <unordered_map>
 #include <unordered_set>
 
-#include "gen_cpp/Types_types.h"
 #include "io/io_common.h"
 #include "olap/olap_define.h"
 #include "util/hash_util.hpp"
diff --git a/be/src/olap/olap_meta.cpp b/be/src/olap/olap_meta.cpp
index 92b85b1d5b..35ea9b8d8e 100644
--- a/be/src/olap/olap_meta.cpp
+++ b/be/src/olap/olap_meta.cpp
@@ -17,9 +17,16 @@
 
 #include "olap/olap_meta.h"
 
+#include <rocksdb/iterator.h>
+#include <rocksdb/status.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
 #include <sstream>
 #include <vector>
 
+#include "common/config.h"
 #include "common/logging.h"
 #include "olap/olap_define.h"
 #include "rocksdb/db.h"
diff --git a/be/src/olap/olap_meta.h b/be/src/olap/olap_meta.h
index d2557415b3..a8f1df8d22 100644
--- a/be/src/olap/olap_meta.h
+++ b/be/src/olap/olap_meta.h
@@ -18,11 +18,15 @@
 #pragma once
 
 #include <functional>
-#include <map>
 #include <string>
+#include <vector>
 
-#include "olap/olap_define.h"
-#include "rocksdb/db.h"
+#include "common/status.h"
+
+namespace rocksdb {
+class ColumnFamilyHandle;
+class DB;
+} // namespace rocksdb
 
 namespace doris {
 
diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp
index 55b6ef737b..3f21adb229 100644
--- a/be/src/olap/olap_server.cpp
+++ b/be/src/olap/olap_server.cpp
@@ -15,28 +15,55 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <gperftools/profiler.h>
-#include <sys/socket.h>
-#include <unistd.h>
+#include <gen_cpp/Types_types.h>
+#include <stdint.h>
 
-#include <boost/algorithm/string.hpp>
+#include <algorithm>
+#include <atomic>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
 #include <cmath>
+#include <condition_variable>
 #include <ctime>
+#include <functional>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <ostream>
 #include <random>
 #include <string>
+#include <type_traits>
+#include <unordered_set>
+#include <utility>
+#include <vector>
 
 #include "common/config.h"
+#include "common/logging.h"
 #include "common/status.h"
-#include "gutil/strings/substitute.h"
+#include "gutil/ref_counted.h"
 #include "io/cache/file_cache_manager.h"
+#include "io/fs/file_writer.h" // IWYU pragma: keep
+#include "io/fs/path.h"
 #include "olap/cold_data_compaction.h"
-#include "olap/cumulative_compaction.h"
+#include "olap/compaction_permit_limiter.h"
+#include "olap/cumulative_compaction_policy.h"
+#include "olap/data_dir.h"
 #include "olap/olap_common.h"
-#include "olap/olap_define.h"
 #include "olap/rowset/beta_rowset_writer.h"
+#include "olap/rowset/segcompaction.h"
 #include "olap/storage_engine.h"
+#include "olap/tablet.h"
+#include "olap/tablet_manager.h"
+#include "olap/tablet_meta.h"
+#include "olap/tablet_schema.h"
 #include "service/point_query_executor.h"
+#include "util/countdown_latch.h"
+#include "util/doris_metrics.h"
+#include "util/priority_thread_pool.hpp"
+#include "util/thread.h"
+#include "util/threadpool.h"
 #include "util/time.h"
+#include "util/uid_util.h"
 
 using std::string;
 
diff --git a/be/src/olap/options.cpp b/be/src/olap/options.cpp
index 1226ecd415..80af2321e4 100644
--- a/be/src/olap/options.cpp
+++ b/be/src/olap/options.cpp
@@ -17,16 +17,23 @@
 
 #include "olap/options.h"
 
+#include <ctype.h>
 #include <rapidjson/document.h>
+#include <rapidjson/encodings.h>
+#include <rapidjson/rapidjson.h>
+#include <stdlib.h>
 
 #include <algorithm>
+#include <memory>
+#include <ostream>
 
 #include "common/config.h"
 #include "common/logging.h"
 #include "common/status.h"
 #include "gutil/strings/split.h"
-#include "gutil/strings/substitute.h"
+#include "gutil/strings/strip.h"
 #include "io/fs/local_file_system.h"
+#include "olap/olap_define.h"
 #include "olap/utils.h"
 #include "util/path_util.h"
 
diff --git a/be/src/olap/options.h b/be/src/olap/options.h
index c6ed214ceb..84634a92cd 100644
--- a/be/src/olap/options.h
+++ b/be/src/olap/options.h
@@ -17,11 +17,15 @@
 
 #pragma once
 
+#include <gen_cpp/Types_types.h>
+#include <stdint.h>
+
 #include <string>
+#include <utility>
 #include <vector>
 
+#include "common/status.h"
 #include "io/cache/block/block_file_cache_settings.h"
-#include "olap/olap_define.h"
 #include "util/uid_util.h"
 
 namespace doris {
diff --git a/be/src/olap/page_cache.cpp b/be/src/olap/page_cache.cpp
index 2813f85dd3..53f9378d17 100644
--- a/be/src/olap/page_cache.cpp
+++ b/be/src/olap/page_cache.cpp
@@ -17,7 +17,9 @@
 
 #include "olap/page_cache.h"
 
-#include "runtime/thread_context.h"
+#include <glog/logging.h>
+
+#include <ostream>
 
 namespace doris {
 
diff --git a/be/src/olap/page_cache.h b/be/src/olap/page_cache.h
index 6313e931e0..cab0da2dd7 100644
--- a/be/src/olap/page_cache.h
+++ b/be/src/olap/page_cache.h
@@ -17,14 +17,17 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <stddef.h>
+#include <stdint.h>
+
 #include <memory>
 #include <string>
 #include <utility>
 
-#include "gen_cpp/segment_v2.pb.h" // for cache allocation
-#include "gutil/macros.h"          // for DISALLOW_COPY_AND_ASSIGN
 #include "olap/lru_cache.h"
-#include "runtime/memory/mem_tracker.h"
+#include "util/slice.h"
 
 namespace doris {
 
diff --git a/be/src/olap/primary_key_index.cpp b/be/src/olap/primary_key_index.cpp
index f9656ee897..e7f11aa3d1 100644
--- a/be/src/olap/primary_key_index.cpp
+++ b/be/src/olap/primary_key_index.cpp
@@ -17,9 +17,17 @@
 
 #include "olap/primary_key_index.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/config.h"
-#include "io/fs/file_reader.h"
+#include "olap/olap_common.h"
+#include "olap/rowset/segment_v2/bloom_filter_index_reader.h"
 #include "olap/rowset/segment_v2/encoding_info.h"
+#include "olap/types.h"
 
 namespace doris {
 
diff --git a/be/src/olap/primary_key_index.h b/be/src/olap/primary_key_index.h
index c80f0f132c..65cc64f0cd 100644
--- a/be/src/olap/primary_key_index.h
+++ b/be/src/olap/primary_key_index.h
@@ -17,11 +17,15 @@
 
 #pragma once
 
+#include <glog/logging.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
+
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "io/fs/file_writer.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "olap/rowset/segment_v2/bloom_filter.h"
-#include "olap/rowset/segment_v2/bloom_filter_index_reader.h"
 #include "olap/rowset/segment_v2/bloom_filter_index_writer.h"
 #include "olap/rowset/segment_v2/indexed_column_reader.h"
 #include "olap/rowset/segment_v2/indexed_column_writer.h"
@@ -29,6 +33,14 @@
 #include "util/slice.h"
 
 namespace doris {
+class TypeInfo;
+
+namespace io {
+class FileWriter;
+} // namespace io
+namespace segment_v2 {
+class PrimaryKeyIndexMetaPB;
+} // namespace segment_v2
 
 // Build index for primary key.
 // The primary key index is designed in a similar way like RocksDB
diff --git a/be/src/olap/push_handler.cpp b/be/src/olap/push_handler.cpp
index 6ed44ea253..81a46753a3 100644
--- a/be/src/olap/push_handler.cpp
+++ b/be/src/olap/push_handler.cpp
@@ -17,20 +17,43 @@
 
 #include "olap/push_handler.h"
 
+#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/MasterService_types.h>
+#include <gen_cpp/PaloInternalService_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/types.pb.h>
+
 #include <algorithm>
-#include <filesystem>
 #include <iostream>
-#include <sstream>
-
-#include "common/object_pool.h"
+#include <mutex>
+#include <new>
+#include <queue>
+#include <shared_mutex>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/config.h"
+#include "common/logging.h"
 #include "common/status.h"
-#include "olap/rowset/rowset_id_generator.h"
-#include "olap/rowset/rowset_meta_manager.h"
-#include "olap/schema_change.h"
+#include "olap/delete_handler.h"
+#include "olap/olap_define.h"
+#include "olap/rowset/rowset_meta.h"
+#include "olap/rowset/rowset_writer.h"
+#include "olap/rowset/rowset_writer_context.h"
+#include "olap/schema.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 "runtime/descriptors.h"
 #include "runtime/exec_env.h"
+#include "util/runtime_profile.h"
+#include "util/time.h"
+#include "vec/core/block.h"
 #include "vec/exec/vparquet_scanner.h"
 
 namespace doris {
diff --git a/be/src/olap/push_handler.h b/be/src/olap/push_handler.h
index 8546fbf749..9f6a91a3d5 100644
--- a/be/src/olap/push_handler.h
+++ b/be/src/olap/push_handler.h
@@ -17,24 +17,36 @@
 
 #pragma once
 
-#include <map>
+#include <butil/macros.h>
+#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/Exprs_types.h>
+#include <stdint.h>
+
+#include <memory>
 #include <string>
 #include <vector>
 
+#include "common/object_pool.h"
+#include "common/status.h"
 #include "exec/base_scanner.h"
-#include "gen_cpp/AgentService_types.h"
-#include "gen_cpp/MasterService_types.h"
-#include "gen_cpp/PaloInternalService_types.h"
-#include "olap/merger.h"
 #include "olap/olap_common.h"
-#include "olap/row_cursor.h"
 #include "olap/rowset/rowset.h"
+#include "olap/tablet.h"
 #include "olap/tablet_schema.h"
+#include "runtime/runtime_state.h"
 
 namespace doris {
 
-struct ColumnMapping;
-class RowCursor;
+class DescriptorTbl;
+class RuntimeProfile;
+class Schema;
+class TBrokerScanRange;
+class TDescriptorTable;
+class TTabletInfo;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 class PushHandler {
 public:
diff --git a/be/src/olap/reader.cpp b/be/src/olap/reader.cpp
index b21691af2d..9886db76d6 100644
--- a/be/src/olap/reader.cpp
+++ b/be/src/olap/reader.cpp
@@ -17,20 +17,42 @@
 
 #include "olap/reader.h"
 
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <thrift/protocol/TDebugProtocol.h>
+
+#include <algorithm>
+#include <functional>
+#include <iterator>
+#include <numeric>
+#include <ostream>
+#include <shared_mutex>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/config.h"
+#include "common/logging.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 "gen_cpp/segment_v2.pb.h"
-#include "olap/bloom_filter_predicate.h"
-#include "olap/comparison_predicate.h"
-#include "olap/in_list_predicate.h"
+#include "olap/column_predicate.h"
 #include "olap/itoken_extractor.h"
 #include "olap/like_column_predicate.h"
 #include "olap/olap_common.h"
+#include "olap/olap_define.h"
 #include "olap/predicate_creator.h"
 #include "olap/row_cursor.h"
+#include "olap/rowset/segment_v2/bloom_filter.h"
 #include "olap/schema.h"
 #include "olap/tablet.h"
+#include "olap/tablet_meta.h"
+#include "runtime/query_fragments_ctx.h"
+#include "runtime/runtime_predicate.h"
+#include "runtime/runtime_state.h"
+#include "vec/common/arena.h"
+#include "vec/core/block.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/olap/reader.h b/be/src/olap/reader.h
index 5d0cc71126..394ca247b8 100644
--- a/be/src/olap/reader.h
+++ b/be/src/olap/reader.h
@@ -17,31 +17,50 @@
 
 #pragma once
 
-#include <thrift/protocol/TDebugProtocol.h>
-
-#include "exprs/bitmapfilter_predicate.h"
+#include <gen_cpp/PaloInternalService_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
+#include <set>
+#include <string>
+#include <unordered_set>
+#include <utility>
+#include <vector>
+
+#include "common/status.h"
 #include "exprs/function_filter.h"
-#include "exprs/hybrid_set.h"
+#include "gutil/strings/substitute.h"
 #include "io/io_common.h"
 #include "olap/delete_handler.h"
+#include "olap/iterators.h"
+#include "olap/olap_common.h"
+#include "olap/olap_tuple.h"
 #include "olap/row_cursor.h"
+#include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/rowset/rowset_reader.h"
+#include "olap/rowset/rowset_reader_context.h"
 #include "olap/tablet.h"
 #include "olap/tablet_schema.h"
-#include "util/runtime_profile.h"
-#include "vec/common/arena.h"
-#include "vec/exprs/vexpr_context.h"
 
 namespace doris {
 
-class Tablet;
-class RowCursor;
 class RuntimeState;
+class BitmapFilterFuncBase;
+class BloomFilterFuncBase;
+class ColumnPredicate;
+class DeleteBitmap;
+class HybridSetBase;
+class RuntimeProfile;
 
 namespace vectorized {
 class VCollectIterator;
 class Block;
 class VExpr;
+class Arena;
+class VExprContext;
 } // namespace vectorized
 
 // Used to compare row with input scan key. Scan key only contains key columns,
diff --git a/be/src/olap/row_cursor.cpp b/be/src/olap/row_cursor.cpp
index ec0fd094ff..48756e2366 100644
--- a/be/src/olap/row_cursor.cpp
+++ b/be/src/olap/row_cursor.cpp
@@ -17,10 +17,18 @@
 
 #include "olap/row_cursor.h"
 
-#include <algorithm>
-#include <unordered_set>
+#include <glog/logging.h>
+#include <stdlib.h>
 
-#include "util/stack_util.h"
+#include <algorithm>
+#include <new>
+#include <numeric>
+#include <ostream>
+
+#include "olap/field.h"
+#include "olap/olap_common.h"
+#include "olap/olap_define.h"
+#include "util/slice.h"
 
 using std::min;
 using std::nothrow;
diff --git a/be/src/olap/row_cursor.h b/be/src/olap/row_cursor.h
index 0a0f5f2913..7c19e7ad55 100644
--- a/be/src/olap/row_cursor.h
+++ b/be/src/olap/row_cursor.h
@@ -17,15 +17,19 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
 #include <string>
 #include <vector>
 
-#include "olap/field.h"
-#include "olap/olap_common.h"
-#include "olap/olap_define.h"
+#include "common/status.h"
 #include "olap/olap_tuple.h"
 #include "olap/row_cursor_cell.h"
 #include "olap/schema.h"
+#include "olap/tablet_schema.h"
 
 namespace doris {
 class Field;
diff --git a/be/src/olap/rowset/beta_rowset.cpp b/be/src/olap/rowset/beta_rowset.cpp
index 513a04a8d1..9e9769bcd4 100644
--- a/be/src/olap/rowset/beta_rowset.cpp
+++ b/be/src/olap/rowset/beta_rowset.cpp
@@ -17,16 +17,23 @@
 
 #include "olap/rowset/beta_rowset.h"
 
-#include <fmt/core.h>
-#include <glog/logging.h>
-#include <stdio.h>  // for remove()
-#include <unistd.h> // for link()
+#include <ctype.h>
+#include <fmt/format.h>
 
+#include <algorithm>
+#include <ostream>
+#include <utility>
+
+#include "common/config.h"
+#include "common/logging.h"
 #include "common/status.h"
-#include "gutil/strings/substitute.h"
 #include "io/cache/file_cache_manager.h"
-#include "io/fs/fs_utils.h"
-#include "io/fs/s3_file_system.h"
+#include "io/fs/file_reader_options.h"
+#include "io/fs/file_system.h"
+#include "io/fs/local_file_system.h"
+#include "io/fs/path.h"
+#include "io/fs/remote_file_system.h"
+#include "olap/olap_common.h"
 #include "olap/olap_define.h"
 #include "olap/rowset/beta_rowset_reader.h"
 #include "olap/rowset/segment_v2/inverted_index_cache.h"
diff --git a/be/src/olap/rowset/beta_rowset.h b/be/src/olap/rowset/beta_rowset.h
index 5401c60860..0ef0c456ae 100644
--- a/be/src/olap/rowset/beta_rowset.h
+++ b/be/src/olap/rowset/beta_rowset.h
@@ -18,22 +18,29 @@
 #ifndef DORIS_SRC_OLAP_ROWSET_BETA_ROWSET_H_
 #define DORIS_SRC_OLAP_ROWSET_BETA_ROWSET_H_
 
+#include <stddef.h>
+
 #include <cstdint>
+#include <memory>
 #include <string>
+#include <vector>
 
-#include "olap/olap_common.h"
-#include "olap/olap_define.h"
+#include "common/status.h"
 #include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_meta.h"
 #include "olap/rowset/rowset_reader.h"
 #include "olap/rowset/segment_v2/segment.h"
+#include "olap/tablet_schema.h"
 
 namespace doris {
 
-class BetaRowsetReader;
-class RowsetFactory;
-
 class BetaRowset;
+
+namespace io {
+class RemoteFileSystem;
+} // namespace io
+struct RowsetId;
+
 using BetaRowsetSharedPtr = std::shared_ptr<BetaRowset>;
 
 class BetaRowset : public Rowset {
diff --git a/be/src/olap/rowset/beta_rowset_reader.cpp b/be/src/olap/rowset/beta_rowset_reader.cpp
index 0a4e7ccdb4..e54527e962 100644
--- a/be/src/olap/rowset/beta_rowset_reader.cpp
+++ b/be/src/olap/rowset/beta_rowset_reader.cpp
@@ -17,12 +17,30 @@
 
 #include "beta_rowset_reader.h"
 
+#include <stddef.h>
+
+#include <algorithm>
+#include <ostream>
+#include <roaring/roaring.hh>
+#include <set>
+#include <string>
+#include <unordered_map>
 #include <utility>
 
+#include "common/logging.h"
+#include "io/io_common.h"
+#include "olap/block_column_predicate.h"
+#include "olap/column_predicate.h"
 #include "olap/delete_handler.h"
+#include "olap/olap_define.h"
 #include "olap/row_cursor.h"
+#include "olap/rowset/rowset_meta.h"
+#include "olap/rowset/rowset_reader_context.h"
+#include "olap/rowset/segment_v2/segment.h"
 #include "olap/schema.h"
 #include "olap/tablet_meta.h"
+#include "olap/tablet_schema.h"
+#include "util/runtime_profile.h"
 #include "vec/core/block.h"
 #include "vec/olap/vgeneric_iterators.h"
 
diff --git a/be/src/olap/rowset/beta_rowset_reader.h b/be/src/olap/rowset/beta_rowset_reader.h
index 10cfcb8b0f..de2ecb44d4 100644
--- a/be/src/olap/rowset/beta_rowset_reader.h
+++ b/be/src/olap/rowset/beta_rowset_reader.h
@@ -17,13 +17,27 @@
 
 #pragma once
 
+#include <gen_cpp/olap_file.pb.h>
+#include <stdint.h>
+
+#include <memory>
+#include <utility>
+#include <vector>
+
+#include "common/status.h"
 #include "olap/iterators.h"
-#include "olap/row_cursor.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/beta_rowset.h"
+#include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_reader.h"
 #include "olap/segment_loader.h"
+#include "vec/core/block.h"
 
 namespace doris {
+class RuntimeProfile;
+class Schema;
+struct RowLocation;
+struct RowsetReaderContext;
 
 class BetaRowsetReader : public RowsetReader {
 public:
diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp b/be/src/olap/rowset/beta_rowset_writer.cpp
index 8b9b04a82c..744cf8066c 100644
--- a/be/src/olap/rowset/beta_rowset_writer.cpp
+++ b/be/src/olap/rowset/beta_rowset_writer.cpp
@@ -17,35 +17,46 @@
 
 #include "olap/rowset/beta_rowset_writer.h"
 
+#include <assert.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
+#include <stdio.h>
+
 #include <ctime> // time
+#include <filesystem>
 #include <memory>
 #include <sstream>
+#include <utility>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/config.h"
 #include "common/logging.h"
+#include "gutil/integral_types.h"
 #include "gutil/strings/substitute.h"
+#include "io/fs/file_reader_options.h"
+#include "io/fs/file_system.h"
 #include "io/fs/file_writer.h"
-#include "olap/memtable.h"
-#include "olap/merger.h"
+#include "olap/data_dir.h"
 #include "olap/olap_define.h"
-#include "olap/row_cursor.h" // RowCursor
 #include "olap/rowset/beta_rowset.h"
 #include "olap/rowset/rowset_factory.h"
 #include "olap/rowset/segment_v2/inverted_index_cache.h"
 #include "olap/rowset/segment_v2/inverted_index_desc.h"
+#include "olap/rowset/segment_v2/segment.h"
 #include "olap/rowset/segment_v2/segment_writer.h"
 #include "olap/storage_engine.h"
-#include "runtime/exec_env.h"
-#include "runtime/memory/mem_tracker_limiter.h"
+#include "olap/tablet.h"
+#include "olap/tablet_schema.h"
 #include "segcompaction.h"
+#include "util/slice.h"
+#include "util/time.h"
 #include "vec/common/schema_util.h" // LocalSchemaChangeRecorder
-#include "vec/jsonb/serialize.h"
+#include "vec/core/block.h"
 
 namespace doris {
 using namespace ErrorCode;
 
-class StorageEngine;
-
 BetaRowsetWriter::BetaRowsetWriter()
         : _rowset_meta(nullptr),
           _num_segment(0),
diff --git a/be/src/olap/rowset/beta_rowset_writer.h b/be/src/olap/rowset/beta_rowset_writer.h
index 25c05318e9..c6fa740a58 100644
--- a/be/src/olap/rowset/beta_rowset_writer.h
+++ b/be/src/olap/rowset/beta_rowset_writer.h
@@ -17,22 +17,41 @@
 
 #pragma once
 
+#include <fmt/format.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
+#include <atomic>
+#include <condition_variable>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <string>
+#include <unordered_set>
+#include <vector>
+
+#include "common/status.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "olap/olap_common.h"
+#include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/rowset/rowset_writer.h"
+#include "olap/rowset/rowset_writer_context.h"
 #include "segcompaction.h"
 #include "segment_v2/segment.h"
-#include "vec/columns/column.h"
-#include "vec/olap/vertical_block_reader.h"
-#include "vec/olap/vgeneric_iterators.h"
+#include "util/spinlock.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
+
 namespace segment_v2 {
 class SegmentWriter;
 } // namespace segment_v2
 
-namespace io {
-class FileWriter;
-} // namespace io
-
 using SegCompactionCandidates = std::vector<segment_v2::SegmentSharedPtr>;
 using SegCompactionCandidatesSharedPtr = std::shared_ptr<SegCompactionCandidates>;
 namespace vectorized::schema_util {
diff --git a/be/src/olap/rowset/rowset.cpp b/be/src/olap/rowset/rowset.cpp
index d29c02ed95..d9aa8fb05e 100644
--- a/be/src/olap/rowset/rowset.cpp
+++ b/be/src/olap/rowset/rowset.cpp
@@ -17,8 +17,10 @@
 
 #include "olap/rowset/rowset.h"
 
+#include <gen_cpp/olap_file.pb.h>
+
+#include "olap/olap_define.h"
 #include "olap/tablet_schema.h"
-#include "olap/tablet_schema_cache.h"
 #include "util/time.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/rowset.h b/be/src/olap/rowset/rowset.h
index c2ae5f1b05..198dd8a0cd 100644
--- a/be/src/olap/rowset/rowset.h
+++ b/be/src/olap/rowset/rowset.h
@@ -17,26 +17,36 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <fmt/format.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/types.pb.h>
+#include <stddef.h>
+#include <stdint.h>
+
 #include <atomic>
 #include <memory>
 #include <mutex>
+#include <ostream>
+#include <string>
 #include <vector>
 
-#include "gen_cpp/olap_file.pb.h"
-#include "gutil/macros.h"
-#include "io/fs/remote_file_system.h"
+#include "common/logging.h"
+#include "common/status.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/rowset_meta.h"
 #include "olap/tablet_schema.h"
 #include "util/lock.h"
 
 namespace doris {
 
-class DataDir;
-class OlapTuple;
-class RowCursor;
 class Rowset;
+
+namespace io {
+class RemoteFileSystem;
+} // namespace io
+
 using RowsetSharedPtr = std::shared_ptr<Rowset>;
-class RowsetFactory;
 class RowsetReader;
 
 // the rowset state transfer graph:
diff --git a/be/src/olap/rowset/rowset_factory.cpp b/be/src/olap/rowset/rowset_factory.cpp
index 78f6b2326c..e66004da70 100644
--- a/be/src/olap/rowset/rowset_factory.cpp
+++ b/be/src/olap/rowset/rowset_factory.cpp
@@ -17,12 +17,15 @@
 
 #include "olap/rowset/rowset_factory.h"
 
+#include <gen_cpp/olap_file.pb.h>
+
 #include <memory>
 
 #include "beta_rowset.h"
-#include "gen_cpp/olap_file.pb.h"
+#include "io/fs/file_writer.h" // IWYU pragma: keep
 #include "olap/rowset/beta_rowset_writer.h"
 #include "olap/rowset/rowset_writer.h"
+#include "olap/rowset/rowset_writer_context.h"
 #include "olap/rowset/vertical_beta_rowset_writer.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/rowset_factory.h b/be/src/olap/rowset/rowset_factory.h
index d0adc6f457..9c3543c184 100644
--- a/be/src/olap/rowset/rowset_factory.h
+++ b/be/src/olap/rowset/rowset_factory.h
@@ -18,9 +18,13 @@
 #ifndef DORIS_BE_SRC_OLAP_ROWSET_FACTORY_H
 #define DORIS_BE_SRC_OLAP_ROWSET_FACTORY_H
 
-#include "gen_cpp/olap_file.pb.h"
-#include "olap/data_dir.h"
+#include <memory>
+#include <string>
+
+#include "common/status.h"
 #include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_meta.h"
+#include "olap/tablet_schema.h"
 
 namespace doris {
 
diff --git a/be/src/olap/rowset/rowset_meta.h b/be/src/olap/rowset/rowset_meta.h
index 9697055864..f9491e1553 100644
--- a/be/src/olap/rowset/rowset_meta.h
+++ b/be/src/olap/rowset/rowset_meta.h
@@ -18,12 +18,13 @@
 #ifndef DORIS_BE_SRC_OLAP_ROWSET_ROWSET_META_H
 #define DORIS_BE_SRC_OLAP_ROWSET_ROWSET_META_H
 
+#include <gen_cpp/olap_file.pb.h>
+
 #include <memory>
 #include <string>
 #include <vector>
 
 #include "common/logging.h"
-#include "gen_cpp/olap_file.pb.h"
 #include "google/protobuf/util/message_differencer.h"
 #include "io/fs/file_system.h"
 #include "io/fs/local_file_system.h"
diff --git a/be/src/olap/rowset/rowset_meta_manager.cpp b/be/src/olap/rowset/rowset_meta_manager.cpp
index 84e8be217f..3373db47d8 100644
--- a/be/src/olap/rowset/rowset_meta_manager.cpp
+++ b/be/src/olap/rowset/rowset_meta_manager.cpp
@@ -17,17 +17,18 @@
 
 #include "olap/rowset/rowset_meta_manager.h"
 
+#include <gen_cpp/olap_file.pb.h>
+
 #include <boost/algorithm/string/trim.hpp>
 #include <fstream>
-#include <sstream>
+#include <memory>
+#include <new>
 #include <string>
 #include <vector>
 
 #include "common/logging.h"
-#include "json2pb/json_to_pb.h"
-#include "json2pb/pb_to_json.h"
 #include "olap/olap_define.h"
-#include "olap/storage_engine.h"
+#include "olap/olap_meta.h"
 #include "olap/utils.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/rowset_meta_manager.h b/be/src/olap/rowset/rowset_meta_manager.h
index cca2304ce3..f6f193caae 100644
--- a/be/src/olap/rowset/rowset_meta_manager.h
+++ b/be/src/olap/rowset/rowset_meta_manager.h
@@ -18,11 +18,18 @@
 #ifndef DORIS_BE_SRC_OLAP_ROWSET_ROWSET_META_MANAGER_H
 #define DORIS_BE_SRC_OLAP_ROWSET_ROWSET_META_MANAGER_H
 
+#include <functional>
 #include <string>
 
-#include "olap/olap_meta.h"
+#include "common/status.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/rowset_meta.h"
 
+namespace doris {
+class OlapMeta;
+class RowsetMetaPB;
+} // namespace doris
+
 using std::string;
 
 namespace doris {
diff --git a/be/src/olap/rowset/rowset_reader.h b/be/src/olap/rowset/rowset_reader.h
index 3d6b2c6fad..dadfd0e05c 100644
--- a/be/src/olap/rowset/rowset_reader.h
+++ b/be/src/olap/rowset/rowset_reader.h
@@ -18,10 +18,11 @@
 #ifndef DORIS_BE_SRC_OLAP_ROWSET_ROWSET_READER_H
 #define DORIS_BE_SRC_OLAP_ROWSET_ROWSET_READER_H
 
+#include <gen_cpp/olap_file.pb.h>
+
 #include <memory>
 #include <unordered_map>
 
-#include "gen_cpp/olap_file.pb.h"
 #include "olap/iterators.h"
 #include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_reader_context.h"
diff --git a/be/src/olap/rowset/rowset_tree.cpp b/be/src/olap/rowset/rowset_tree.cpp
index a9cc6a81e0..8ac153435f 100644
--- a/be/src/olap/rowset/rowset_tree.cpp
+++ b/be/src/olap/rowset/rowset_tree.cpp
@@ -21,8 +21,10 @@
 
 #include "olap/rowset/rowset_tree.h"
 
+#include <gen_cpp/olap_file.pb.h>
 #include <glog/logging.h>
 
+#include <algorithm>
 #include <cstddef>
 #include <functional>
 #include <iterator>
@@ -36,6 +38,7 @@
 #include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_meta.h"
 #include "util/interval_tree-inl.h"
+#include "util/interval_tree.h"
 #include "util/slice.h"
 
 using std::shared_ptr;
diff --git a/be/src/olap/rowset/rowset_tree.h b/be/src/olap/rowset/rowset_tree.h
index 8228bc26d7..5ebabca0f1 100644
--- a/be/src/olap/rowset/rowset_tree.h
+++ b/be/src/olap/rowset/rowset_tree.h
@@ -21,15 +21,17 @@
 
 #pragma once
 
-#include <boost/optional/optional.hpp>
 #include <cstdint>
 #include <functional>
 #include <memory>
+#include <optional>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include "common/status.h"
 #include "gutil/map-util.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/rowset.h"
 #include "util/slice.h"
 
@@ -37,7 +39,6 @@ namespace doris {
 
 template <class Traits>
 class IntervalTree;
-
 struct RowsetIntervalTraits;
 struct RowsetWithBounds;
 
diff --git a/be/src/olap/rowset/rowset_writer.h b/be/src/olap/rowset/rowset_writer.h
index f4d55ac051..6249f01637 100644
--- a/be/src/olap/rowset/rowset_writer.h
+++ b/be/src/olap/rowset/rowset_writer.h
@@ -17,8 +17,9 @@
 
 #pragma once
 
-#include "gen_cpp/olap_file.pb.h"
-#include "gen_cpp/types.pb.h"
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/types.pb.h>
+
 #include "gutil/macros.h"
 #include "olap/column_mapping.h"
 #include "olap/rowset/rowset.h"
diff --git a/be/src/olap/rowset/rowset_writer_context.h b/be/src/olap/rowset/rowset_writer_context.h
index fc33a521bb..8d4fabfc88 100644
--- a/be/src/olap/rowset/rowset_writer_context.h
+++ b/be/src/olap/rowset/rowset_writer_context.h
@@ -17,7 +17,8 @@
 
 #pragma once
 
-#include "gen_cpp/olap_file.pb.h"
+#include <gen_cpp/olap_file.pb.h>
+
 #include "io/fs/file_system.h"
 #include "olap/tablet.h"
 #include "olap/tablet_schema.h"
diff --git a/be/src/olap/rowset/segcompaction.cpp b/be/src/olap/rowset/segcompaction.cpp
index cc151afdac..8eb60eae7f 100644
--- a/be/src/olap/rowset/segcompaction.cpp
+++ b/be/src/olap/rowset/segcompaction.cpp
@@ -17,30 +17,50 @@
 
 #include "segcompaction.h"
 
-#include <fmt/core.h>
+#include <fmt/format.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <limits.h>
 
+#include <algorithm>
+#include <atomic>
+#include <condition_variable>
 #include <filesystem>
-#include <iostream>
+#include <map>
 #include <mutex>
-#include <thread>
+#include <sstream>
+#include <string>
+#include <utility>
 
 #include "beta_rowset_writer.h"
-#include "common/config.h"
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/logging.h"
+#include "gutil/stringprintf.h"
 #include "gutil/strings/substitute.h"
+#include "io/fs/file_system.h"
 #include "io/fs/file_writer.h"
-#include "olap/memtable.h"
+#include "io/io_common.h"
+#include "olap/data_dir.h"
+#include "olap/iterators.h"
 #include "olap/merger.h"
+#include "olap/olap_common.h"
 #include "olap/olap_define.h"
-#include "olap/row_cursor.h" // RowCursor
+#include "olap/reader.h"
 #include "olap/rowset/beta_rowset.h"
+#include "olap/rowset/rowset_meta.h"
+#include "olap/rowset/rowset_writer_context.h"
 #include "olap/rowset/segment_v2/inverted_index_cache.h"
 #include "olap/rowset/segment_v2/inverted_index_desc.h"
+#include "olap/rowset/segment_v2/segment.h"
+#include "olap/rowset/segment_v2/segment_writer.h"
+#include "olap/schema.h"
 #include "olap/storage_engine.h"
-#include "runtime/exec_env.h"
+#include "olap/tablet_schema.h"
 #include "runtime/memory/mem_tracker_limiter.h"
-#include "vec/common/schema_util.h" // LocalSchemaChangeRecorder
-#include "vec/jsonb/serialize.h"
+#include "runtime/thread_context.h"
+#include "util/time.h"
+#include "vec/olap/vertical_block_reader.h"
+#include "vec/olap/vertical_merge_iterator.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/olap/rowset/segcompaction.h b/be/src/olap/rowset/segcompaction.h
index 871f864b9b..33fcf4ba28 100644
--- a/be/src/olap/rowset/segcompaction.h
+++ b/be/src/olap/rowset/segcompaction.h
@@ -18,18 +18,27 @@
 #pragma once
 #include <stdint.h>
 
-#include <ctime> // time
 #include <memory>
-#include <sstream>
+#include <vector>
 
 #include "common/status.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "olap/merger.h"
-#include "olap/rowset/rowset_writer.h"
+#include "olap/tablet.h"
 #include "segment_v2/segment.h"
-#include "segment_v2/segment_writer.h"
-#include "vec/olap/vertical_block_reader.h"
 
 namespace doris {
+class Schema;
+
+namespace segment_v2 {
+class SegmentWriter;
+} // namespace segment_v2
+namespace vectorized {
+class RowSourcesBuffer;
+class VerticalBlockReader;
+} // namespace vectorized
+struct OlapReaderStatistics;
+
 using SegCompactionCandidates = std::vector<segment_v2::SegmentSharedPtr>;
 using SegCompactionCandidatesSharedPtr = std::shared_ptr<SegCompactionCandidates>;
 
diff --git a/be/src/olap/rowset/segment_v2/binary_dict_page.cpp b/be/src/olap/rowset/segment_v2/binary_dict_page.cpp
index 4ac002400e..94057fe5da 100644
--- a/be/src/olap/rowset/segment_v2/binary_dict_page.cpp
+++ b/be/src/olap/rowset/segment_v2/binary_dict_page.cpp
@@ -17,11 +17,26 @@
 
 #include "olap/rowset/segment_v2/binary_dict_page.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <algorithm>
+#include <ostream>
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/logging.h"
+#include "gutil/casts.h"
+#include "gutil/port.h"
 #include "gutil/strings/substitute.h" // for Substitute
-#include "util/slice.h"               // for Slice
+#include "olap/rowset/segment_v2/bitshuffle_page.h"
+#include "util/coding.h"
+#include "util/slice.h" // for Slice
 #include "vec/columns/column.h"
 
 namespace doris {
+struct StringRef;
+
 namespace segment_v2 {
 
 using strings::Substitute;
diff --git a/be/src/olap/rowset/segment_v2/binary_dict_page.h b/be/src/olap/rowset/segment_v2/binary_dict_page.h
index b570b042dc..0ab50ce634 100644
--- a/be/src/olap/rowset/segment_v2/binary_dict_page.h
+++ b/be/src/olap/rowset/segment_v2/binary_dict_page.h
@@ -17,21 +17,33 @@
 
 #pragma once
 
-#include <functional>
+#include <parallel_hashmap/phmap.h>
+#include <stddef.h>
+#include <stdint.h>
+
 #include <memory>
-#include <string>
+#include <vector>
 
-#include "gen_cpp/segment_v2.pb.h"
+#include "common/status.h"
 #include "gutil/hash/string_hash.h"
 #include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/binary_plain_page.h"
-#include "olap/rowset/segment_v2/bitshuffle_page.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/options.h"
+#include "olap/rowset/segment_v2/page_builder.h"
+#include "olap/rowset/segment_v2/page_decoder.h"
+#include "util/faststring.h"
+#include "util/slice.h"
 #include "vec/common/arena.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
+struct StringRef;
+
 namespace segment_v2 {
+enum EncodingTypePB : int;
+template <FieldType Type>
+class BitShufflePageDecoder;
 
 enum { BINARY_DICT_PAGE_HEADER_SIZE = 4 };
 
diff --git a/be/src/olap/rowset/segment_v2/binary_prefix_page.cpp b/be/src/olap/rowset/segment_v2/binary_prefix_page.cpp
index 90029ea09c..e3e893a0dd 100644
--- a/be/src/olap/rowset/segment_v2/binary_prefix_page.cpp
+++ b/be/src/olap/rowset/segment_v2/binary_prefix_page.cpp
@@ -19,13 +19,11 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <string.h>
 
-#include <map>
-#include <string>
+#include <algorithm>
 #include <vector>
 
-#include "common/logging.h"
+#include "gutil/port.h"
 #include "gutil/strings/substitute.h"
 #include "util/coding.h"
 #include "util/faststring.h"
diff --git a/be/src/olap/rowset/segment_v2/binary_prefix_page.h b/be/src/olap/rowset/segment_v2/binary_prefix_page.h
index 2930a8e616..b6ca02190f 100644
--- a/be/src/olap/rowset/segment_v2/binary_prefix_page.h
+++ b/be/src/olap/rowset/segment_v2/binary_prefix_page.h
@@ -17,20 +17,20 @@
 
 #pragma once
 
+#include <glog/logging.h>
 #include <stddef.h>
 #include <stdint.h>
-#include <string.h>
 
-#include <map>
-#include <string>
 #include <vector>
 
+#include "common/status.h"
 #include "olap/rowset/segment_v2/options.h"
 #include "olap/rowset/segment_v2/page_builder.h"
 #include "olap/rowset/segment_v2/page_decoder.h"
 #include "util/coding.h"
 #include "util/faststring.h"
 #include "util/slice.h"
+#include "vec/columns/column.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/bitmap_index_reader.cpp b/be/src/olap/rowset/segment_v2/bitmap_index_reader.cpp
index c101e3e7da..0e2c26ff30 100644
--- a/be/src/olap/rowset/segment_v2/bitmap_index_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/bitmap_index_reader.cpp
@@ -17,7 +17,16 @@
 
 #include "olap/rowset/segment_v2/bitmap_index_reader.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+#include <stddef.h>
+
+#include <roaring/roaring.hh>
+
 #include "olap/types.h"
+#include "vec/columns/column.h"
+#include "vec/common/string_ref.h"
+#include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 
 namespace doris {
diff --git a/be/src/olap/rowset/segment_v2/bitmap_index_reader.h b/be/src/olap/rowset/segment_v2/bitmap_index_reader.h
index e5fc28adcd..c448c9f5cc 100644
--- a/be/src/olap/rowset/segment_v2/bitmap_index_reader.h
+++ b/be/src/olap/rowset/segment_v2/bitmap_index_reader.h
@@ -17,23 +17,28 @@
 
 #pragma once
 
-#include <roaring/roaring.hh>
+#include <stdint.h>
+
+#include <memory>
+#include <utility>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/indexed_column_reader.h"
+#include "olap/types.h"
 
-namespace doris {
+namespace roaring {
+class Roaring;
+} // namespace roaring
 
-class TypeInfo;
+namespace doris {
 
 namespace segment_v2 {
 
 class BitmapIndexIterator;
-class IndexedColumnReader;
-class IndexedColumnIterator;
+class BitmapIndexPB;
 
 class BitmapIndexReader {
 public:
diff --git a/be/src/olap/rowset/segment_v2/bitmap_index_writer.cpp b/be/src/olap/rowset/segment_v2/bitmap_index_writer.cpp
index 957da3dc3d..8523740920 100644
--- a/be/src/olap/rowset/segment_v2/bitmap_index_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/bitmap_index_writer.cpp
@@ -17,9 +17,15 @@
 
 #include "olap/rowset/segment_v2/bitmap_index_writer.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <algorithm>
 #include <map>
 #include <roaring/roaring.hh>
+#include <string>
+#include <vector>
 
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/encoding_info.h"
 #include "olap/rowset/segment_v2/indexed_column_writer.h"
diff --git a/be/src/olap/rowset/segment_v2/bitmap_index_writer.h b/be/src/olap/rowset/segment_v2/bitmap_index_writer.h
index 93142728a4..cf7de5efe9 100644
--- a/be/src/olap/rowset/segment_v2/bitmap_index_writer.h
+++ b/be/src/olap/rowset/segment_v2/bitmap_index_writer.h
@@ -17,12 +17,13 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <stdint.h>
+
 #include <cstddef>
 #include <memory>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/macros.h"
 
 namespace doris {
 
@@ -33,6 +34,7 @@ class FileWriter;
 }
 
 namespace segment_v2 {
+class ColumnIndexMetaPB;
 
 class BitmapIndexWriter {
 public:
diff --git a/be/src/olap/rowset/segment_v2/bitshuffle_page.cpp b/be/src/olap/rowset/segment_v2/bitshuffle_page.cpp
index 3afa0f4422..cd6f1f4e91 100644
--- a/be/src/olap/rowset/segment_v2/bitshuffle_page.cpp
+++ b/be/src/olap/rowset/segment_v2/bitshuffle_page.cpp
@@ -17,8 +17,6 @@
 
 #include "olap/rowset/segment_v2/bitshuffle_page.h"
 
-#include "olap/rowset/segment_v2/common.h"
-
 namespace doris {
 
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/bitshuffle_page.h b/be/src/olap/rowset/segment_v2/bitshuffle_page.h
index 767ff35cfe..657a34e7c1 100644
--- a/be/src/olap/rowset/segment_v2/bitshuffle_page.h
+++ b/be/src/olap/rowset/segment_v2/bitshuffle_page.h
@@ -18,13 +18,15 @@
 #pragma once
 
 #include <glog/logging.h>
-#include <sys/types.h>
 
 #include <algorithm>
 #include <cstdint>
 #include <cstring>
 #include <ostream>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/status.h"
 #include "gutil/port.h"
 #include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/bitshuffle_wrapper.h"
@@ -33,12 +35,12 @@
 #include "olap/rowset/segment_v2/page_builder.h"
 #include "olap/rowset/segment_v2/page_decoder.h"
 #include "olap/types.h"
-#include "runtime/memory/chunk_allocator.h"
+#include "util/alignment.h"
 #include "util/coding.h"
 #include "util/faststring.h"
 #include "util/slice.h"
-#include "vec/columns/column_nullable.h"
-#include "vec/runtime/vdatetime_value.h"
+#include "vec/columns/column.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/block_split_bloom_filter.cpp b/be/src/olap/rowset/segment_v2/block_split_bloom_filter.cpp
index da842d491b..871da736d5 100644
--- a/be/src/olap/rowset/segment_v2/block_split_bloom_filter.cpp
+++ b/be/src/olap/rowset/segment_v2/block_split_bloom_filter.cpp
@@ -17,7 +17,7 @@
 
 #include "olap/rowset/segment_v2/block_split_bloom_filter.h"
 
-#include "util/debug_util.h"
+#include <glog/logging.h>
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/block_split_bloom_filter.h b/be/src/olap/rowset/segment_v2/block_split_bloom_filter.h
index 93591adc1d..f68ddd7e74 100644
--- a/be/src/olap/rowset/segment_v2/block_split_bloom_filter.h
+++ b/be/src/olap/rowset/segment_v2/block_split_bloom_filter.h
@@ -17,6 +17,8 @@
 
 #pragma once
 
+#include <stdint.h>
+
 #include "olap/rowset/segment_v2/bloom_filter.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/segment_v2/bloom_filter.cpp b/be/src/olap/rowset/segment_v2/bloom_filter.cpp
index e11fe6ca1d..12a7f2395e 100644
--- a/be/src/olap/rowset/segment_v2/bloom_filter.cpp
+++ b/be/src/olap/rowset/segment_v2/bloom_filter.cpp
@@ -15,14 +15,17 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include "olap/rowset/segment_v2/bloom_filter.h"
+
+#include <gen_cpp/segment_v2.pb.h>
+#include <math.h>
+
 #include <cstdint>
-#include <functional>
+#include <memory>
 
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/strings/substitute.h"
+#include "common/status.h"
 #include "olap/rowset/segment_v2/block_split_bloom_filter.h"
 #include "olap/rowset/segment_v2/ngram_bloom_filter.h"
-#include "olap/utils.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/bloom_filter.h b/be/src/olap/rowset/segment_v2/bloom_filter.h
index c235ec39b9..969d7b8aa9 100644
--- a/be/src/olap/rowset/segment_v2/bloom_filter.h
+++ b/be/src/olap/rowset/segment_v2/bloom_filter.h
@@ -17,14 +17,15 @@
 
 #pragma once
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+#include <string.h>
+
 #include <cstdint>
 #include <functional>
 #include <memory>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/strings/substitute.h"
-#include "olap/utils.h"
 #include "util/murmur_hash3.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.cpp b/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.cpp
index cecbd8c4ca..e3ae352dd7 100644
--- a/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.cpp
@@ -17,8 +17,14 @@
 
 #include "olap/rowset/segment_v2/bloom_filter_index_reader.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+
 #include "olap/rowset/segment_v2/bloom_filter.h"
 #include "olap/types.h"
+#include "vec/columns/column.h"
+#include "vec/common/string_ref.h"
+#include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 
 namespace doris {
diff --git a/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.h b/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.h
index bb9a02c244..452a7ea2ae 100644
--- a/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.h
+++ b/be/src/olap/rowset/segment_v2/bloom_filter_index_reader.h
@@ -17,26 +17,25 @@
 
 #pragma once
 
-#include <map>
+#include <stddef.h>
+
 #include <memory>
+#include <utility>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/indexed_column_reader.h"
-#include "olap/rowset/segment_v2/row_ranges.h"
+#include "olap/types.h"
 
 namespace doris {
 
-class TypeInfo;
-
 namespace segment_v2 {
 
 class BloomFilterIndexIterator;
-class IndexedColumnReader;
-class IndexedColumnIterator;
 class BloomFilter;
+class BloomFilterIndexPB;
 
 class BloomFilterIndexReader {
 public:
diff --git a/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.cpp b/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.cpp
index 588f2eb997..34ff479733 100644
--- a/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.cpp
@@ -17,16 +17,21 @@
 
 #include "olap/rowset/segment_v2/bloom_filter_index_writer.h"
 
-#include <map>
-#include <roaring/roaring.hh>
+#include <gen_cpp/segment_v2.pb.h>
+#include <string.h>
 
+#include <algorithm>
+#include <set>
+#include <string>
+#include <utility>
+
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/bloom_filter.h" // for BloomFilterOptions, BloomFilter
-#include "olap/rowset/segment_v2/common.h"
-#include "olap/rowset/segment_v2/encoding_info.h"
 #include "olap/rowset/segment_v2/indexed_column_writer.h"
 #include "olap/types.h"
-#include "util/faststring.h"
+#include "runtime/decimalv2_value.h"
 #include "util/slice.h"
+#include "util/types.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.h b/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.h
index 2cd0b8e340..c4f20d0f6b 100644
--- a/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.h
+++ b/be/src/olap/rowset/segment_v2/bloom_filter_index_writer.h
@@ -17,13 +17,16 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <stdint.h>
+
 #include <cstddef>
 #include <memory>
+#include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/macros.h"
 #include "olap/itoken_extractor.h"
+#include "olap/rowset/segment_v2/bloom_filter.h"
 #include "vec/common/arena.h"
 
 namespace doris {
@@ -36,7 +39,7 @@ class FileWriter;
 
 namespace segment_v2 {
 
-struct BloomFilterOptions;
+class ColumnIndexMetaPB;
 
 class BloomFilterIndexWriter {
 public:
diff --git a/be/src/olap/rowset/segment_v2/column_reader.cpp b/be/src/olap/rowset/segment_v2/column_reader.cpp
index a4a437c353..c4219916c9 100644
--- a/be/src/olap/rowset/segment_v2/column_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/column_reader.cpp
@@ -17,21 +17,51 @@
 
 #include "olap/rowset/segment_v2/column_reader.h"
 
+#include <assert.h>
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <algorithm>
+#include <ostream>
+#include <set>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "io/fs/file_reader.h"
+#include "olap/block_column_predicate.h"
+#include "olap/column_predicate.h"
+#include "olap/decimal12.h"
+#include "olap/inverted_index_parser.h"
 #include "olap/rowset/segment_v2/binary_dict_page.h" // for BinaryDictPageDecoder
+#include "olap/rowset/segment_v2/binary_plain_page.h"
+#include "olap/rowset/segment_v2/bitmap_index_reader.h"
+#include "olap/rowset/segment_v2/bloom_filter.h"
 #include "olap/rowset/segment_v2/bloom_filter_index_reader.h"
 #include "olap/rowset/segment_v2/encoding_info.h" // for EncodingInfo
-#include "olap/rowset/segment_v2/page_handle.h"   // for PageHandle
+#include "olap/rowset/segment_v2/inverted_index_reader.h"
+#include "olap/rowset/segment_v2/page_decoder.h"
+#include "olap/rowset/segment_v2/page_handle.h" // for PageHandle
 #include "olap/rowset/segment_v2/page_io.h"
 #include "olap/rowset/segment_v2/page_pointer.h" // for PagePointer
-#include "olap/types.h"                          // for TypeInfo
+#include "olap/rowset/segment_v2/row_ranges.h"
+#include "olap/rowset/segment_v2/zone_map_index.h"
+#include "olap/tablet_schema.h"
+#include "olap/types.h" // for TypeInfo
 #include "olap/wrapper_field.h"
+#include "runtime/decimalv2_value.h"
+#include "util/binary_cast.hpp"
+#include "util/bitmap.h"
 #include "util/block_compression.h"
 #include "util/rle_encoding.h" // for RleDecoder
+#include "util/slice.h"
 #include "vec/columns/column.h"
 #include "vec/columns/column_array.h"
 #include "vec/columns/column_map.h"
+#include "vec/columns/column_nullable.h"
 #include "vec/columns/column_struct.h"
+#include "vec/columns/column_vector.h"
+#include "vec/columns/columns_number.h"
+#include "vec/common/assert_cast.h"
+#include "vec/common/string_ref.h"
 #include "vec/core/types.h"
 #include "vec/runtime/vdatetime_value.h" //for VecDateTime
 
diff --git a/be/src/olap/rowset/segment_v2/column_reader.h b/be/src/olap/rowset/segment_v2/column_reader.h
index e0e7bc4a6f..19c43ed427 100644
--- a/be/src/olap/rowset/segment_v2/column_reader.h
+++ b/be/src/olap/rowset/segment_v2/column_reader.h
@@ -17,48 +17,61 @@
 
 #pragma once
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <sys/types.h>
+
 #include <cstddef> // for size_t
 #include <cstdint> // for uint32_t
 #include <memory>  // for unique_ptr
+#include <mutex>
+#include <string>
+#include <utility>
+#include <vector>
 
-#include "bloom_filter_index_reader.h"
+#include "common/config.h"
 #include "common/logging.h"
-#include "common/status.h"         // for Status
-#include "gen_cpp/segment_v2.pb.h" // for ColumnMetaPB
-#include "io/fs/file_reader.h"
+#include "common/status.h" // for Status
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/io_common.h"
-#include "olap/block_column_predicate.h"
-#include "olap/column_predicate.h"
-#include "olap/iterators.h"
-#include "olap/rowset/segment_v2/bitmap_index_reader.h" // for BitmapIndexReader
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/common.h"
-#include "olap/rowset/segment_v2/inverted_index_reader.h" // for InvertedIndexReader
-#include "olap/rowset/segment_v2/ordinal_page_index.h"    // for OrdinalPageIndexIterator
-#include "olap/rowset/segment_v2/page_handle.h"           // for PageHandle
-#include "olap/rowset/segment_v2/parsed_page.h"           // for ParsedPage
-#include "olap/rowset/segment_v2/row_ranges.h"            // for RowRanges
-#include "olap/rowset/segment_v2/zone_map_index.h"
-#include "olap/tablet_schema.h"
+#include "olap/rowset/segment_v2/ordinal_page_index.h" // for OrdinalPageIndexIterator
+#include "olap/rowset/segment_v2/page_handle.h"        // for PageHandle
+#include "olap/rowset/segment_v2/page_pointer.h"
+#include "olap/rowset/segment_v2/parsed_page.h" // for ParsedPage
+#include "olap/types.h"
+#include "olap/utils.h"
 #include "util/once.h"
+#include "vec/columns/column.h"
 #include "vec/columns/column_array.h" // ColumnArray
+#include "vec/data_types/data_type.h"
 
 namespace doris {
 
-class TypeInfo;
 class BlockCompressionCodec;
 class WrapperField;
+class AndBlockColumnPredicate;
+class ColumnPredicate;
+class TabletIndex;
 
-namespace fs {
-class ReadableBlock;
-}
+namespace io {
+class FileReader;
+} // namespace io
+struct Slice;
+struct StringRef;
 
 namespace segment_v2 {
 
 class EncodingInfo;
-class PageHandle;
-struct PagePointer;
 class ColumnIterator;
 class BloomFilterIndexReader;
+class BitmapIndexIterator;
+class BitmapIndexReader;
+class InvertedIndexIterator;
+class InvertedIndexReader;
+class PageDecoder;
+class RowRanges;
+class ZoneMapIndexReader;
 
 struct ColumnReaderOptions {
     // whether verify checksum when read page
diff --git a/be/src/olap/rowset/segment_v2/column_writer.cpp b/be/src/olap/rowset/segment_v2/column_writer.cpp
index ab542a49dd..0ee3608f84 100644
--- a/be/src/olap/rowset/segment_v2/column_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/column_writer.cpp
@@ -17,11 +17,17 @@
 
 #include "olap/rowset/segment_v2/column_writer.h"
 
-#include <cstddef>
+#include <assert.h>
+#include <gen_cpp/segment_v2.pb.h>
 
+#include <algorithm>
+#include <filesystem>
+
+#include "common/config.h"
 #include "common/logging.h"
 #include "gutil/strings/substitute.h"
 #include "io/fs/file_writer.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/bitmap_index_writer.h"
 #include "olap/rowset/segment_v2/bloom_filter.h"
 #include "olap/rowset/segment_v2/bloom_filter_index_writer.h"
@@ -31,10 +37,15 @@
 #include "olap/rowset/segment_v2/ordinal_page_index.h"
 #include "olap/rowset/segment_v2/page_builder.h"
 #include "olap/rowset/segment_v2/page_io.h"
+#include "olap/rowset/segment_v2/page_pointer.h"
 #include "olap/rowset/segment_v2/zone_map_index.h"
+#include "olap/tablet_schema.h"
+#include "olap/types.h"
+#include "runtime/collection_value.h"
 #include "util/block_compression.h"
 #include "util/faststring.h"
 #include "util/rle_encoding.h"
+#include "vec/core/types.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/column_writer.h b/be/src/olap/rowset/segment_v2/column_writer.h
index 2aed982126..1c235ccda7 100644
--- a/be/src/olap/rowset/segment_v2/column_writer.h
+++ b/be/src/olap/rowset/segment_v2/column_writer.h
@@ -17,22 +17,29 @@
 
 #pragma once
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
 #include <memory> // for unique_ptr
+#include <ostream>
+#include <string>
+#include <utility>
+#include <vector>
 
-#include "common/status.h"         // for Status
-#include "gen_cpp/segment_v2.pb.h" // for EncodingTypePB
-#include "olap/field.h"            // for Field
-#include "olap/inverted_index_parser.h"
+#include "common/status.h" // for Status
+#include "olap/field.h"    // for Field
 #include "olap/rowset/segment_v2/common.h"
-#include "olap/rowset/segment_v2/page_pointer.h" // for PagePointer
-#include "olap/tablet_schema.h"                  // for TabletColumn
-#include "util/bitmap.h"                         // for BitmapChange
-#include "util/slice.h"                          // for OwnedSlice
+#include "olap/rowset/segment_v2/inverted_index_writer.h"
+#include "util/bitmap.h" // for BitmapChange
+#include "util/slice.h"  // for OwnedSlice
 
 namespace doris {
 
-class TypeInfo;
 class BlockCompressionCodec;
+class TabletColumn;
+class TabletIndex;
 
 namespace io {
 class FileWriter;
@@ -69,7 +76,6 @@ struct ColumnWriterOptions {
 };
 
 class BitmapIndexWriter;
-class InvertedIndexColumnWriter;
 class EncodingInfo;
 class NullBitmapBuilder;
 class OrdinalIndexWriter;
diff --git a/be/src/olap/rowset/segment_v2/empty_segment_iterator.cpp b/be/src/olap/rowset/segment_v2/empty_segment_iterator.cpp
index e9a51ed46a..95491196f9 100644
--- a/be/src/olap/rowset/segment_v2/empty_segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/empty_segment_iterator.cpp
@@ -18,6 +18,10 @@
 #include "olap/rowset/segment_v2/empty_segment_iterator.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
+
 namespace segment_v2 {
 
 EmptySegmentIterator::EmptySegmentIterator(const doris::Schema& schema) : _schema(schema) {}
diff --git a/be/src/olap/rowset/segment_v2/empty_segment_iterator.h b/be/src/olap/rowset/segment_v2/empty_segment_iterator.h
index 0bd7014c61..46d4e9bb8f 100644
--- a/be/src/olap/rowset/segment_v2/empty_segment_iterator.h
+++ b/be/src/olap/rowset/segment_v2/empty_segment_iterator.h
@@ -19,10 +19,13 @@
 
 #include "common/status.h"
 #include "olap/iterators.h"
-#include "olap/rowset/segment_v2/segment.h"
 #include "olap/schema.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
+
 namespace segment_v2 {
 
 class EmptySegmentIterator : public RowwiseIterator {
diff --git a/be/src/olap/rowset/segment_v2/encoding_info.cpp b/be/src/olap/rowset/segment_v2/encoding_info.cpp
index 0949e9c1b9..c500d7e902 100644
--- a/be/src/olap/rowset/segment_v2/encoding_info.cpp
+++ b/be/src/olap/rowset/segment_v2/encoding_info.cpp
@@ -17,9 +17,13 @@
 
 #include "olap/rowset/segment_v2/encoding_info.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <iterator>
 #include <type_traits>
+#include <unordered_map>
+#include <utility>
 
-#include "gutil/strings/substitute.h"
 #include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/binary_dict_page.h"
 #include "olap/rowset/segment_v2/binary_plain_page.h"
@@ -29,6 +33,7 @@
 #include "olap/rowset/segment_v2/frame_of_reference_page.h"
 #include "olap/rowset/segment_v2/plain_page.h"
 #include "olap/rowset/segment_v2/rle_page.h"
+#include "olap/types.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/encoding_info.h b/be/src/olap/rowset/segment_v2/encoding_info.h
index 7783862462..4086f78294 100644
--- a/be/src/olap/rowset/segment_v2/encoding_info.h
+++ b/be/src/olap/rowset/segment_v2/encoding_info.h
@@ -17,15 +17,18 @@
 
 #pragma once
 
+#include <stddef.h>
+
 #include <functional>
+#include <memory>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "olap/types.h"
+#include "util/slice.h"
 
 namespace doris {
 
 class TypeInfo;
+enum class FieldType;
 
 namespace segment_v2 {
 
@@ -33,6 +36,7 @@ class PageBuilder;
 class PageDecoder;
 struct PageBuilderOptions;
 struct PageDecoderOptions;
+enum EncodingTypePB : int;
 
 // For better performance, some encodings (like BitShuffle) need to be decoded before being added to the PageCache.
 class DataPagePreDecoder {
diff --git a/be/src/olap/rowset/segment_v2/index_page.cpp b/be/src/olap/rowset/segment_v2/index_page.cpp
index 604cab1f3d..3b8bc03977 100644
--- a/be/src/olap/rowset/segment_v2/index_page.cpp
+++ b/be/src/olap/rowset/segment_v2/index_page.cpp
@@ -17,9 +17,11 @@
 
 #include "olap/rowset/segment_v2/index_page.h"
 
-#include <string>
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <algorithm>
+#include <ostream>
 
-#include "common/logging.h"
 #include "util/coding.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/segment_v2/index_page.h b/be/src/olap/rowset/segment_v2/index_page.h
index dcfcedafb1..106fc0ffc5 100644
--- a/be/src/olap/rowset/segment_v2/index_page.h
+++ b/be/src/olap/rowset/segment_v2/index_page.h
@@ -17,13 +17,15 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+#include <stdint.h>
+
 #include <cstddef>
-#include <memory>
 #include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/macros.h"
 #include "olap/rowset/segment_v2/page_pointer.h"
 #include "util/faststring.h"
 #include "util/slice.h"
@@ -77,7 +79,6 @@ private:
     uint32_t _count = 0;
 };
 
-class IndexPageIterator;
 class IndexPageReader {
 public:
     IndexPageReader() : _parsed(false) {}
diff --git a/be/src/olap/rowset/segment_v2/indexed_column_reader.cpp b/be/src/olap/rowset/segment_v2/indexed_column_reader.cpp
index 0dc0bffca6..8c5997f99f 100644
--- a/be/src/olap/rowset/segment_v2/indexed_column_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/indexed_column_reader.cpp
@@ -17,11 +17,19 @@
 
 #include "olap/rowset/segment_v2/indexed_column_reader.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <algorithm>
+
 #include "gutil/strings/substitute.h" // for Substitute
-#include "io/fs/local_file_system.h"
 #include "olap/key_coder.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/encoding_info.h" // for EncodingInfo
+#include "olap/rowset/segment_v2/options.h"
+#include "olap/rowset/segment_v2/page_decoder.h"
 #include "olap/rowset/segment_v2/page_io.h"
+#include "olap/types.h"
+#include "util/block_compression.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/olap/rowset/segment_v2/indexed_column_reader.h b/be/src/olap/rowset/segment_v2/indexed_column_reader.h
index 10b87050ae..3ee39e04c0 100644
--- a/be/src/olap/rowset/segment_v2/indexed_column_reader.h
+++ b/be/src/olap/rowset/segment_v2/indexed_column_reader.h
@@ -17,30 +17,33 @@
 
 #pragma once
 
-#include <memory>
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+#include <stddef.h>
+#include <stdint.h>
+
 #include <string>
+#include <utility>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "io/fs/file_reader.h"
-#include "io/fs/file_system.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/index_page.h"
 #include "olap/rowset/segment_v2/page_handle.h"
 #include "olap/rowset/segment_v2/page_pointer.h"
 #include "olap/rowset/segment_v2/parsed_page.h"
-#include "util/block_compression.h"
 #include "util/slice.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
 
 class KeyCoder;
 class TypeInfo;
+class BlockCompressionCodec;
 
 namespace segment_v2 {
 
 class EncodingInfo;
-class IndexedColumnIterator;
 
 // thread-safe reader for IndexedColumn (see comments of `IndexedColumnWriter` to understand what IndexedColumn is)
 class IndexedColumnReader {
diff --git a/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp b/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp
index bd912c6eb8..0afbcc349c 100644
--- a/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp
@@ -17,10 +17,14 @@
 
 #include "olap/rowset/segment_v2/indexed_column_writer.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <ostream>
 #include <string>
 
 #include "common/logging.h"
 #include "olap/key_coder.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/encoding_info.h"
 #include "olap/rowset/segment_v2/index_page.h"
 #include "olap/rowset/segment_v2/options.h"
@@ -29,7 +33,7 @@
 #include "olap/rowset/segment_v2/page_pointer.h"
 #include "olap/types.h"
 #include "util/block_compression.h"
-#include "util/coding.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/indexed_column_writer.h b/be/src/olap/rowset/segment_v2/indexed_column_writer.h
index e4aadb7c3f..ab6812b5e5 100644
--- a/be/src/olap/rowset/segment_v2/indexed_column_writer.h
+++ b/be/src/olap/rowset/segment_v2/indexed_column_writer.h
@@ -17,16 +17,17 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <stdint.h>
+
 #include <cstddef>
 #include <memory>
-#include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/macros.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/page_pointer.h"
-#include "util/slice.h"
+#include "util/faststring.h"
 #include "vec/common/arena.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_cache.cpp b/be/src/olap/rowset/segment_v2/inverted_index_cache.cpp
index 00ae62c378..1c6a61003b 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_cache.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_cache.cpp
@@ -17,9 +17,23 @@
 
 #include "olap/rowset/segment_v2/inverted_index_cache.h"
 
+#include <CLucene/debug/mem.h>
+#include <CLucene/search/IndexSearcher.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
+#include <string.h>
+#include <sys/resource.h>
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <iostream>
+
+#include "common/logging.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/inverted_index_compound_directory.h"
 #include "olap/rowset/segment_v2/inverted_index_compound_reader.h"
+#include "runtime/thread_context.h"
 #include "util/defer_op.h"
+#include "util/runtime_profile.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_cache.h b/be/src/olap/rowset/segment_v2/inverted_index_cache.h
index 77d428aa42..3c225bb9d9 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_cache.h
+++ b/be/src/olap/rowset/segment_v2/inverted_index_cache.h
@@ -17,21 +17,36 @@
 
 #pragma once
 
-#include <CLucene.h>
-
-#include <iostream>
-#include <map>
+#include <CLucene.h> // IWYU pragma: keep
+#include <CLucene/util/Misc.h>
+#include <butil/macros.h>
+#include <glog/logging.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <atomic>
 #include <memory>
-#include <mutex>
 #include <roaring/roaring.hh>
-#include <vector>
+#include <string>
+#include <utility>
 
+#include "common/config.h"
+#include "common/status.h"
 #include "io/fs/file_system.h"
+#include "io/fs/path.h"
 #include "olap/lru_cache.h"
 #include "runtime/memory/mem_tracker.h"
+#include "util/slice.h"
 #include "util/time.h"
 
+namespace lucene {
+namespace search {
+class IndexSearcher;
+} // namespace search
+} // namespace lucene
+
 namespace doris {
+struct OlapReaderStatistics;
 
 namespace segment_v2 {
 using IndexSearcherPtr = std::shared_ptr<lucene::search::IndexSearcher>;
@@ -165,7 +180,6 @@ private:
 };
 
 enum class InvertedIndexQueryType;
-
 class InvertedIndexQueryCacheHandle;
 
 class InvertedIndexQueryCache {
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp
index c3b474dfe1..969623c780 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp
@@ -18,10 +18,11 @@
 #include "olap/rowset/segment_v2/inverted_index_compound_directory.h"
 
 #include "CLucene/SharedHeader.h"
-#include "CLucene/StdHeader.h"
+#include "common/status.h"
+#include "io/fs/file_reader.h"
 #include "io/fs/file_writer.h"
-#include "olap/iterators.h"
-#include "util/md5.h"
+#include "io/fs/path.h"
+#include "util/slice.h"
 
 #ifdef _CL_HAVE_IO_H
 #include <io.h>
@@ -35,12 +36,29 @@
 #ifdef _CL_HAVE_DIRECT_H
 #include <direct.h>
 #endif
+#include <CLucene/LuceneThreads.h>
+#include <CLucene/clucene-config.h>
+#include <CLucene/debug/error.h>
+#include <CLucene/debug/mem.h>
 #include <CLucene/index/IndexReader.h>
 #include <CLucene/index/IndexWriter.h>
 #include <CLucene/store/LockFactory.h>
+#include <CLucene/store/RAMDirectory.h>
 #include <CLucene/util/Misc.h>
 #include <assert.h>
-#include <errno.h>
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
+#include <glog/logging.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+
+#include <algorithm>
+#include <filesystem>
+#include <iostream>
+#include <memory>
+#include <mutex>
+#include <utility>
 
 #define CL_MAX_PATH 4096
 #define CL_MAX_DIR CL_MAX_PATH
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h
index b87498a34e..b06f980f6b 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h
+++ b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h
@@ -17,17 +17,28 @@
 
 #pragma once
 
-#include <CLucene.h>
+#include <CLucene.h> // IWYU pragma: keep
+#include <CLucene/store/Directory.h>
+#include <CLucene/store/IndexInput.h>
+#include <CLucene/store/IndexOutput.h>
+#include <stdint.h>
 
-#include <iostream>
-#include <map>
-#include <memory>
-#include <mutex>
+#include <string>
 #include <vector>
 
+#include "CLucene/SharedHeader.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_system.h"
 #include "util/lock.h"
 
+class CLuceneError;
+
+namespace lucene {
+namespace store {
+class LockFactory;
+} // namespace store
+} // namespace lucene
+
 namespace doris {
 
 namespace segment_v2 {
@@ -76,6 +87,7 @@ protected:
 public:
     class FSIndexOutput;
     class FSIndexInput;
+
     friend class DorisCompoundDirectory::FSIndexOutput;
     friend class DorisCompoundDirectory::FSIndexInput;
 
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.cpp b/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.cpp
index 9ce20703b4..15646679cf 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.cpp
@@ -17,8 +17,28 @@
 
 #include "olap/rowset/segment_v2/inverted_index_compound_reader.h"
 
+#include <CLucene/clucene-config.h>
+#include <CLucene/debug/error.h>
+#include <CLucene/debug/mem.h>
+#include <CLucene/store/RAMDirectory.h>
+#include <CLucene/util/Misc.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+
+#include <algorithm>
+#include <memory>
+#include <utility>
+
+#include "CLucene/SharedHeader.h"
 #include "olap/rowset/segment_v2/inverted_index_compound_directory.h"
 
+namespace doris {
+namespace io {
+class FileWriter;
+} // namespace io
+} // namespace doris
+
 #define BUFFER_LENGTH 16384
 #define CL_MAX_PATH 4096
 
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.h b/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.h
index d6e95d9d50..5c0d963247 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.h
+++ b/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.h
@@ -17,14 +17,28 @@
 
 #pragma once
 
-#include <CLucene.h>
+#include <CLucene.h> // IWYU pragma: keep
+#include <CLucene/SharedHeader.h>
+#include <CLucene/store/Directory.h>
+#include <CLucene/store/IndexInput.h>
+#include <CLucene/store/IndexOutput.h>
+#include <CLucene/util/Equators.h>
+#include <CLucene/util/VoidMap.h>
+#include <stdint.h>
 
-#include <iostream>
 #include <map>
-#include <memory>
 #include <mutex>
+#include <string>
 #include <vector>
 
+class CLuceneError;
+
+namespace lucene {
+namespace store {
+class RAMDirectory;
+} // namespace store
+} // namespace lucene
+
 namespace doris {
 
 namespace segment_v2 {
@@ -32,6 +46,7 @@ namespace segment_v2 {
 class CLUCENE_EXPORT DorisCompoundReader : public lucene::store::Directory {
 private:
     class ReaderFileEntry;
+
     friend class DorisCompoundReader::ReaderFileEntry;
 
     int32_t readBufferSize;
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_desc.cpp b/be/src/olap/rowset/segment_v2/inverted_index_desc.cpp
index 170409cac4..4bdf44ead0 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_desc.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_desc.cpp
@@ -17,7 +17,10 @@
 
 #include "olap/rowset/segment_v2/inverted_index_desc.h"
 
+#include <fmt/format.h>
+
 #include "gutil/strings/strip.h"
+#include "olap/olap_common.h"
 
 namespace doris::segment_v2 {
 const std::string segment_suffix = ".dat";
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_desc.h b/be/src/olap/rowset/segment_v2/inverted_index_desc.h
index 0da5dfddbb..1cf4636d80 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_desc.h
+++ b/be/src/olap/rowset/segment_v2/inverted_index_desc.h
@@ -17,12 +17,13 @@
 
 #pragma once
 
-#include <memory>
-#include <string>
+#include <stdint.h>
 
-#include "olap/olap_common.h"
+#include <string>
 
 namespace doris {
+struct RowsetId;
+
 namespace segment_v2 {
 
 class InvertedIndexDescriptor {
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp b/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp
index 9a7520dc57..6e94640255 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp
@@ -17,22 +17,44 @@
 
 #include "olap/rowset/segment_v2/inverted_index_reader.h"
 
+#include <CLucene/analysis/AnalysisHeader.h>
+#include <CLucene/analysis/Analyzers.h>
 #include <CLucene/analysis/LanguageBasedAnalyzer.h>
-#include <CLucene/search/BooleanQuery.h>
-#include <CLucene/search/PhraseQuery.h>
+#include <CLucene/analysis/standard/StandardAnalyzer.h>
+#include <CLucene/clucene-config.h>
+#include <CLucene/debug/error.h>
+#include <CLucene/debug/mem.h>
+#include <CLucene/index/IndexReader.h>
+#include <CLucene/index/Term.h>
+#include <CLucene/search/IndexSearcher.h>
+#include <CLucene/search/Query.h>
+#include <CLucene/search/RangeQuery.h>
+#include <CLucene/search/TermQuery.h>
+#include <CLucene/store/Directory.h>
+#include <CLucene/store/IndexInput.h>
+#include <CLucene/util/CLStreams.h>
 #include <CLucene/util/FutureArrays.h>
-#include <CLucene/util/NumericUtils.h>
+#include <CLucene/util/bkd/bkd_docid_iterator.h>
+#include <math.h>
+#include <string.h>
+
+#include <CLucene/util/croaring/roaring.hh>
+#include <algorithm>
+#include <filesystem>
+#include <ostream>
+#include <set>
 
 #include "common/config.h"
-#include "gutil/strings/strip.h"
+#include "common/logging.h"
 #include "io/fs/file_system.h"
 #include "olap/key_coder.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/inverted_index_cache.h"
 #include "olap/rowset/segment_v2/inverted_index_compound_directory.h"
 #include "olap/rowset/segment_v2/inverted_index_desc.h"
-#include "olap/tablet_schema.h"
-#include "olap/utils.h"
+#include "olap/types.h"
 #include "util/faststring.h"
+#include "util/runtime_profile.h"
 #include "util/time.h"
 #include "vec/common/string_ref.h"
 
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_reader.h b/be/src/olap/rowset/segment_v2/inverted_index_reader.h
index 731b6ca6b2..9438d5a07d 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_reader.h
+++ b/be/src/olap/rowset/segment_v2/inverted_index_reader.h
@@ -17,30 +17,44 @@
 
 #pragma once
 
-#include <CLucene.h>
-#include <CLucene/util/BitSet.h>
 #include <CLucene/util/bkd/bkd_reader.h>
+#include <stdint.h>
 
-#include <roaring/roaring.hh>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/macros.h"
 #include "io/fs/file_system.h"
+#include "io/fs/path.h"
 #include "olap/inverted_index_parser.h"
-#include "olap/olap_common.h"
-#include "olap/rowset/segment_v2/common.h"
-#include "olap/rowset/segment_v2/inverted_index_cache.h"
 #include "olap/rowset/segment_v2/inverted_index_compound_reader.h"
 #include "olap/tablet_schema.h"
 
+namespace lucene {
+namespace store {
+class Directory;
+} // namespace store
+namespace util {
+namespace bkd {
+class bkd_docid_set_iterator;
+} // namespace bkd
+} // namespace util
+} // namespace lucene
+namespace roaring {
+class Roaring;
+} // namespace roaring
+
 namespace doris {
 class KeyCoder;
 class TypeInfo;
+struct OlapReaderStatistics;
 
 namespace segment_v2 {
 
 class InvertedIndexIterator;
+class InvertedIndexQueryCacheHandle;
 
 enum class InvertedIndexReaderType {
     UNKNOWN = -1,
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
index ae95408648..7cfc1807c0 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
@@ -17,20 +17,33 @@
 
 #include "olap/rowset/segment_v2/inverted_index_writer.h"
 
-#include <CLucene.h>
+#include <CLucene.h> // IWYU pragma: keep
 #include <CLucene/analysis/LanguageBasedAnalyzer.h>
 #include <CLucene/util/bkd/bkd_writer.h>
+#include <glog/logging.h>
 
+#include <algorithm>
+#include <cstdint>
+#include <limits>
 #include <memory>
+#include <ostream>
+#include <roaring/roaring.hh>
+#include <vector>
 
+#include "common/config.h"
 #include "olap/field.h"
+#include "olap/inverted_index_parser.h"
+#include "olap/key_coder.h"
 #include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/inverted_index_cache.h"
 #include "olap/rowset/segment_v2/inverted_index_compound_directory.h"
 #include "olap/rowset/segment_v2/inverted_index_desc.h"
 #include "olap/tablet_schema.h"
+#include "olap/types.h"
+#include "runtime/collection_value.h"
 #include "util/faststring.h"
+#include "util/slice.h"
 #include "util/string_util.h"
 
 #define FINALIZE_OUTPUT(x) \
@@ -531,4 +544,4 @@ Status InvertedIndexColumnWriter::create(const Field* field,
     }
     return Status::OK();
 }
-} // namespace doris::segment_v2
\ No newline at end of file
+} // namespace doris::segment_v2
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_writer.h b/be/src/olap/rowset/segment_v2/inverted_index_writer.h
index 16678e6c93..a92ec6220b 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_writer.h
+++ b/be/src/olap/rowset/segment_v2/inverted_index_writer.h
@@ -17,14 +17,20 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+
 #include "common/status.h"
 #include "io/fs/file_system.h"
-#include "olap/inverted_index_parser.h"
-#include "olap/olap_common.h"
-#include "olap/tablet_schema.h"
 
 namespace doris {
 class CollectionValue;
+class Field;
+class TabletIndex;
 
 namespace segment_v2 {
 
diff --git a/be/src/olap/rowset/segment_v2/ngram_bloom_filter.cpp b/be/src/olap/rowset/segment_v2/ngram_bloom_filter.cpp
index a761c5a6e4..54f49b8bb6 100644
--- a/be/src/olap/rowset/segment_v2/ngram_bloom_filter.cpp
+++ b/be/src/olap/rowset/segment_v2/ngram_bloom_filter.cpp
@@ -17,8 +17,11 @@
 
 #include "olap/rowset/segment_v2/ngram_bloom_filter.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+
+#include "gutil/strings/substitute.h"
 #include "util/cityhash102/city.h"
-#include "util/debug_util.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/ngram_bloom_filter.h b/be/src/olap/rowset/segment_v2/ngram_bloom_filter.h
index c7684a796f..b69e467831 100644
--- a/be/src/olap/rowset/segment_v2/ngram_bloom_filter.h
+++ b/be/src/olap/rowset/segment_v2/ngram_bloom_filter.h
@@ -17,10 +17,17 @@
 
 #pragma once
 
+#include <stddef.h>
+#include <stdint.h>
+
+#include <vector>
+
+#include "common/status.h"
 #include "olap/rowset/segment_v2/bloom_filter.h"
 
 namespace doris {
 namespace segment_v2 {
+enum HashStrategyPB : int;
 
 class NGramBloomFilter : public BloomFilter {
 public:
diff --git a/be/src/olap/rowset/segment_v2/ordinal_page_index.cpp b/be/src/olap/rowset/segment_v2/ordinal_page_index.cpp
index 5a077ae80a..d977e29f11 100644
--- a/be/src/olap/rowset/segment_v2/ordinal_page_index.cpp
+++ b/be/src/olap/rowset/segment_v2/ordinal_page_index.cpp
@@ -17,12 +17,19 @@
 
 #include "olap/rowset/segment_v2/ordinal_page_index.h"
 
-#include "common/logging.h"
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <algorithm>
+#include <filesystem>
+#include <ostream>
+#include <string>
+
 #include "io/fs/file_writer.h"
-#include "io/fs/local_file_system.h"
 #include "olap/key_coder.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/page_handle.h"
 #include "olap/rowset/segment_v2/page_io.h"
+#include "util/slice.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/ordinal_page_index.h b/be/src/olap/rowset/segment_v2/ordinal_page_index.h
index d399b8db23..17dba9e675 100644
--- a/be/src/olap/rowset/segment_v2/ordinal_page_index.h
+++ b/be/src/olap/rowset/segment_v2/ordinal_page_index.h
@@ -17,18 +17,19 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <glog/logging.h>
+
 #include <cstdint>
 #include <memory>
-#include <string>
+#include <utility>
+#include <vector>
 
 #include "common/status.h"
-#include "gutil/macros.h"
-#include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/index_page.h"
 #include "olap/rowset/segment_v2/page_pointer.h"
-#include "util/coding.h"
-#include "util/slice.h"
 
 namespace doris {
 
@@ -37,6 +38,8 @@ class FileWriter;
 }
 
 namespace segment_v2 {
+class ColumnIndexMetaPB;
+class OrdinalIndexPB;
 
 // Ordinal index is implemented by one IndexPage that stores the first value ordinal
 // and file pointer for each data page.
diff --git a/be/src/olap/rowset/segment_v2/page_io.cpp b/be/src/olap/rowset/segment_v2/page_io.cpp
index 7eb3dd0549..ee8b761053 100644
--- a/be/src/olap/rowset/segment_v2/page_io.cpp
+++ b/be/src/olap/rowset/segment_v2/page_io.cpp
@@ -17,13 +17,24 @@
 
 #include "olap/rowset/segment_v2/page_io.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <stdint.h>
+
+#include <algorithm>
 #include <cstring>
+#include <memory>
+#include <ostream>
 #include <string>
+#include <utility>
 
 #include "common/logging.h"
 #include "gutil/strings/substitute.h"
+#include "io/fs/file_reader.h"
 #include "io/fs/file_writer.h"
+#include "olap/olap_common.h"
 #include "olap/page_cache.h"
+#include "olap/rowset/segment_v2/encoding_info.h"
+#include "olap/rowset/segment_v2/page_handle.h"
 #include "util/block_compression.h"
 #include "util/coding.h"
 #include "util/crc32c.h"
diff --git a/be/src/olap/rowset/segment_v2/page_io.h b/be/src/olap/rowset/segment_v2/page_io.h
index 06e345c27a..5ccccc2a3d 100644
--- a/be/src/olap/rowset/segment_v2/page_io.h
+++ b/be/src/olap/rowset/segment_v2/page_io.h
@@ -17,15 +17,13 @@
 
 #pragma once
 
+#include <gen_cpp/segment_v2.pb.h>
+
 #include <vector>
 
 #include "common/logging.h"
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "io/fs/file_reader.h"
-#include "olap/iterators.h"
-#include "olap/rowset/segment_v2/encoding_info.h"
-#include "olap/rowset/segment_v2/page_handle.h"
+#include "io/io_common.h"
 #include "olap/rowset/segment_v2/page_pointer.h"
 #include "util/slice.h"
 
@@ -34,16 +32,14 @@ namespace doris {
 class BlockCompressionCodec;
 struct OlapReaderStatistics;
 
-namespace fs {
-class ReadableBlock;
-class WritableBlock;
-} // namespace fs
-
 namespace io {
 class FileWriter;
+class FileReader;
 } // namespace io
 
 namespace segment_v2 {
+class EncodingInfo;
+class PageHandle;
 
 struct PageReadOptions {
     // block to read page
diff --git a/be/src/olap/rowset/segment_v2/page_pointer.h b/be/src/olap/rowset/segment_v2/page_pointer.h
index adddbbebaf..4693523986 100644
--- a/be/src/olap/rowset/segment_v2/page_pointer.h
+++ b/be/src/olap/rowset/segment_v2/page_pointer.h
@@ -17,10 +17,11 @@
 
 #pragma once
 
+#include <gen_cpp/segment_v2.pb.h>
+
 #include <cstdint>
 #include <string>
 
-#include "gen_cpp/segment_v2.pb.h"
 #include "util/coding.h"
 #include "util/faststring.h"
 
diff --git a/be/src/olap/rowset/segment_v2/parsed_page.h b/be/src/olap/rowset/segment_v2/parsed_page.h
index fe21f11dc3..159b0cca72 100644
--- a/be/src/olap/rowset/segment_v2/parsed_page.h
+++ b/be/src/olap/rowset/segment_v2/parsed_page.h
@@ -17,10 +17,11 @@
 
 #pragma once
 
+#include <gen_cpp/segment_v2.pb.h>
+
 #include <memory>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
 #include "olap/rowset/segment_v2/binary_dict_page.h"
 #include "olap/rowset/segment_v2/common.h"
 #include "olap/rowset/segment_v2/encoding_info.h"
diff --git a/be/src/olap/rowset/segment_v2/segment.cpp b/be/src/olap/rowset/segment_v2/segment.cpp
index 4a86e04a0f..cf952c2856 100644
--- a/be/src/olap/rowset/segment_v2/segment.cpp
+++ b/be/src/olap/rowset/segment_v2/segment.cpp
@@ -17,30 +17,53 @@
 
 #include "olap/rowset/segment_v2/segment.h"
 
+#include <gen_cpp/PlanNodes_types.h>
 #include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <string.h>
 
 #include <memory>
 #include <utility>
 
-#include "common/config.h"
-#include "common/logging.h" // LOG
-#include "io/cache/file_cache_manager.h"
-#include "io/fs/file_reader_options.h"
+#include "io/fs/file_reader.h"
 #include "io/fs/file_system.h"
+#include "io/io_common.h"
+#include "olap/block_column_predicate.h"
+#include "olap/column_predicate.h"
 #include "olap/iterators.h"
+#include "olap/primary_key_index.h"
 #include "olap/rowset/segment_v2/empty_segment_iterator.h"
+#include "olap/rowset/segment_v2/indexed_column_reader.h"
 #include "olap/rowset/segment_v2/page_io.h"
+#include "olap/rowset/segment_v2/page_pointer.h"
 #include "olap/rowset/segment_v2/segment_iterator.h"
 #include "olap/rowset/segment_v2/segment_writer.h" // k_segment_magic_length
+#include "olap/short_key_index.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet_schema.h"
+#include "olap/types.h"
+#include "olap/utils.h"
+#include "runtime/memory/mem_tracker.h"
+#include "runtime/query_fragments_ctx.h"
+#include "runtime/runtime_predicate.h"
+#include "runtime/runtime_state.h"
+#include "util/coding.h"
 #include "util/crc32c.h"
 #include "util/slice.h" // Slice
+#include "vec/columns/column.h"
+#include "vec/common/string_ref.h"
+#include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/olap/vgeneric_iterators.h"
 
 namespace doris {
+namespace io {
+class FileCacheManager;
+class FileReaderOptions;
+} // namespace io
+
 namespace segment_v2 {
+class InvertedIndexIterator;
 
 using io::FileCacheManager;
 
diff --git a/be/src/olap/rowset/segment_v2/segment.h b/be/src/olap/rowset/segment_v2/segment.h
index c8414566fc..bfb09eb1fd 100644
--- a/be/src/olap/rowset/segment_v2/segment.h
+++ b/be/src/olap/rowset/segment_v2/segment.h
@@ -17,38 +17,47 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+
 #include <cstdint>
+#include <map>
 #include <memory> // for unique_ptr
 #include <string>
-#include <vector>
+#include <unordered_map>
 
 #include "common/status.h" // Status
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/macros.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "io/fs/file_system.h"
-#include "olap/iterators.h"
-#include "olap/primary_key_index.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/column_reader.h" // ColumnReader
 #include "olap/rowset/segment_v2/page_handle.h"
-#include "olap/short_key_index.h"
 #include "olap/tablet_schema.h"
-#include "util/faststring.h"
 #include "util/once.h"
+#include "util/slice.h"
 
 namespace doris {
 
-class TabletSchema;
 class ShortKeyIndexDecoder;
 class Schema;
 class StorageReadOptions;
+class MemTracker;
+class PrimaryKeyIndexReader;
+class RowwiseIterator;
+
+namespace io {
+class FileReaderOptions;
+} // namespace io
+struct RowLocation;
 
 namespace segment_v2 {
 
 class BitmapIndexIterator;
-class ColumnReader;
-class ColumnIterator;
 class Segment;
-class SegmentIterator;
+class InvertedIndexIterator;
+
 using SegmentSharedPtr = std::shared_ptr<Segment>;
 // A Segment is used to represent a segment in memory format. When segment is
 // generated, it won't be modified, so this struct aimed to help read operation.
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index 5d3c375f54..a1c55855bf 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -17,25 +17,63 @@
 
 #include "olap/rowset/segment_v2/segment_iterator.h"
 
+#include <assert.h>
+#include <gen_cpp/Types_types.h>
+#include <gen_cpp/olap_file.pb.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
 #include <memory>
+#include <numeric>
 #include <set>
 #include <utility>
 
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/config.h"
 #include "common/consts.h"
+#include "common/logging.h"
+#include "common/object_pool.h"
 #include "common/status.h"
+#include "io/io_common.h"
 #include "olap/column_predicate.h"
 #include "olap/like_column_predicate.h"
 #include "olap/olap_common.h"
+#include "olap/primary_key_index.h"
+#include "olap/rowset/segment_v2/bitmap_index_reader.h"
 #include "olap/rowset/segment_v2/column_reader.h"
+#include "olap/rowset/segment_v2/indexed_column_reader.h"
+#include "olap/rowset/segment_v2/inverted_index_reader.h"
+#include "olap/rowset/segment_v2/row_ranges.h"
 #include "olap/rowset/segment_v2/segment.h"
 #include "olap/short_key_index.h"
+#include "olap/tablet_schema.h"
+#include "olap/types.h"
+#include "olap/utils.h"
+#include "runtime/query_fragments_ctx.h"
+#include "runtime/runtime_predicate.h"
+#include "runtime/runtime_state.h"
+#include "runtime/thread_context.h"
+#include "util/defer_op.h"
 #include "util/doris_metrics.h"
 #include "util/key_util.h"
 #include "util/simd/bits.h"
 #include "vec/columns/column.h"
 #include "vec/columns/column_const.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/assert_cast.h"
+#include "vec/common/string_ref.h"
+#include "vec/common/typeid_cast.h"
+#include "vec/core/column_with_type_and_name.h"
+#include "vec/core/field.h"
+#include "vec/core/types.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/data_type_number.h"
+#include "vec/exprs/vexpr.h"
+#include "vec/exprs/vexpr_context.h"
 #include "vec/exprs/vliteral.h"
 #include "vec/exprs/vslot_ref.h"
 
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.h b/be/src/olap/rowset/segment_v2/segment_iterator.h
index 9650ad9e27..5e3485eee0 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.h
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.h
@@ -17,36 +17,54 @@
 
 #pragma once
 
+#include <gen_cpp/Exprs_types.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <map>
 #include <memory>
+#include <ostream>
 #include <roaring/roaring.hh>
+#include <set>
+#include <string>
+#include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include "common/status.h"
-#include "io/fs/file_reader.h"
-#include "io/fs/file_system.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "olap/block_column_predicate.h"
+#include "olap/column_predicate.h"
+#include "olap/field.h"
+#include "olap/iterators.h"
 #include "olap/olap_common.h"
 #include "olap/row_cursor.h"
+#include "olap/row_cursor_cell.h"
 #include "olap/rowset/segment_v2/common.h"
-#include "olap/rowset/segment_v2/inverted_index_reader.h"
-#include "olap/rowset/segment_v2/row_ranges.h"
 #include "olap/rowset/segment_v2/segment.h"
 #include "olap/schema.h"
-#include "vec/exprs/vexpr.h"
+#include "util/runtime_profile.h"
+#include "util/slice.h"
+#include "vec/columns/column.h"
+#include "vec/core/block.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
 
-class RowCursor;
-class ShortKeyIndexIterator;
+class ObjectPool;
 
-namespace fs {
-class ReadableBlock;
-}
+namespace vectorized {
+class VExpr;
+class VExprContext;
+} // namespace vectorized
+struct RowLocation;
 
 namespace segment_v2 {
 
 class BitmapIndexIterator;
-class BitmapIndexReader;
 class ColumnIterator;
+class InvertedIndexIterator;
+class RowRanges;
 
 struct ColumnPredicateInfo {
     ColumnPredicateInfo() = default;
diff --git a/be/src/olap/rowset/segment_v2/segment_writer.cpp b/be/src/olap/rowset/segment_v2/segment_writer.cpp
index 3363f71cde..9f772e63e3 100644
--- a/be/src/olap/rowset/segment_v2/segment_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_writer.cpp
@@ -17,24 +17,40 @@
 
 #include "olap/rowset/segment_v2/segment_writer.h"
 
+#include <assert.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <parallel_hashmap/phmap.h>
+
+#include <algorithm>
+#include <ostream>
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/config.h"
-#include "common/consts.h"
 #include "common/logging.h" // LOG
+#include "gutil/port.h"
 #include "io/fs/file_writer.h"
 #include "olap/data_dir.h"
+#include "olap/key_coder.h"
+#include "olap/olap_common.h"
 #include "olap/primary_key_index.h"
-#include "olap/row_cursor.h"                      // RowCursor
+#include "olap/row_cursor.h"                      // IWYU pragma: keep
 #include "olap/rowset/rowset_writer_context.h"    // RowsetWriterContext
 #include "olap/rowset/segment_v2/column_writer.h" // ColumnWriter
 #include "olap/rowset/segment_v2/page_io.h"
-#include "olap/schema.h"
+#include "olap/rowset/segment_v2/page_pointer.h"
 #include "olap/short_key_index.h"
 #include "runtime/memory/mem_tracker.h"
 #include "service/point_query_executor.h"
+#include "util/coding.h"
 #include "util/crc32c.h"
 #include "util/faststring.h"
 #include "util/key_util.h"
 #include "vec/common/schema_util.h"
+#include "vec/core/block.h"
+#include "vec/core/column_with_type_and_name.h"
+#include "vec/olap/olap_data_convertor.h"
 
 namespace doris {
 namespace segment_v2 {
diff --git a/be/src/olap/rowset/segment_v2/segment_writer.h b/be/src/olap/rowset/segment_v2/segment_writer.h
index 8ffd4eaa5b..c907a357df 100644
--- a/be/src/olap/rowset/segment_v2/segment_writer.h
+++ b/be/src/olap/rowset/segment_v2/segment_writer.h
@@ -17,29 +17,38 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/segment_v2.pb.h>
+#include <stddef.h>
+
 #include <cstdint>
+#include <functional>
 #include <memory> // unique_ptr
 #include <string>
+#include <unordered_set>
 #include <vector>
 
 #include "common/status.h" // Status
-#include "gen_cpp/segment_v2.pb.h"
-#include "gutil/macros.h"
+#include "gutil/strings/substitute.h"
+#include "olap/olap_define.h"
+#include "olap/rowset/segment_v2/column_writer.h"
 #include "olap/tablet_schema.h"
 #include "util/faststring.h"
-#include "vec/core/block.h"
-#include "vec/olap/olap_data_convertor.h"
+#include "util/slice.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+class IOlapColumnDataAccessor;
+class OlapBlockDataConvertor;
+} // namespace vectorized
 
 // TODO(lingbin): Should be a conf that can be dynamically adjusted, or a member in the context
 const uint32_t MAX_SEGMENT_SIZE = static_cast<uint32_t>(OLAP_MAX_COLUMN_SEGMENT_FILE_SIZE *
                                                         OLAP_COLUMN_FILE_SEGMENT_SIZE_SCALE);
 class DataDir;
 class MemTracker;
-class RowCursor;
-class TabletSchema;
-class TabletColumn;
 class ShortKeyIndexBuilder;
 class PrimaryKeyIndexBuilder;
 class KeyCoder;
@@ -51,8 +60,6 @@ class FileWriter;
 
 namespace segment_v2 {
 
-class ColumnWriter;
-
 extern const char* k_segment_magic;
 extern const uint32_t k_segment_magic_length;
 
diff --git a/be/src/olap/rowset/segment_v2/zone_map_index.cpp b/be/src/olap/rowset/segment_v2/zone_map_index.cpp
index 5b63bcda03..9a4ec628c2 100644
--- a/be/src/olap/rowset/segment_v2/zone_map_index.cpp
+++ b/be/src/olap/rowset/segment_v2/zone_map_index.cpp
@@ -17,12 +17,27 @@
 
 #include "olap/rowset/segment_v2/zone_map_index.h"
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+
+#include <algorithm>
+#include <type_traits>
+
+#include "olap/olap_common.h"
 #include "olap/rowset/segment_v2/encoding_info.h"
 #include "olap/rowset/segment_v2/indexed_column_reader.h"
 #include "olap/rowset/segment_v2/indexed_column_writer.h"
 #include "olap/types.h"
+#include "runtime/primitive_type.h"
+#include "util/slice.h"
+#include "vec/columns/column.h"
+#include "vec/columns/column_string.h"
+#include "vec/common/string_ref.h"
+#include "vec/common/unaligned.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
+struct uint24_t;
 
 namespace segment_v2 {
 
diff --git a/be/src/olap/rowset/segment_v2/zone_map_index.h b/be/src/olap/rowset/segment_v2/zone_map_index.h
index 073ea2da31..ed3418dc48 100644
--- a/be/src/olap/rowset/segment_v2/zone_map_index.h
+++ b/be/src/olap/rowset/segment_v2/zone_map_index.h
@@ -17,16 +17,19 @@
 
 #pragma once
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <stddef.h>
+#include <stdint.h>
+
 #include <memory>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
 #include "olap/field.h"
-#include "olap/rowset/segment_v2/binary_plain_page.h"
-#include "util/slice.h"
+#include "runtime/define_primitive_type.h"
 #include "vec/common/arena.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/unique_rowset_id_generator.cpp b/be/src/olap/rowset/unique_rowset_id_generator.cpp
index 9db7faf35e..0d7d77915e 100644
--- a/be/src/olap/rowset/unique_rowset_id_generator.cpp
+++ b/be/src/olap/rowset/unique_rowset_id_generator.cpp
@@ -17,9 +17,12 @@
 
 #include "olap/rowset/unique_rowset_id_generator.h"
 
+#include <memory>
+#include <mutex>
+
 #include "util/doris_metrics.h"
+#include "util/metrics.h"
 #include "util/spinlock.h"
-#include "util/stack_util.h"
 #include "util/uid_util.h"
 
 namespace doris {
diff --git a/be/src/olap/rowset/unique_rowset_id_generator.h b/be/src/olap/rowset/unique_rowset_id_generator.h
index ef8d4cfde2..051eefd245 100644
--- a/be/src/olap/rowset/unique_rowset_id_generator.h
+++ b/be/src/olap/rowset/unique_rowset_id_generator.h
@@ -17,8 +17,12 @@
 
 #pragma once
 
+#include <stdint.h>
+
 #include <atomic>
+#include <unordered_set>
 
+#include "olap/olap_common.h"
 #include "olap/rowset/rowset_id_generator.h"
 #include "util/spinlock.h"
 #include "util/uid_util.h"
diff --git a/be/src/olap/rowset/vertical_beta_rowset_writer.cpp b/be/src/olap/rowset/vertical_beta_rowset_writer.cpp
index e1e3ab46de..6525407a91 100644
--- a/be/src/olap/rowset/vertical_beta_rowset_writer.cpp
+++ b/be/src/olap/rowset/vertical_beta_rowset_writer.cpp
@@ -17,7 +17,28 @@
 
 #include "olap/rowset/vertical_beta_rowset_writer.h"
 
+#include <gen_cpp/olap_file.pb.h>
+
+#include <algorithm>
+#include <atomic>
+#include <mutex>
+#include <ostream>
+#include <string>
+#include <utility>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/logging.h"
+#include "gutil/strings/substitute.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "io/fs/file_system.h"
+#include "io/fs/file_writer.h"
 #include "olap/rowset/beta_rowset.h"
+#include "olap/rowset/rowset_meta.h"
+#include "olap/rowset/rowset_writer_context.h"
+#include "util/slice.h"
+#include "util/spinlock.h"
+#include "vec/core/block.h"
 
 namespace doris {
 using namespace ErrorCode;
diff --git a/be/src/olap/rowset/vertical_beta_rowset_writer.h b/be/src/olap/rowset/vertical_beta_rowset_writer.h
index 56e2fb4d6a..71b132b9b4 100644
--- a/be/src/olap/rowset/vertical_beta_rowset_writer.h
+++ b/be/src/olap/rowset/vertical_beta_rowset_writer.h
@@ -17,10 +17,20 @@
 
 #pragma once
 
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
+#include <vector>
+
+#include "common/status.h"
 #include "olap/rowset/beta_rowset_writer.h"
 #include "olap/rowset/segment_v2/segment_writer.h"
 
 namespace doris {
+namespace vectorized {
+class Block;
+} // namespace vectorized
 
 // for vertical compaction
 class VerticalBetaRowsetWriter : public BetaRowsetWriter {
diff --git a/be/src/olap/schema.cpp b/be/src/olap/schema.cpp
index ab75f1f93a..373773fffe 100644
--- a/be/src/olap/schema.cpp
+++ b/be/src/olap/schema.cpp
@@ -17,12 +17,24 @@
 
 #include "olap/schema.h"
 
-#include "olap/uint24.h"
-#include "vec/columns/column_complex.h"
+#include <glog/logging.h>
+
+#include <boost/iterator/iterator_facade.hpp>
+#include <ostream>
+#include <unordered_set>
+#include <utility>
+
+#include "common/config.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/columns/column_array.h"
 #include "vec/columns/column_dictionary.h"
+#include "vec/columns/column_map.h"
 #include "vec/columns/column_nullable.h"
+#include "vec/columns/column_struct.h"
+#include "vec/columns/columns_number.h"
 #include "vec/columns/predicate_column.h"
 #include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 
 namespace doris {
diff --git a/be/src/olap/schema.h b/be/src/olap/schema.h
index 4d9594b344..b592563bd0 100644
--- a/be/src/olap/schema.h
+++ b/be/src/olap/schema.h
@@ -17,14 +17,22 @@
 
 #pragma once
 
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
+#include <memory>
+#include <string>
 #include <vector>
 
 #include "common/consts.h"
+#include "io/io_common.h"
 #include "olap/field.h"
-#include "olap/row_cursor_cell.h"
+#include "olap/olap_common.h"
 #include "olap/tablet_schema.h"
-#include "olap/types.h"
-#include "runtime/descriptors.h"
+#include "olap/utils.h"
+#include "vec/aggregate_functions/aggregate_function.h"
+#include "vec/columns/column.h"
 
 namespace doris {
 
diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index 2089b7c62d..9742b4d095 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -17,37 +17,66 @@
 
 #include "olap/schema_change.h"
 
+#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/Exprs_types.h>
 #include <gen_cpp/olap_file.pb.h>
 
-#include "common/config.h"
+#include <algorithm>
+#include <exception>
+#include <map>
+#include <mutex>
+#include <roaring/roaring.hh>
+#include <tuple>
+
+#include "common/logging.h"
 #include "common/status.h"
+#include "gutil/hash/hash.h"
 #include "gutil/integral_types.h"
+#include "gutil/strings/numbers.h"
+#include "io/fs/file_system.h"
+#include "io/io_common.h"
+#include "olap/data_dir.h"
+#include "olap/delete_handler.h"
+#include "olap/field.h"
+#include "olap/iterators.h"
 #include "olap/merger.h"
 #include "olap/olap_common.h"
-#include "olap/row_cursor.h"
+#include "olap/olap_define.h"
 #include "olap/rowset/beta_rowset.h"
-#include "olap/rowset/rowset_id_generator.h"
+#include "olap/rowset/rowset_meta.h"
+#include "olap/rowset/rowset_reader_context.h"
+#include "olap/rowset/rowset_writer_context.h"
 #include "olap/rowset/segment_v2/column_reader.h"
 #include "olap/rowset/segment_v2/inverted_index_desc.h"
 #include "olap/rowset/segment_v2/inverted_index_writer.h"
+#include "olap/rowset/segment_v2/segment.h"
+#include "olap/schema.h"
 #include "olap/segment_loader.h"
 #include "olap/storage_engine.h"
 #include "olap/tablet.h"
+#include "olap/tablet_manager.h"
+#include "olap/tablet_meta.h"
 #include "olap/tablet_schema.h"
 #include "olap/types.h"
 #include "olap/utils.h"
 #include "olap/wrapper_field.h"
 #include "runtime/memory/mem_tracker.h"
+#include "runtime/runtime_state.h"
 #include "util/defer_op.h"
 #include "vec/aggregate_functions/aggregate_function.h"
 #include "vec/aggregate_functions/aggregate_function_reader.h"
-#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
 #include "vec/columns/column.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/common/assert_cast.h"
 #include "vec/core/block.h"
+#include "vec/core/column_with_type_and_name.h"
 #include "vec/exprs/vexpr.h"
 #include "vec/exprs/vexpr_context.h"
+#include "vec/olap/olap_data_convertor.h"
 
 namespace doris {
+class CollectionValue;
+
 using namespace ErrorCode;
 
 constexpr int ALTER_TABLE_BATCH_SIZE = 4096;
diff --git a/be/src/olap/schema_change.h b/be/src/olap/schema_change.h
index 16226dfead..b74113c8c7 100644
--- a/be/src/olap/schema_change.h
+++ b/be/src/olap/schema_change.h
@@ -17,24 +17,52 @@
 
 #pragma once
 
-#include <cstdint>
-
+#include <butil/macros.h>
+#include <fmt/format.h>
+#include <gen_cpp/Descriptors_types.h>
+#include <glog/logging.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <memory>
+#include <ostream>
+#include <set>
+#include <shared_mutex>
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
+#include <utility>
+#include <vector>
+
+#include "common/config.h"
+#include "common/object_pool.h"
 #include "common/status.h"
-#include "gen_cpp/AgentService_types.h"
 #include "olap/column_mapping.h"
-#include "olap/delete_handler.h"
+#include "olap/olap_common.h"
 #include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_reader.h"
 #include "olap/rowset/rowset_writer.h"
+#include "olap/rowset/segment_v2/inverted_index_writer.h"
 #include "olap/tablet.h"
-#include "vec/columns/column.h"
-#include "vec/core/block.h"
-#include "vec/olap/olap_data_convertor.h"
+#include "olap/tablet_schema.h"
+#include "runtime/descriptors.h"
+#include "runtime/memory/mem_tracker.h"
+#include "vec/data_types/data_type.h"
 
 namespace doris {
-
-namespace segment_v2 {
-class InvertedIndexColumnWriter;
-}
+class DeleteHandler;
+class Field;
+class TAlterInvertedIndexReq;
+class TAlterTabletReqV2;
+class TExpr;
+enum AlterTabletType : int;
+enum RowsetTypePB : int;
+enum SegmentsOverlapPB : int;
+
+namespace vectorized {
+class Block;
+class OlapBlockDataConvertor;
+} // namespace vectorized
 
 class BlockChanger {
 public:
diff --git a/be/src/olap/segment_loader.cpp b/be/src/olap/segment_loader.cpp
index fa1e6c8751..eaf6651fc5 100644
--- a/be/src/olap/segment_loader.cpp
+++ b/be/src/olap/segment_loader.cpp
@@ -17,8 +17,9 @@
 
 #include "olap/segment_loader.h"
 
-#include "olap/rowset/rowset.h"
-#include "olap/tablet_schema.h"
+#include "common/config.h"
+#include "olap/olap_define.h"
+#include "olap/rowset/beta_rowset.h"
 #include "util/stopwatch.hpp"
 
 namespace doris {
diff --git a/be/src/olap/segment_loader.h b/be/src/olap/segment_loader.h
index 03a54acf55..13da58a2e5 100644
--- a/be/src/olap/segment_loader.h
+++ b/be/src/olap/segment_loader.h
@@ -17,20 +17,28 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <glog/logging.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <atomic>
 #include <memory>
+#include <ostream>
 #include <string>
 #include <utility>
+#include <vector>
 
-#include "gutil/macros.h" // for DISALLOW_COPY_AND_ASSIGN
+#include "common/status.h"
 #include "olap/lru_cache.h"
 #include "olap/olap_common.h" // for rowset id
-#include "olap/rowset/beta_rowset.h"
-#include "olap/tablet_schema.h"
+#include "olap/rowset/segment_v2/segment.h"
 #include "util/time.h"
 
 namespace doris {
 
 class SegmentCacheHandle;
+class BetaRowset;
 
 // SegmentLoader is used to load the Segment of BetaRowset.
 // An LRUCache is encapsulated inside it, which is used to cache the opened segments.
diff --git a/be/src/olap/short_key_index.cpp b/be/src/olap/short_key_index.cpp
index 19055b3b12..69622cee45 100644
--- a/be/src/olap/short_key_index.cpp
+++ b/be/src/olap/short_key_index.cpp
@@ -17,7 +17,9 @@
 
 #include "olap/short_key_index.h"
 
-#include <string>
+#include <gen_cpp/segment_v2.pb.h>
+
+#include <ostream>
 
 #include "gutil/strings/substitute.h"
 #include "util/coding.h"
diff --git a/be/src/olap/short_key_index.h b/be/src/olap/short_key_index.h
index a217a928aa..a5ed018f72 100644
--- a/be/src/olap/short_key_index.h
+++ b/be/src/olap/short_key_index.h
@@ -17,14 +17,16 @@
 
 #pragma once
 
+#include <gen_cpp/segment_v2.pb.h>
+#include <glog/logging.h>
+#include <sys/types.h>
+
+#include <algorithm>
 #include <cstdint>
 #include <iterator>
-#include <string>
 #include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/segment_v2.pb.h"
-#include "util/debug_util.h"
 #include "util/faststring.h"
 #include "util/slice.h"
 
diff --git a/be/src/olap/skiplist.h b/be/src/olap/skiplist.h
index 5c4a2b40d6..477a3e1e12 100644
--- a/be/src/olap/skiplist.h
+++ b/be/src/olap/skiplist.h
@@ -26,10 +26,11 @@
 //
 // ... prev vs. next pointer ordering ...
 
+#include <gen_cpp/olap_file.pb.h>
+
 #include <atomic>
 
 #include "common/logging.h"
-#include "gen_cpp/olap_file.pb.h"
 #include "util/random.h"
 #include "vec/common/arena.h"
 
diff --git a/be/src/olap/snapshot_manager.cpp b/be/src/olap/snapshot_manager.cpp
index 687f76a0ec..cf498c0b7b 100644
--- a/be/src/olap/snapshot_manager.cpp
+++ b/be/src/olap/snapshot_manager.cpp
@@ -17,27 +17,44 @@
 
 #include "olap/snapshot_manager.h"
 
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
+#include <fmt/format.h>
+#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/Types_constants.h>
+#include <gen_cpp/olap_file.pb.h>
 #include <thrift/protocol/TDebugProtocol.h>
 
 #include <algorithm>
+#include <ctime>
 #include <filesystem>
-#include <iterator>
+#include <list>
 #include <map>
+#include <new>
+#include <ostream>
 #include <set>
+#include <shared_mutex>
+#include <unordered_map>
+#include <utility>
 
+#include "common/config.h"
+#include "common/logging.h"
 #include "common/status.h"
-#include "gen_cpp/Types_constants.h"
 #include "io/fs/local_file_system.h"
+#include "olap/data_dir.h"
+#include "olap/olap_common.h"
+#include "olap/olap_define.h"
 #include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_factory.h"
+#include "olap/rowset/rowset_meta.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 "olap/tablet_meta.h"
 #include "olap/tablet_schema.h"
+#include "olap/tablet_schema_cache.h"
+#include "olap/utils.h"
 #include "runtime/thread_context.h"
+#include "util/uid_util.h"
 
 using std::filesystem::path;
 using std::map;
diff --git a/be/src/olap/snapshot_manager.h b/be/src/olap/snapshot_manager.h
index 982bf36375..3536cebd1a 100644
--- a/be/src/olap/snapshot_manager.h
+++ b/be/src/olap/snapshot_manager.h
@@ -17,27 +17,23 @@
 
 #pragma once
 
-#include <condition_variable>
-#include <ctime>
-#include <list>
-#include <map>
+#include <stdint.h>
+
+#include <memory>
 #include <mutex>
-#include <set>
 #include <string>
-#include <thread>
 #include <vector>
 
 #include "common/status.h"
-#include "olap/data_dir.h"
-#include "olap/field.h"
-#include "olap/olap_common.h"
-#include "olap/olap_define.h"
-#include "olap/push_handler.h"
+#include "olap/rowset/rowset.h"
 #include "olap/tablet.h"
-#include "olap/tablet_meta_manager.h"
-#include "util/doris_metrics.h"
+#include "olap/tablet_schema.h"
+#include "runtime/memory/mem_tracker.h"
 
 namespace doris {
+class RowsetMetaPB;
+class TSnapshotRequest;
+struct RowsetId;
 
 class SnapshotManager {
 public:
diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp
index 154145d823..722220d301 100644
--- a/be/src/olap/storage_engine.cpp
+++ b/be/src/olap/storage_engine.cpp
@@ -17,44 +17,61 @@
 
 #include "olap/storage_engine.h"
 
+// IWYU pragma: no_include <bthread/errno.h>
+#include <errno.h> // IWYU pragma: keep
+#include <fmt/format.h>
+#include <gen_cpp/AgentService_types.h>
 #include <rapidjson/document.h>
-#include <signal.h>
-#include <sys/syscall.h>
+#include <rapidjson/encodings.h>
+#include <rapidjson/prettywriter.h>
+#include <rapidjson/stringbuffer.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/resource.h>
 #include <thrift/protocol/TDebugProtocol.h>
 
 #include <algorithm>
-#include <boost/algorithm/string.hpp>
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <boost/algorithm/string/trim.hpp>
-#include <cstdio>
+#include <boost/algorithm/string/case_conv.hpp>
+#include <boost/container/detail/std_fwd.hpp>
 #include <filesystem>
+#include <iterator>
+#include <list>
 #include <new>
-#include <queue>
+#include <ostream>
 #include <random>
 #include <set>
+#include <thread>
+#include <utility>
 
 #include "agent/task_worker_pool.h"
+#include "common/config.h"
+#include "common/logging.h"
+#include "gutil/strings/substitute.h"
 #include "io/fs/local_file_system.h"
 #include "olap/base_compaction.h"
 #include "olap/cumulative_compaction.h"
 #include "olap/data_dir.h"
-#include "olap/lru_cache.h"
 #include "olap/memtable_flush_executor.h"
-#include "olap/push_handler.h"
-#include "olap/reader.h"
+#include "olap/olap_define.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/rowset/rowset_meta_manager.h"
 #include "olap/rowset/unique_rowset_id_generator.h"
-#include "olap/schema_change.h"
 #include "olap/segment_loader.h"
+#include "olap/tablet_manager.h"
 #include "olap/tablet_meta.h"
-#include "olap/tablet_meta_manager.h"
-#include "olap/utils.h"
+#include "olap/task/engine_task.h"
+#include "olap/txn_manager.h"
+#include "runtime/memory/mem_tracker.h"
+#include "runtime/stream_load/stream_load_recorder.h"
 #include "util/doris_metrics.h"
-#include "util/pretty_printer.h"
-#include "util/scoped_cleanup.h"
-#include "util/time.h"
+#include "util/metrics.h"
+#include "util/priority_thread_pool.hpp"
+#include "util/spinlock.h"
+#include "util/stopwatch.hpp"
+#include "util/thread.h"
+#include "util/threadpool.h"
 #include "util/trace.h"
+#include "util/uid_util.h"
 
 using apache::thrift::ThriftDebugString;
 using std::filesystem::canonical;
@@ -69,7 +86,6 @@ using std::map;
 using std::nothrow;
 using std::pair;
 using std::set;
-using std::set_difference;
 using std::string;
 using std::stringstream;
 using std::vector;
diff --git a/be/src/olap/storage_engine.h b/be/src/olap/storage_engine.h
index db113f1d93..481353ec0d 100644
--- a/be/src/olap/storage_engine.h
+++ b/be/src/olap/storage_engine.h
@@ -17,48 +17,54 @@
 
 #pragma once
 
-#include <pthread.h>
-#include <rapidjson/document.h>
+#include <butil/macros.h>
+#include <gen_cpp/Types_types.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <stdint.h>
 
+#include <atomic>
 #include <condition_variable>
 #include <ctime>
-#include <list>
 #include <map>
+#include <memory>
 #include <mutex>
 #include <set>
 #include <string>
-#include <thread>
+#include <unordered_map>
+#include <unordered_set>
 #include <vector>
 
 #include "common/status.h"
-#include "gen_cpp/AgentService_types.h"
-#include "gen_cpp/BackendService_types.h"
-#include "gen_cpp/MasterService_types.h"
 #include "gutil/ref_counted.h"
 #include "olap/compaction_permit_limiter.h"
 #include "olap/olap_common.h"
-#include "olap/olap_define.h"
-#include "olap/olap_meta.h"
 #include "olap/options.h"
+#include "olap/rowset/rowset.h"
 #include "olap/rowset/rowset_id_generator.h"
-#include "olap/tablet_manager.h"
-#include "olap/task/engine_task.h"
-#include "olap/txn_manager.h"
+#include "olap/rowset/segment_v2/segment.h"
+#include "olap/tablet.h"
 #include "runtime/heartbeat_flags.h"
-#include "runtime/stream_load/stream_load_recorder.h"
 #include "util/countdown_latch.h"
-#include "util/thread.h"
-#include "util/threadpool.h"
 
 namespace doris {
 
 class DataDir;
 class EngineTask;
-class BlockManager;
 class MemTableFlushExecutor;
-class Tablet;
 class TaskWorkerPool;
 class BetaRowsetWriter;
+class BaseCompaction;
+class CumulativeCompaction;
+class CumulativeCompactionPolicy;
+class MemTracker;
+class PriorityThreadPool;
+class StreamLoadRecorder;
+class TCloneReq;
+class TCreateTabletReq;
+class TabletManager;
+class Thread;
+class ThreadPool;
+class TxnManager;
 
 using SegCompactionCandidates = std::vector<segment_v2::SegmentSharedPtr>;
 using SegCompactionCandidatesSharedPtr = std::shared_ptr<SegCompactionCandidates>;
diff --git a/be/src/olap/storage_policy.cpp b/be/src/olap/storage_policy.cpp
index 68f561397d..494c93cec1 100644
--- a/be/src/olap/storage_policy.cpp
+++ b/be/src/olap/storage_policy.cpp
@@ -17,6 +17,10 @@
 
 #include "olap/storage_policy.h"
 
+#include <glog/logging.h>
+
+#include <algorithm>
+#include <cstdlib>
 #include <mutex>
 #include <unordered_map>
 
diff --git a/be/src/olap/storage_policy.h b/be/src/olap/storage_policy.h
index 04f05540ae..0a566d1002 100644
--- a/be/src/olap/storage_policy.h
+++ b/be/src/olap/storage_policy.h
@@ -17,6 +17,15 @@
 
 #pragma once
 
+#include <fmt/format.h>
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "common/status.h"
 #include "io/fs/file_system.h"
 #include "io/fs/remote_file_system.h"
 
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 7603d6fbe7..96311c4c77 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -17,68 +17,113 @@
 
 #include "olap/tablet.h"
 
+#include <assert.h>
+#include <butil/logging.h>
 #include <bvar/reducer.h>
 #include <bvar/window.h>
-#include <ctype.h>
-#include <fmt/core.h>
-#include <glog/logging.h>
-#include <opentelemetry/common/threadlocal.h>
-#include <pthread.h>
+#include <fmt/format.h>
+#include <gen_cpp/FrontendService_types.h>
+#include <gen_cpp/MasterService_types.h>
+#include <gen_cpp/Metrics_types.h>
+#include <gen_cpp/olap_file.pb.h>
+#include <gen_cpp/types.pb.h>
+#include <rapidjson/document.h>
+#include <rapidjson/encodings.h>
 #include <rapidjson/prettywriter.h>
+#include <rapidjson/rapidjson.h>
 #include <rapidjson/stringbuffer.h>
-#include <stdio.h>
-#include <sys/stat.h>
+#include <stdlib.h>
+#include <time.h>
 
 #include <algorithm>
 #include <atomic>
-#include <cstdint>
+#include <boost/container/detail/std_fwd.hpp>
+#include <roaring/roaring.hh>
+
+// IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
+#include "common/compiler_util.h" // IWYU pragma: keep
+// IWYU pragma: no_include <bits/chrono.h>
+#include <chrono> // IWYU pragma: keep
+#include <filesystem>
+#include <iterator>
+#include <limits>
 #include <map>
 #include <memory>
 #include <mutex>
 #include <set>
 #include <shared_mutex>
 #include <string>
+#include <tuple>
+#include <type_traits>
 #include <unordered_set>
 
 #include "agent/utils.h"
 #include "common/config.h"
+#include "common/consts.h"
 #include "common/logging.h"
 #include "common/status.h"
+#include "gutil/ref_counted.h"
 #include "gutil/strings/stringpiece.h"
+#include "gutil/strings/substitute.h"
+#include "io/fs/file_reader.h"
+#include "io/fs/file_reader_writer_fwd.h"
+#include "io/fs/file_system.h"
+#include "io/fs/file_writer.h"
 #include "io/fs/path.h"
 #include "io/fs/remote_file_system.h"
 #include "olap/base_compaction.h"
 #include "olap/base_tablet.h"
 #include "olap/cumulative_compaction.h"
+#include "olap/cumulative_compaction_policy.h"
 #include "olap/olap_common.h"
 #include "olap/olap_define.h"
-#include "olap/reader.h"
-#include "olap/row_cursor.h"
+#include "olap/olap_meta.h"
+#include "olap/primary_key_index.h"
+#include "olap/rowid_conversion.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/rowset_meta_manager.h"
+#include "olap/rowset/rowset_writer.h"
+#include "olap/rowset/rowset_writer_context.h"
 #include "olap/rowset/segment_v2/column_reader.h"
+#include "olap/rowset/segment_v2/common.h"
+#include "olap/rowset/segment_v2/indexed_column_reader.h"
 #include "olap/schema_change.h"
 #include "olap/storage_engine.h"
 #include "olap/storage_policy.h"
+#include "olap/tablet_manager.h"
 #include "olap/tablet_meta.h"
-#include "olap/tablet_meta_manager.h"
 #include "olap/tablet_schema.h"
 #include "olap/txn_manager.h"
+#include "olap/types.h"
+#include "olap/utils.h"
 #include "segment_loader.h"
 #include "service/point_query_executor.h"
 #include "util/defer_op.h"
-#include "util/path_util.h"
+#include "util/doris_metrics.h"
 #include "util/pretty_printer.h"
 #include "util/scoped_cleanup.h"
+#include "util/stopwatch.hpp"
+#include "util/threadpool.h"
 #include "util/time.h"
 #include "util/trace.h"
 #include "util/uid_util.h"
+#include "vec/columns/column.h"
+#include "vec/columns/column_string.h"
+#include "vec/common/string_ref.h"
+#include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/jsonb/serialize.h"
 
 namespace doris {
+class TupleDescriptor;
+
+namespace vectorized {
+class Block;
+} // namespace vectorized
+
 using namespace ErrorCode;
 
 using std::pair;
diff --git a/be/src/olap/tablet.h b/be/src/olap/tablet.h
index faa5a5c8e0..1fa6d1bc7f 100644
--- a/be/src/olap/tablet.h
+++ b/be/src/olap/tablet.h
@@ -17,48 +17,66 @@
 
 #pragma once
 
+#include <butil/macros.h>
+#include <glog/logging.h>
+#include <stddef.h>
+#include <stdint.h>
+
 #include <atomic>
 #include <functional>
+#include <list>
+#include <map>
 #include <memory>
 #include <mutex>
+#include <ostream>
 #include <set>
 #include <shared_mutex>
 #include <string>
 #include <unordered_map>
-#include <unordered_set>
+#include <utility>
 #include <vector>
 
-#include "gen_cpp/AgentService_types.h"
-#include "gen_cpp/MasterService_types.h"
-#include "gen_cpp/olap_file.pb.h"
-#include "io/fs/file_system.h"
+#include "common/config.h"
+#include "common/status.h"
 #include "olap/base_tablet.h"
-#include "olap/cumulative_compaction_policy.h"
 #include "olap/data_dir.h"
 #include "olap/olap_common.h"
-#include "olap/olap_define.h"
-#include "olap/olap_tuple.h"
 #include "olap/rowset/rowset.h"
+#include "olap/rowset/rowset_meta.h"
 #include "olap/rowset/rowset_reader.h"
 #include "olap/rowset/rowset_tree.h"
 #include "olap/rowset/segment_v2/segment.h"
 #include "olap/tablet_meta.h"
-#include "olap/utils.h"
+#include "olap/tablet_schema.h"
 #include "olap/version_graph.h"
+#include "util/metrics.h"
 #include "util/once.h"
+#include "util/slice.h"
 
 namespace doris {
 
-class DataDir;
 class Tablet;
-class TabletMeta;
 class CumulativeCompactionPolicy;
... 28516 lines suppressed ...


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