Skip to content

Conversation

@BiteTheDDDDt
Copy link
Contributor

What problem does this PR solve?

This pull request introduces additional validation checks to ensure the integrity of column sizes during projection and expression evaluation operations. These changes help catch and report inconsistencies early, improving the robustness and debuggability of the code.

Validation and Error Handling Improvements:

  • Added checks in OperatorXBase::do_projections to return an internal error if any intermediate projection is empty, or if the result column size does not match the expected number of input rows, including detailed error messages for easier debugging.
  • Added validation after all intermediate projections to ensure the final input block row count matches the original, returning an error if not.
  • Added a check in the main projection loop of OperatorXBase::do_projections to verify that the result column size matches the input, with error reporting including the expression's debug string.
  • Updated VCaseExpr::execute_column to return an internal error if the result column size does not match the expected count, replacing the previous debug assertion with a runtime check and descriptive error message.

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

Copilot AI review requested due to automatic review settings January 30, 2026 08:36
@BiteTheDDDDt
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
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?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds runtime validation checks to catch column size inconsistencies during projection and expression evaluation operations. The changes replace some debug assertions (DCHECK) with runtime error checks that return InternalError status with descriptive messages.

Changes:

  • Converted DCHECK to runtime error check in VCaseExpr::execute_column for result column size validation
  • Added empty projection validation in OperatorXBase::do_projections
  • Added column size validation for intermediate projections with expression debug info
  • Added validation after intermediate projections to ensure row count consistency

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
be/src/vec/exprs/vcase_expr.cpp Replaced DCHECK_EQ with runtime check for case expression result column size validation
be/src/pipeline/exec/operator.cpp Added multiple runtime checks for projection operations: empty projection detection, intermediate projection column size validation, and final row count verification

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 7.41% (2/27) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.52% (19285/36716)
Line Coverage 36.00% (179201/497806)
Region Coverage 32.41% (138979/428829)
Branch Coverage 33.36% (60142/180277)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 18.52% (5/27) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.56% (25754/35991)
Line Coverage 54.23% (269307/496629)
Region Coverage 51.91% (224904/433239)
Branch Coverage 53.25% (96394/181009)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 18.52% (5/27) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.55% (25753/35991)
Line Coverage 54.22% (269295/496629)
Region Coverage 51.92% (224951/433239)
Branch Coverage 53.26% (96399/181009)

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