简体   繁体   中英

createOrReplaceTempView is not a member of org.apache.spark.rdd.RDD

I am using hadoop 2.7.2, hbase 1.4.9, spark 2.2.0, scala 2.11.8 and java 1.8 . I run this command whithout having any error:

val Patterns_fromHbase = mimic_PatternsFromHbase.mapPartitions(f=> f.map(row1 => (Bytes.toString(row1._2.getRow), Bytes.toString(row1._2.getValue(Bytes.toBytes("sepsiscategories"),Bytes.toBytes("subject_id")))))).toDF("id","subject_id")

Then I run this command:

mimic_PatternsFromHbase.createOrReplaceTempView("subject_id_table")

and I just have this error:

:57: error: value createOrReplaceTempView is not a member of org.apache.spark.rdd.RDD[(org.apache.hadoop.hbase.io.ImmutableBytesWritable, org.apache.hadoop.hbase.client.Result)] mimic_PatternsFromHbase.createOrReplaceTempView("subject_id_table")

what is the cause of this error and how to fix it please

I found my fault, it is a fault of bad attention. in the place to call createOrReplaceView method by calling them by Patterns_fromHbase I called her by mimic_PatternsFromHbase

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM