Consider there are few hive queries in a file, my moto is to run the file using hivecontext
or sparkcontext
Using command line I can do that by hive -f 'filepath/filename'
But I have to run it via code (hivecontext
or sparkcontext
)
Can anybody help on this?
For a single query I can use:
sparkContext.SQL('query')
But I have to run a file which is having queries.
Copyright Notice:Content Author:「Siva kumar」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40692999/running-the-hive-queries-from-a-file-through-code-via-sparkcontext-or-hivecontex