sollhui opened a new pull request, #69660:
URL: https://github.com/apache/doris/pull/69660
### What problem does this PR solve?
Group commit scans inherit `ScanOperatorX::get_block_after_projects()`,
which skips operator projections because ordinary scans already evaluate them
in `Scanner`. `GroupCommitOperatorX` instead dequeues producer blocks directly
and never runs a Scanner. Its downstream row descriptor can therefore describe
projected columns while the returned block still has the producer's layout.
For example, a queued block containing `[base columns, mv_int, mv_string]`
can be consumed using a projection descriptor for `[base columns, mv_string,
mv_int]`, causing a bad cast or incorrect values. Intermediate projections can
also be skipped.
Override the group commit scan entry point to call
`OperatorXBase::get_block_after_projects()`. This applies the consumer's
intermediate and final projections and preserves the existing no-projection,
empty-block, error propagation, and output-counter behavior. Ordinary scans are
unchanged.
### Release note
Fix group commit inserts into tables with synchronous materialized views
failing with column type mismatches or producing incorrect MV values when
consumer projections differ from the queued block layout.
### Check List (For Author)
- Test:
- [x] Unit Test added: `GroupCommitScanOperatorTest` covers reordered MV
columns, nullable values, intermediate projections, repeated blocks and EOS,
no-projection forwarding, and queue errors.
- [x] Regression test added: `group_commit_mv_projection` inserts with
sync group commit into a table with two aliased MVs and compares each physical
MV index with aggregation over the base index.
- Validation passed: clang-format 16 check,
`build-support/check-build-hygiene.sh`, and `git diff --check`.
- Execution pending: both `run-be-ut.sh --run
--filter='GroupCommitScanOperatorTest.*' -j4` and `run-regression-test.sh --run
-d insert_p0 -s group_commit_mv_projection` were attempted, but environment
initialization failed because the local JDK 17 cannot start (`Failed setting
boot class path`). Neither test suite was executed locally; BE compilation and
clang-tidy are also unverified.
- Behavior changed:
- [x] Yes. Group commit scans execute the projections specified by their
consumer plan.
- Does this need documentation?
- [x] No.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]