Mryange opened a new pull request, #61678:
URL: https://github.com/apache/doris/pull/61678
### What problem does this PR solve?
1. Expensive per-element operations (e.g. geo functions, complex string ops):
Use ColumnView freely — its overhead is negligible relative to the work.
2. Cheap per-element operations that the compiler can inline (e.g. simple
arithmetic):
a) Inputs are NOT nullable (e.g. the function framework already strips
nullable):
Safe to use. The compiler optimizes the is_const branch into code
equivalent
to hand-written direct array access (verified via assembly and
benchmarks).
b) Inputs involve nullable columns:
- Unary operations: safe to use, the compiler still optimizes
effectively.
- Binary / ternary operations: the combined is_null_at checks across
multiple
columns inhibit compiler vectorization and branch optimization,
causing
significant regression (~1.4x for binary, ~1.8x for ternary in
benchmarks).
In this case, hand-written column access is recommended for best
performance.
In summary, ColumnView is designed to eliminate the combinatorial explosion
of
handling 4 column forms. It is suitable for the vast majority of use cases.
Only the specific combination of "cheap computation + nullable +
multi-column"
requires weighing whether to hand-write the access code.
### 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]