HIVE-3552. performant manner for performing cubes/rollups/grouping sets for a high number of grouping set keys.

git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1430979 13f79535-47bb-0310-9956-ffa450edef68