Fix the distinct pushed down for subquery