HIVE-6192 : Optimize sum(1) to answer query using metadata (Ashutosh Chauhan via Thejas Nair)

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