Can you post a portion of the log for the failure if you have access to it?
It will give an insight into what the issue might be.
Also, why I don't expect a difference in behaviour, can you try running the same script with hive1 cli using hive -f <filename> and confirm that the behaviour is the same.
Finally, can you confirm the properties that you are setting in the hql file to be sure that they are not affecting the performance of hive run?
Awaiting your response.