beyond the ‘PHYSICAL‘ memory limit. Current usage: 1.0 GB of 1 GB physical memory used;

腾讯云 hive3.1.1版本执行HQL时报如下错误

报错信息:

Error while processing statement: FAILED: Execution Error, return code 2 
from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, beyond the 'PHYSICAL' memory limit. Current usage: 1.0 GB of 1 GB physical memory used; 
2.8 GB of 8 GB virtual memory used. Killing container. 

解释:

  1. org.apache.hadoop.hive.ql.exec.tez.TezTask 说明Hive的底层用的是Tez的引擎不是MapReduce的引擎。
  2. 1.0 GB of 1 GB physical memory used 说明分配这个job的物理内存用完了,内存溢出,因此任务被kill掉了。
  3. 解决办法:增大container的大小,在hive-site.xml中有个参数 hive.tez.container.size 默认为1024M,将其设置为2048M,保存,重启服务,重新运行代码。