Hive count(*) query showing 100% for both Map and Reduce but not showing correct result

时间:2017-08-04 12:47:40

标签: hive mapreduce hiveql hadoop2

Here is the set of queries that I executed

hive> CREATE external TABLE IF NOT EXISTS hive_table5(id int, name 
string) row format delimited fields terminated by ',';
OK
Time taken: 0.128 seconds

hive> load data inpath 
'hdfs://localhost:54310/usr/hive/warehouse/hive_table4' into table 
hive_table5;
Loading data to table default.hive_table5
Table default.hive_table5 stats: [numFiles=1, totalSize=23]
OK
Time taken: 0.193 seconds

hive> select count(*) from hive_table5;
Query ID = hduser_20170804180531_0f533fc3-4ce5-44d2-9501-68f168115ae0
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=<number>
In order to limit the maximum number of reducers:
 set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
 set mapreduce.job.reduces=<number>
Job running in-process (local Hadoop)
2017-08-04 18:05:32,654 Stage-1 map = 100%,  reduce = 100%
Ended Job = job_local1227119137_0037
MapReduce Jobs Launched: 
Stage-Stage-1:  HDFS Read: 70974 HDFS Write: 104 SUCCESS
Total MapReduce CPU Time Spent: 0 msec
OK
0
Time taken: 1.255 seconds, Fetched: 1 row(s)
hive> 

It is showing both map and reduce jobs are completed 100%. But still it is giving result 0 in count(*) when there is 1 row loaded in the table.

0 个答案:

没有答案