asolimando commented on code in PR #4681:
URL: https://github.com/apache/calcite/pull/4681#discussion_r2613568233


##########
core/src/main/java/org/apache/calcite/sql/SqlAggFunction.java:
##########
@@ -212,6 +212,22 @@ public boolean allowsNullTreatment() {
     return false;
   }
 
+  /** Returns whether this aggregate function skips NULL input values.
+   *
+   * <p>Standard SQL aggregate functions skip NULL input values:
+   * {@code SUM}, {@code AVG}, {@code MIN}, {@code MAX}, {@code COUNT}, etc.
+   *
+   * <p>Custom user-defined aggregate functions may treat NULL values as
+   * semantically significant inputs. Such functions should override this
+   * method to return {@code false}.
+   *
+   * @return true if NULL input values are skipped (standard SQL behavior),
+   *         false if NULL input values have semantic significance
+   */
+  public boolean skipsNullInputs() {

Review Comment:
   Your raise a fair point, there is a concrete risk that people might forget 
to override this value, but I don't see how to have the change fully backward 
compatible as of now, and force people to pick a value.
   
   My general take is that, unless strictly needed, we should always strive to 
keep backward compatibility, because Calcite is a library/framework a lot of 
systems depend on, breaking changes have a serious blast radius.



-- 
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]

Reply via email to