I have a three lines program where I am registering a table and calling select * query. I know this is some issue with sqlcontext but I have not used any sqlcontext explicitly.
Following code works fine. I see my table registered: case class CEStats(bootstrap: String, threshold : String, TP : String, FP : String, FN : String, TN : String, precision : String, recall : String) val cestats = sc.textFile("/user/cloudera/zepplin/mergeStatisticsTest1Combine.txt").map(_.split(",")).map(p => CEStats(p(0), p(1), p(2), p(3), p(4), p(5), p(6), p(7))).toDF() cestats.registerTempTable("table") sqlContext.tableNames().foreach(println) But when i call %sql select * from table I am getting this exception org.apache.spark.sql.AnalysisException: no such table table; line 0 pos 0 at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42) at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveRelations$.getTable(Analyzer.scala:260)