Running the hive queries from a file through code via sparkcontext or hivecontext (not through command line)
<p>Consider there are few hive queries in a file, my moto is to run the file using <code>hivecontext</code> or <code>sparkcontext</code></p>

<p>Using command line I can do that by <code>hive -f 'filepath/filename'</code>
But I have to run it via code (<code>hivecontext</code> or <code>sparkcontext</code>)
Can anybody help on this?</p>

<p>For a single query I can use:</p>

<pre><code>sparkContext.SQL('query')
</code></pre>

<p>But I have to run a file which is having queries.</p>