Add more QUERY pattern tests for DISTINCT with GROUP BY