This is a known issue and we have an internal JIRA to track it. Current there is no better way to improve the performance.

You can, however, to increase the timeout limit via "hive.metastore.client.socket.timeout", and set it to long time value (in seconds) to allow the query to finish. It should finish eventually, but might take sometime.

Our engineers are still discussing internally to see the best fix for the issue, however, it is on going and we do not have solution yet at this stage.