当Spark在HBase上创建表时,找不到'addFamily'

时间:2016-01-25 12:15:37

标签: scala hadoop apache-spark hbase

我使用CDH5.5.0(Spark1.5.0和HBase1.0.0)

Spark Scala代码:

val tableDescr = new HTableDescriptor(classifyTable)
tableDescr.addFamily(newHColumnDescriptor(Bytes.toBytes("aaaaa")))
admin.createTable(tableDescr)

我明白了:

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.hbase.HTableDescriptor.addFamily(
Lorg/apache/hadoop/hbase/HColumnDescriptor;)Lorg/apache/hadoop/hbase/HTableDescriptor;
at Classify$.main(Classify.scala:141)
at Classify.main(Classify.scala)
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.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:672)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:120)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

请任何想法!

0 个答案:

没有答案