Sort of related... Many aggregation functions (AVG, COUNT, ...) accept whether they should be DISTINCT. However, the generic SqmFunctionTemplate contract does not support that. To support this I propose that we add a marker interface that these resolved {{SqmExpression}}s can implement to get that info:
interface Distinctable {
void makeDistinct();
}
WDYT? FWIW the built-in SqmExpression for these already support that because we pass it in via ctor. But even those I would suggest changing to use this so that it is consistent in the SQM producer no matter how we generate them - via registered template or via "inherent understanding". |