Revert "distinct"

This reverts commit e431b576f7ed0d1a8e1759a63920979d01ceb31e.
Revert "distinct"

This reverts commit 661bae43d223fd7512d2b171569d40c167173185.
 HIVE-4927