[refine](code) remove dead code across core types and utilities#62994
[refine](code) remove dead code across core types and utilities#62994Mryange wants to merge 2 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
939c37f to
b42a76b
Compare
|
run buildall |
b42a76b to
de64b1d
Compare
|
run buildall |
de64b1d to
9f7c8c9
Compare
|
run buildall |
|
run buildall |
|
run p0 |
|
/review |
There was a problem hiding this comment.
I found two blocking build/API regressions in this cleanup. The deleted helpers are still referenced by the benchmark target, and one removed Block method still has a public declaration without a definition.
Critical checkpoint conclusions:
- Goal/test proof: the goal is dead-code cleanup. It is only partially accomplished because references remain in active source/build paths; no test/build evidence is provided in the PR checklist.
- Scope: the change is mostly focused, but missed dependent benchmark/header cleanup.
- Concurrency/lifecycle/config/compatibility/data writes/transactions: not applicable; this is BE API/source cleanup only.
- Parallel paths: benchmark code and public headers are parallel consumers of the removed helpers and must be updated together.
- Testing: existing tests that only covered deleted APIs were removed, but there is no demonstrated BE build, BE UT, or benchmark build coverage; BUILD_BENCHMARK would catch one issue.
- Observability/performance: not applicable; no runtime behavior path is intentionally changed.
- User focus: no additional user-provided focus was present.
Please fix the stale references/declaration and run an appropriate BE build/test target before merge.
| #include "core/value/vdatetime_value.h" | ||
|
|
||
| namespace doris { | ||
| union TypeConverter { |
There was a problem hiding this comment.
Removing these union helpers breaks the benchmark target. be/benchmark/benchmark_main.cpp still includes binary_cast_benchmark.hpp, and that header's old_binary_cast() still references TypeConverter, VecDateTimeInt64Union, DateV2UInt32Union, DateTimeV2UInt64Union, and DecimalInt128Union. Since be/CMakeLists.txt builds this file when BUILD_BENCHMARK is enabled, -DBUILD_BENCHMARK=ON will no longer compile. Please either update/remove the benchmark's old implementation or keep local benchmark-only definitions.
| return res; | ||
| } | ||
|
|
||
| std::string Block::columns_bytes() const { |
There was a problem hiding this comment.
The implementation is removed, but be/src/core/block/block.h still declares std::string columns_bytes() const;. That leaves a public Block API with no definition, so any caller that includes the header and calls this method will fail at link time. Please remove the declaration as well, or keep the definition if the API should remain available.
What problem does this PR solve?
Issue Number: N/A
Problem Summary:
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:
VecDateTimeInt64Union, DateV2UInt32Union, DateTimeV2UInt64Union)
(sys/types.h, iterator, config.h)
min_string_val/max_string_val/MIN_CHAR/MAX_CHAR scaffolding that served type_limit
specializations
on the removed string_ref helpers
ResultOfSubtraction, ResultOfFloatingPointDivision, ResultOfIntegerDivision, ResultOfModulo,
ResultOfBit, BinaryOperatorTraits) and stale includes
shallow_copy method
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).
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)