More efficient query to avoid OutOfMemoryError in Hive More efficient query to avoid OutOfMemoryError in Hive hadoop hadoop