HIVE-4501 HS2 memory leak - FileSystem objects in FileSystem.CACHE
HIVE-2416, Multiple distinct function to support hive.groupby.skewindata optimization
This is a rebase version of the original patch.