IMPALA-847: Remove duplicate gby and agg exprs at the beginning of agg analysis.

The bug was that indexes into the agg tuple were computed incorrectly
for sum(distinct) or avg(distinct) because of duplicate group by exprs
that were removed in some places but not others.

Change-Id: I52c8ee4fbc8a09fd3204f5af47471e8c3af7d7e9
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1725
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Decimal analysis changes.

Change-Id: Ib7d6a6a7650cc9058ff1486fc7546ab66c698d46
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1646
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins