hive使用窗口函数报错FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

输入下面的语句SELECT cookieid, createtime, pv, RANK() OVER(PARTITION BY cookieid ORDER BY pv desc) AS rn1, DENSE_RANK() OVER(PARTITION BY cookieid ORDER BY pv desc) AS rn2, ROW_NUMBER() OVER(PARTITION BY cookieid ORDER BY pv DESC) AS rn3 FROM test_rank WHERE cookieid = 'cookie1';
发现报下面的错误

Error during job, obtaining debugging information…
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

解决方案:
在hive连接时开启智能本地模型SET hive.exec.mode.local.auto=true;

在执行上面的命令就成功了。

你可能感兴趣的:(hive)