I converted an RDD[myClass] to dataframe and then register it as an SQL table
my_rdd.toDF().registerTempTable(\"my_rdd\")
I have met the same error but in different case ,by solve it with using the same context. If you use hiveContext, make sure that you use it all the time, for example first sqlContext.sql("load data input XXX") , and then if you use hiveContext.sql("select * from XXX"), you will meet this problem.
Every context has it`s lifecycle. So do not use two context with the same dataFrame .