Found the solution. The query failing on size of output was a major hint.
The following set command issued before an “insert overwrite directory …” command will resolve the problem for files up to around a terabyte in size.
SET hive.exec.copyfile.maxsize=1073741824;