Hive抛出聚合函数错误

时间:2017-11-20 17:46:42

标签: apache hive hadoop2 hue

当我尝试使用Hive执行非聚合命令时,查询似乎工作正常,如下所示:

从airlines_analysis.airline中选择*; 从airlines_analysis.airline选择airline.month;

但是当我执行Aggregate命令时,如下所示:

从airlines_analysis.airline选择计数(distinct uniquecarrier);

我面对以下问题:

org.apache.hive.service.cli.HiveSQLException:处理语句时出错:FAILED:执行错误,从org.apache.hive的org.apache.hadoop.hive.ql.exec.tez.TezTask返回代码1位于org.apache.hive.service.cli的org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:257)的.service.cli.operation.Operation.toSQLException(Operation.java:380) .operation.SQLOperation.access $ 800(SQLOperation.java:91)atg.apache.hive.service.cli.operation.SQLOperation $ BackgroundWork $ 1.run(SQLOperation.java:348)at java.security.AccessController.doPrivileged(Native方法)位于org.apache.hive.service.cli.operation的org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1698)的javax.security.auth.Subject.doAs(Subject.java:422) 。javaOperation $ BackgroundWork.run(SQLOperation.java:362)at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at at java.util.concurrent.ThreadPoolExec utor.runWorker(ThreadPoolExecutor.java:1149)java.lang.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)java.lang.Thread.run(Thread.java:748)

1 个答案:

答案 0 :(得分:0)

这是哪个版本的Hive? 你在使用Tez引擎吗?在处理大量数据集时,Tez有时表现得很奇怪。试试这个

set hive.execution.engine=mr;
select count(distinct uniquecarrier) from airlines_analysis.airline;