Skip to content

[refine](code) remove dead code across core types and utilities #63307

Open
Mryange wants to merge 3 commits into
apache:branch-4.1from
Mryange:branch-4.1-pick-62994
Open

[refine](code) remove dead code across core types and utilities #63307
Mryange wants to merge 3 commits into
apache:branch-4.1from
Mryange:branch-4.1-pick-62994

Conversation

@Mryange
Copy link
Copy Markdown
Contributor

@Mryange Mryange commented May 15, 2026

What problem does this PR solve?

#62994

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

Mryange added 3 commits May 15, 2026 17:44
…che#62994)

This PR cleans up dead code accumulated across BE core files — unused
unions, methods, type
traits, free functions, forward declarations, and includes that are
never referenced in the
  codebase. Specific removals include:

- binary_cast.hpp: 5 unreferenced type-punning unions (TypeConverter,
DecimalInt128Union,
  VecDateTimeInt64Union, DateV2UInt32Union, DateTimeV2UInt64Union)
- block.cpp/h: unused columns_bytes() and clone_with_columns() methods,
plus stale includes
(sys/types.h, iterator, config.h)
- string_ref.cpp/h: unused single-char start_with/end_with overloads and
the
min_string_val/max_string_val/MIN_CHAR/MAX_CHAR scaffolding that served
type_limit
  specializations
- type_limit.h: type_limit<StringRef> and type_limit<std::string>
specializations that depended
on the removed string_ref helpers
- number_traits.h: 6 unused type-trait structs
(ResultOfAdditionMultiplication,
ResultOfSubtraction, ResultOfFloatingPointDivision,
ResultOfIntegerDivision, ResultOfModulo,
  ResultOfBit, BinaryOperatorTraits) and stale includes
- column_variant.cpp/h: unused get_last_field() and is_doc_mode()
methods
- nested_utils.cpp/h: unused extract_table_name() and declaration of
validate_array_sizes()
- map_value.cpp, struct_value.cpp: entire files deleted — each contained
only a single unused
shallow_copy method
- call_on_type_index.h: stale forward declaration of DataTypeEnum
- data_type_array_serde.h: stale forward declaration of JsonWriter
- function_array_enumerate_uniq.cpp, cgroup_util.cpp: added missing
transitive includes exposed
after dead-code removal (column_decimal.h, boost/algorithm/string.hpp)

Corresponding tests that exercised only the deleted functions were also
removed (block_test.cpp,
column_variant_test.cpp, data_type_serde_test.cpp,
variant_util_test.cpp).

(cherry picked from commit accd8a0)
@Mryange Mryange requested a review from yiguolei as a code owner May 15, 2026 13:50
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Mryange
Copy link
Copy Markdown
Contributor Author

Mryange commented May 15, 2026

run buildall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants