使用cassandra处理程序运行配置单元查询时出现实例化错误

时间:2014-12-01 14:54:49

标签: cassandra hive hadoop2

我试图使用Cqlstoragehandler运行一个配置单元查询以下组件

hive 0.11.0 hadoop 2.5.1 cassandra 2.0.6

一旦我在cassandra中创建了表,我在hive中执行了以下步骤

CREATE EXTERNAL TABLE metric (api string, name string, time timestamp, value double) STORED BY 'org.apache.hadoop.hive.cassandra.cql.CqlStorageHandler' WITH SERDEPROPERTIES("cassandra.cf.name" = "metric","cassandra.host"="192.168.0.244","cassandra.port" = "9160") TBLPROPERTIES ("cassandra.ks.name" = "metrics");

我可以创建外部表。

我正在运行配置单元select * from metric;

我收到以下错误

hive> use metrics;
OK
Time taken: 0.018 seconds
hive> show tables;
OK
metric
Time taken: 0.573 seconds, Fetched: 1 row(s)
hive> select * from metric;
OK
Exception in thread "main" java.lang.InstantiationError: org.apache.hadoop.mapreduce.JobContext
    at org.apache.hadoop.hive.cassandra.input.cql.HiveCqlInputFormat.getSplits(HiveCqlInputFormat.java:165)
    at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:380)
    at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:508)
    at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:488)
    at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:136)
    at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1412)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:271)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

1 个答案:

答案 0 :(得分:0)

Hive的内部接口 - 处理程序所依赖的 - 已经改变了最后几个版本。不幸的是,这意味着Cqlstoragehandler需要特定版本的配置单元。对于Cassandra 2.0.6附带的版本,只有apache hive 12兼容(注意:这也不包括Cloudera的hive 12版本。)