AggregateJoinTransposeRule.EXTENDED can push down aggregate functions into the join.
For Distinct Count (and other distinct aggregate functions) this should not be performed the same way as for simple count, since distinct count is not a decomposable function. 
While this can be done in theory, by adding the distinct column to the list of groups in below aggregate, I want to fix the buggy behavior first, before trying to improve the existing rule.
 Dynamic Programming: The Next Step, M. Eich, G. Moerkotte (https://ub-madoc.bib.uni-mannheim.de/37228/1/main.pdf)
 Including Group-By in Query Optimization, S. Chaudhuri, K. Shim (https://pdfs.semanticscholar.org/3079/5447cec18753254edbbd7839f0afa58b2a39.pdf)
CALCITE-2249 AggregateJoinTransposeRule generates inequivalent nodes if Aggregate relNode contains distinct aggregate function.