Hive - 选择计数(*)不与Tez一起使用,但与MR

时间:2018-03-27 03:38:43

标签: hadoop hive mapreduce hiveql tez

我有一个带有镶木地板数据的Hive外部表。

当我运行select count(*) from table1时,它会因Tez而失败。

但是当执行引擎更改为MR时,它可以工作。知道为什么它与Tez失败了吗?我在Tez中收到以下错误:

  

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

1 个答案:

答案 0 :(得分:0)

您必须将tez.tar.gz文件放在hdfs上。我想你可能会错过这一步。

在hdfs上创建一个apps文件夹

hdfs dfs -mkdir -p /hadoop/apps/tez/

放入tez.tar.gz文件

hdfs dfs -put /usr/hadoop/tez/lib/tez.tar.gz /hadoop/apps/tez/

授予该文件夹和tar

的权限
hdfs dfs -chown -R $HDFS_USER:$HADOOP_USER /hadoop
hdfs dfs -chmod -R 555 /hadoop/apps/tez
hdfs dfs -chmod -R 444 /hadoop/apps/tez/tez.tar.gz