在windows的hive/hadoop上选择count(*)失败

h7wcgrx3  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(434)

hive> select count(*) from test_db.cust; ```
Query ID = EMMAdmin_20200106222630_32064e30-7ae6-4e0a-bf1b-b0979e297102
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
set hive.exec.reducers.bytes.per.reducer=
In order to limit the maximum number of reducers:
set hive.exec.reducers.max=
In order to set a constant number of reducers:
set mapreduce.job.reduces=

Kill Command = C:\hadoop-2.10.0\bin\mapred job -kill job_1578366054556_0003
Hadoop job information for Stage-1: number of mappers: 0; number of reducers: 0
2020-01-06 22:26:40,010 Stage-1 map = 0%, reduce = 0%
Ended Job = job_1578366054556_0003 with errors
Error during job, obtaining debugging information...
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched:
Stage-Stage-1: HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec
hive>

hadoop管理错误:

Application application_1578366054556_0001 failed 2 times due to AM Container for appattempt_1578366054556_0001_000002 exited with exitCode: -1
Failing this attempt.Diagnostics:
[2020-01-06 22:08:40.708]The command line has a length of 12995 exceeds maximum allowed length of 8191. Command starts with: "@set HADOOP_CLASSPATH=%PWD%;job.jar/;job.jar/classes/;job.jar/lib/;%PWD%/*;C:\apache-hive-3.0.0-bi "

正常的select查询工作正常 `hive> select country from test_db.cust where first_name like 'S%';` ```
OK
USA
USA
USA
USA
USA
USA
USA
USA
Time taken: 0.229 seconds, Fetched: 8 row(s)
hive>

在此处输入图像描述

nnsrf1az

nnsrf1az1#

问题出在指挥官身上。
为了将结果输出到文件中,可以使用下一个语法:

hive -e "your query" > ~/sample_output.txt

相关问题