v.20.8Improvement

Conditional Aggregate Functions Handling NULLs When Missing Rows

Conditional aggregate functions (for example: avgIf, sumIf, maxIf) should return NULL when miss rows and use nullable arguments. #13964 (Winter Zhang).
Conditional aggregate functions like avgIf, sumIf, and maxIf now return NULL when there are missing rows and the arguments are nullable.

Why it matters

This feature fixes the behavior of conditional aggregate functions to correctly return NULL in cases where the input data is missing (e.g., no rows satisfy the condition) and the function arguments are nullable. It increases correctness and consistency when working with nullable data and conditional aggregation.

How to use it

Use conditional aggregate functions as usual (e.g., avgIf, sumIf). When your data contains nullable columns and some rows are missing, these functions will automatically return NULL without requiring any special configuration.