Fix the sql coverage and add test sql coverage cases for materialized view
Fix bugs found from sql coverage: (1)join on different columns, (2) Distinct bug for mv partitioned tables