v.20.9Improvement

Conditional Aggregate Functions Should Return NULL for Missing Rows with Nullable Arguments

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 when using nullable arguments.

Why it matters

This feature addresses the issue where conditional aggregate functions did not return NULL in cases of missing rows or when nullable arguments were used. It ensures that the result correctly reflects the absence of data, improving the accuracy and predictability of aggregate query results.

How to use it

Users can rely on conditional aggregate functions such as avgIf, sumIf, and maxIf as usual. When the input data has missing rows or nullable values, these functions will automatically return NULL without additional configuration.