Some tests for COUNT DISTINCT AST rewrite.