Mryange opened a new pull request, #62153:
URL: https://github.com/apache/doris/pull/62153
### What problem does this PR solve?
Problem Summary:
In the Nereids optimizer, the FE guarantees full consistency between output
slot
nullability and expression nullability. Three legacy runtime patches in BE
operators
that compensated for old-planner inconsistencies are now dead code:
- **Pattern A – `_make_nullable_keys`** in `AggSinkOperatorX`,
`StreamingAggOperatorX`,
`DistinctStreamingAggOperatorX`: detected mismatches between group-by key
output slots
and probe expr nullability, then wrapped columns with `make_nullable` at
runtime.
In Nereids both sides derive from the same `e.nullable()`, so the list is
always empty.
- **Pattern B – `_change_to_nullable_flags`** in `AnalyticSinkOperatorX`:
wrapped window
function results with `make_nullable` when output slot was nullable but
`AggFnEvaluator::data_type()` was not. In Nereids,
`ExtractAndNormalizeWindowExpression`
calls `withAlwaysNullable(true)` on every `NullableAggregateFunction` in
window context,
making `_data_type` nullable, so the condition is always false.
This PR removes all the dead code for Pattern A and B, and adds a
`DCHECK(false)` to
the nullable-promotion branch in `OperatorXBase::do_projections` (Pattern I)
to catch
any regression.
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] 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 <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]