Skip to content

[refine](exec) remove unnecessary materialize_block_inplace calls#62229

Closed
Mryange wants to merge 1 commit intoapache:masterfrom
Mryange:remove-some-materialize_block
Closed

[refine](exec) remove unnecessary materialize_block_inplace calls#62229
Mryange wants to merge 1 commit intoapache:masterfrom
Mryange:remove-some-materialize_block

Conversation

@Mryange
Copy link
Copy Markdown
Contributor

@Mryange Mryange commented Apr 8, 2026

What problem does this PR solve?

Remove three redundant materialize_block_inplace calls where const column handling is already covered by downstream logic.

1. set_sink_operator.cpp
_extract_build_column already checks is_column_const() and calls convert_to_full_column_if_const() for each expression result column. The preceding materialize_block_inplace on the raw input block is redundant.

2. vdata_stream_recvr.cpp
In the local exchange path, blocks are enqueued and consumed by downstream operators that handle const columns themselves. ColumnConst::allocated_bytes() correctly reports actual allocated memory, so memory tracking remains accurate without materialization.

3. multi_cast_data_stream_source.cpp
The output block enters the pipeline and is processed by downstream operators, which handle const columns through their own expression evaluation. No need to materialize here.

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

@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 8, 2026

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 Apr 8, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.00% (20115/37950)
Line Coverage 36.56% (189087/517241)
Region Coverage 32.83% (146775/447107)
Branch Coverage 33.94% (64233/189251)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 59.38% (19/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.19% (21256/37165)
Line Coverage 40.22% (207389/515659)
Region Coverage 36.51% (164758/451240)
Branch Coverage 37.47% (71128/189833)

@Mryange Mryange closed this Apr 13, 2026
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.

3 participants