Please use below to command to leave from the safe mode


bin/hadoop dfsadmin -safemode leave 

After that execute any command in hive and let us know if you face any issue.