I would like to execute a set of hiveQL statements in my spark driver code, something like below
var res = hiveContext.sql("""use testdb;drop table temp;select ...")
When i executed this code, it gave me an error saying
Error: missing EOF near testdb
Can someone point to me where I am going wrong? Is it really possible to execute more than one statement using the approach above?
Further, i tried putting all my statements in a file "test.hql", and used the below code snippet.
sqlContext.sql(scala.io.Source.fromFile("mytest.hql").mkString)
Still got the same error as above.
Any thoughts?