Support Questions
Find answers, ask questions, and share your expertise

Table not found: patient_info;

Hi, I have created a temp table in spark using following code & trying to fetch data "%sql select * from patient_info" ; however getting error Table not found: patient_info;

val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)

val df = sqlContext.sql("SELECT * FROM emr.patient_information_raw")


val dropDuplicates = df.dropDuplicates(Array("person_name","last_name","gender","person_date_of_birth"))

val filledEthnicity ="Colombian1", Array("ethnicity"))


val filledStreet ="Street", Array("street"))

val filledState ="Nevada", Array("state"))

val fillGender ="Female", Array("gender"))



%sql select * from patient_info

Table not found: patient_info;

set zeppelin.spark.sql.stacktrace = true to see full stacktrace


seems spark session is not visible to %sql session, can you try to create table from %livy.spark and access it using %livy.sql then you will be able to see table as both share same session.

%livy.spark select * from patient_info

<console>:33: error: not found: value select select * from patient_info

I tried in hive session

%hive select * from patient_info

getting bellow error

Error while compiling statement: FAILED: SemanticException [Error 10001]: Line 1:14 Table not found 'patient_info'

Can anyone please help me.

@Prasanta Sahoo Please comment this line : "val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)" and try. I think the issue is because you are creating sqlContext yourselt.