title: How to test a Spark SQL Query without Scala
body: <p>I am trying to figure out how to test Spark SQL queries against a Cassandra database -- kind of like you would in SQL Server Management Studio. Currently I have to open the Spark Console and type Scala commands which is really tedious and error prone. </p>
  
  <p>Something like:</p>
  
  <pre><code>scala &gt; var query = csc.sql("select * from users");
  scala &gt; query.collect().foreach(println)
  </code></pre>
  
  <p>Especially with longer queries this can be a real pain.</p>
  
  <p>This seems like a terribly inefficient way to test if your query is correct and what data you will get back. The other issue is when your query is wrong you get back a mile long error message and you have to scroll up the console to find it. How do I test my spark queries without using the console or writing my own application?</p>