2016-11-08 74 views
0

我想從表中選擇count(*),但是在提交作業後它會卡住。 PFB的細節。Hive沒有啓動mapreduce作業..在執行過程中卡住

hive> select count(*) from txnrecords; 
WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases. 
Query ID = sambit_20161108115544_170f01cb-5825-4af1-8607-d25ceb84823b 
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> 
Starting Job = job_1478581699153_0005, Tracking URL = http://localhost:8088/proxy/application_1478581699153_0005/ 
Kill Command = /home/sambit/hadoop-2.7.3/bin/hadoop job -kill job_1478581699153_0005 

注:(選擇txnrecords *;),如下工作正常。

hive> select * from txnrecords; 
OK 
0 06-26-2011 4007024 40.33 Exercise & Fitness Cardio Machine Accessories Clarksville Tennessee credit 
1 06-26-2011 4006742 198.44 Exercise & Fitness Weightlifting Gloves Long Beach California credit 
2 06-26-2011 4009775 5.58 Exercise & Fitness Weightlifting Machine Accessories Anaheim California credit 
3 06-26-2011 4002199 198.19 Gymnastics Gymnastics Rings Milwaukee Wisconsin credit 
4 12-17-2011 4002613 98.81 Team Sports Field Hockey Nashville Tennessee credit 
5 12-17-2011 4007591 193.63 Outdoor Recreation Camping & Backpacking & Hiking Chicago Illinois credit 
6 12-17-2011 4002190 27.89 Puzzles Jigsaw Puzzles Charleston South Carolina credit 
7 12-17-2011 4002964 96.01 Outdoor Play Equipment Sandboxes Columbus Ohio credit 
8 12-18-2011 4007361 10.44 Winter Sports Snowmobiling Des Moines Iowa credit 
9 12-18-2011 4004798 152.46 Jumping Bungee Jumping St. Petersburg Florida cash 
10 12-18-2011 4004646 180.28 Outdoor Recreation Archery Reno Nevada cash 
NULL NULL NULL NULL NULL NULL NULL NULL NULL 
Time taken: 0.227 seconds, Fetched: 12 row(s) 

Queue Details

+0

這可能是紗線配置問題。沒有足夠的資源來運行這項工作。 –

+0

訪問跟蹤URL = http:// localhost:8088/proxy/application_1478581699153_0005 /,檢查作業是否在正確的JOB_QUEUE。 –

+0

@SathiyanS ..你能告訴我如何設置。謝謝。 –

回答

0

「SELECT * FROM」 作品不同於 「SELECT COUNT(*)」,最後一個做更多的事情。所以不要指望這一點。 根據我的經驗,這個問題是由於在表列定義中使用了一個保留關鍵字,如果是這樣,那麼進入容器日誌就會出現如下錯誤消息:ParseException。 Mike Gan的建議是您擁有的最佳選擇。執行

yarn logs -applicationId <yourApplicationIdFromHive> 

獲取容器的日誌。

+0

當我嘗試查看該作業的詳細信息時,我收到以下「總分配容器:0」..可否請您提出任何建議來解決此問題。 –

+0

SELECT * FROM txnrecords ORDER BY <在這裏添加一個字段>工作嗎? – ozw1z5rd