2014-03-28 40 views
3

這是繼續問題 Integrating Hbase with Hive: Register Hbase table帶WHERE子句的查詢不起作用

我在查詢Hive的外部Hbase表。

當我做一個簡單的查詢

select * from Document_Table_Hive 

的查詢工作,我得到存儲在表中的記錄。

但是當我用where子句進行查詢時。這是行不通的。

hive> select * from Document_Table_Hive where key = "news-9630"; 
Total MapReduce jobs = 1 
Launching Job 1 out of 1 
Number of reduce tasks is set to 0 since there's no reduce operator 
Starting Job = job_1395999255539_0006, Tracking URL = http://sandbox.hortonworks.com:8088/proxy/application_1395999255539_0006/ 
Kill Command = /usr/lib/hadoop/bin/hadoop job -kill job_1395999255539_0006 
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0 
2014-03-28 04:00:19,441 Stage-1 map = 0%, reduce = 0% 
2014-03-28 04:01:01,873 Stage-1 map = 100%, reduce = 0% 
Ended Job = job_1395999255539_0006 with errors 
Error during job, obtaining debugging information... 
Examining task ID: task_1395999255539_0006_m_000000 (and more) from job job_1395999255539_0006 

Task with the most failures(4): 
----- 
Task ID: 
    task_1395999255539_0006_m_000000 

URL: 
    http://sandbox.hortonworks.com:8088/taskdetails.jsp?jobid=job_1395999255539_0006&tipid=task_1395999255539_0006_m_000000 
----- 
Diagnostic Messages for this Task: 
Error: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.mapreduce.TableSplit 
     at java.net.URLClassLoader$1.run(URLClassLoader.java:202) 
     at java.security.AccessController.doPrivileged(Native Method) 
     at java.net.URLClassLoader.findClass(URLClassLoader.java:190) 
     at java.lang.ClassLoader.loadClass(ClassLoader.java:306) 
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) 
     at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 
     at java.lang.Class.getDeclaredConstructors0(Native Method) 
     at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) 
     at java.lang.Class.getConstructor0(Class.java:2699) 
     at java.lang.Class.getDeclaredConstructor(Class.java:1985) 
     at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:125) 
     at org.apache.hadoop.hive.ql.io.HiveInputFormat$HiveInputSplit.readFields(HiveInputFormat.java:144) 
     at org.apache.hadoop.io.serializer.WritableSerialization$WritableDeserializer.deserialize(WritableSerialization.java:71) 
     at org.apache.hadoop.io.serializer.WritableSerialization$WritableDeserializer.deserialize(WritableSerialization.java:42) 
     at org.apache.hadoop.mapred.MapTask.getSplitDetails(MapTask.java:370) 
     at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:402) 
     at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341) 
     at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162) 
     at java.security.AccessController.doPrivileged(Native Method) 
     at javax.security.auth.Subject.doAs(Subject.java:396) 
     at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491) 
     at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157) 


FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask 
MapReduce Jobs Launched: 
Job 0: Map: 1 HDFS Read: 0 HDFS Write: 0 FAIL 
Total MapReduce CPU Time Spent: 0 msec 

我明白,這是一個classpath的問題,但我所有的.jar小號複製到/usr/lib/Hive/lib/。我該如何解決?

回答

0
hive> select * from test1 where name = 'Amutha'; 
Total MapReduce jobs = 1 
Launching Job 1 out of 1 
Number of reduce tasks is set to 0 since there's no reduce operator 
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0 
2014-09-24 18:16:07,230 Stage-1 map = 0%, reduce = 0% 
2014-09-24 18:16:18,337 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:19,344 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:20,364 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:21,385 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:22,409 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:23,417 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:24,425 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:25,433 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:26,548 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:27,560 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:28,568 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:29,576 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 2.21 sec 
2014-09-24 18:16:30,598 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 2.21 sec 
MapReduce Total cumulative CPU time: 2 seconds 210 msec 
Ended Job = job_201409241729_0005 
MapReduce Jobs Launched: 
Job 0: Map: 1 Cumulative CPU: 2.21 sec HDFS Read: 323 HDFS Write: 0 SUCCESS 
Total MapReduce CPU Time Spent: 2 seconds 210 msec 
OK 
Time taken: 40.095 seconds 
hive> 
+2

你能更好地格式化這些信息嗎?這個答案還不夠清楚 – Xstian

+0

如果你實際解釋了你的答案而不是僅僅傾銷你的輸出,它也會有所幫助。 – skrrgwasme

+0

您能提供安裝的Hbase,Hadoop和Hive的版本嗎? – Afaque