Merge pull request #267 from sundeepn/astrewritefix

AstRewrite for count distinct can cause unexpected issues with certain queries