apply HIVE-4000 to branch hive-0.9.0