github-actions[bot] commented on code in PR #67896:
URL: https://github.com/apache/doris/pull/67896#discussion_r4001766990
##########
be/src/exprs/vcase_expr.h:
##########
@@ -249,12 +249,22 @@ class VCaseExpr final : public VExpr {
then_columns[i].get())
->get_data()
.data();
- if constexpr (std::is_same_v<ColumnType, ColumnDate> ||
- std::is_same_v<ColumnType, ColumnDateTime> ||
- std::is_same_v<ColumnType, ColumnDateV2> ||
- std::is_same_v<ColumnType, ColumnDateTimeV2> ||
- std::is_same_v<ColumnType, ColumnTimeStampNs> ||
- std::is_same_v<ColumnType, ColumnTimeStampTz>) {
+ if constexpr (std::is_same_v<ColumnType, ColumnFloat32> ||
+ std::is_same_v<ColumnType, ColumnFloat64>) {
+ // Arithmetic masking propagates unselected NaN/Infinity and
loses signed zero.
+ // Conditional stores also let the compiler vectorize without
loading from a
+ // selected source/destination pointer, as a ternary
assignment can do.
+ for (size_t row_idx = 0; row_idx < rows_count; row_idx++) {
+ if (then_idx[row_idx] == i) {
Review Comment:
[P2] Skip the redundant FLOAT/DOUBLE zero-fill
The new floating-point branch loop overwrites every output row exactly once,
so the unconditional default-value pass just above it is now redundant.
`PODArray::resize()` only reserves storage and advances the end pointer, while
`_execute_impl` assigns every row either the real ELSE index 0 or one compact
WHEN index. Keeping the old accumulator initialization adds another O(rows)
memory-write traversal to this hot path, especially for few-branch CASE
expressions. Please skip that initialization for the FLOAT/DOUBLE
specialization while retaining it for paths that actually read or accumulate
the prior result value.
--
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]