title: How to Submit a Query or a .sql file containing a query using spark-submit
body: <p>I want to run queries on spark. I have them all on my .sql files </p>
  
  <p>Currently the way i am running is :</p>
  
  <pre><code>spark-sql --master yarn /home/myuser/query.sql
  </code></pre>
  
  <p>But as soon as the query completes the execution it comes inside the <strong>spark-sql></strong> .... shell prompt And then the job status doesn't changes to Finished Successfully it shows RUNNING becoz the <strong>spark-sql></strong> shell is active so i have to explicitly do <strong>CTRL+C</strong> to come out of the shell.</p>
  
  <p>SO Basically i just want to submit a spark job which is actually a query using a shell script file and without getting inside any spark specific shell.</p>
  
  <p>I don't want to write a query in a class file and then build a jar and then submit.</p>