HIVE-7431: refine the patch