查询WHERE子句不起作用

问题描述 投票:3回答:1

这是Integrating Hbase with Hive: Register Hbase table问题的继续。

我从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

我知道这是一个类路径问题,但我将所有.jars复制到/usr/lib/Hive/lib/。我该如何解决?

hive hbase bigdata hortonworks-data-platform
1个回答
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> 
© www.soinside.com 2019 - 2024. All rights reserved.