github-actions[bot] commented on code in PR #68136:
URL: https://github.com/apache/doris/pull/68136#discussion_r4035872365
##########
be/src/exprs/aggregate/aggregate_function_simple_factory.h:
##########
@@ -144,18 +144,19 @@ class AggregateFunctionSimpleFactory {
}
}
- if (nullable) {
- return nullable_aggregate_functions.find(name_str) ==
nullable_aggregate_functions.end()
- ? nullptr
- : nullable_aggregate_functions[name_str](name_str,
argument_types,
-
result_type, result_is_nullable,
- attr);
- } else {
- return aggregate_functions.find(name_str) ==
aggregate_functions.end()
- ? nullptr
- : aggregate_functions[name_str](name_str,
argument_types, result_type,
- result_is_nullable,
attr);
+ const auto& functions = nullable ? nullable_aggregate_functions :
aggregate_functions;
+ auto function_iter = functions.find(name_str);
+ if (function_iter == functions.end()) {
+ return nullptr;
+ }
+
+ auto function = function_iter->second(name_str, argument_types,
result_type,
+ result_is_nullable, attr);
+ if (function != nullptr) {
+ DCHECK_LE(function->align_of_data(), 16)
Review Comment:
[P2] Keep this invariant active in Release
This guards a real storage precondition, not debug-only bookkeeping. Release
adds `-DNDEBUG`, so `DCHECK_LE` disappears there; a future `alignas(32)`
factory result can then reach a fixed/default-aligned consumer—for example,
grouped aggregation placement-constructs states in raw Arena-backed
`AggregateDataContainer` slabs whose base is only ordinarily 16-byte aligned.
Factory creation is not a row hot path, and `common/check.h` reserves
`DORIS_CHECK_*` for invariants required in Release. Please enforce this with
`DORIS_CHECK_LE` (and ideally a synthetic over-aligned factory test) so shipped
builds reject the state before allocation.
--
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]