从Amplab-shark运行查询到hdfs上的cassandra

时间:2014-08-04 15:16:41

标签: java hadoop cassandra apache-spark shark-sql

请帮助我们在hdfs中对cassandra进行Amplab-Shark查询。

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/mapreduce/task/JobContextImpl

我可以成功运行:

  • 使用数据库
  • show tables;

但不能运行任何选择语句,即:

select * from table;

我收到以下错误:

shark> select * from call limit 1;
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/mapreduce    /task/JobContextImpl
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at org.apache.hadoop.hive.ql.metadata.Table.getInputFormatClass(Table.java:302)
    at org.apache.hadoop.hive.ql.metadata.Table.<init>(Table.java:99)
    at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:989)
    at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:892)
    at     org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:1083)
    at     org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:1059)
    at     shark.parse.SharkSemanticAnalyzer.analyzeInternal(SharkSemanticAnalyzer.scala:139)
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:279)
    at shark.SharkDriver.compile(SharkDriver.scala:210)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:909)
    at shark.SharkCliDriver.processCmd(SharkCliDriver.scala:328)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
    at shark.SharkCliDriver$.main(SharkCliDriver.scala:233)
    at shark.SharkCliDriver.main(SharkCliDriver.scala)
 Caused by: java.lang.ClassNotFoundException:  org.apache.hadoop.mapreduce.task.JobContextImpl
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 17 more

谢谢

1 个答案:

答案 0 :(得分:0)

我需要查看完整配置以及如何设置表格以获得更好的答案。只是看看错误,你似乎错过了类路径上的一些hadoop罐子