Hello developers, CALCITE-845 <https://issues.apache.org/jira/browse/CALCITE-845> allows to add a customizable policy to define the return type of the SUM function. The SQL standard also allows for the return types of COUNT, AVG, and EXTRACT functions (and maybe others) to be implementation-defined. The standard only specifies the return type's SqlTypeFamily (EXACT NUMERIC in this case).
How should Calcite allow for customizable return types for functions in general? Like SUM's policy, should there be more deriveXXXType() methods in the RelDataTypeSystem class? Thank you, Sudheesh
