I think CUME_DIST() and PERCENT_RANK() for example, should return floating point, since generally their return values are less than or equal to 1 (I looked at Oracle and MS SqlServer, and they both return fractional values and 1 for these functions). I changed the other functions (e.g. NTILE/RANK/DENSE_RANK) to return BIGINT rather than INT. For example, MS SqlServer returns BIGINT for NTILE/RANK/DENSE_RANK functions.
I didn't think they were controversial since I don't think CUME_DIST() should return integers, otherwise all the values would be zero. But perhaps somebody is using that behavior somewhere. I can definitely add a way for users to specify return values of RANK functions as in
CALCITE-845. I would probably just allow two policies, one for CUME_DIST/PERCENT_RANK and another for NTILE/RANK/DENSE_RANK (with the default being the new behavior as in this patch). Do you think that makes sense?