first part of generating summary from hive