fix the distinct with AVG optimization, decide to adds DISTINCT at the top level of the plan to simplify all the work; Still need to optimize the EE to have the consistent order as the input for special GROUP BY without aggregations