title: Querying cassandra error no viable alternative at input 'ALLOW'
body: <p>I'm trying to run a query on Cassandra through spark.</p>
  
  <p>When running this command:</p>
  
  <pre><code>val test = sc.cassandraTable[Person](keyspace,table)
                 .where("name=?","Jane").collect
  </code></pre>
  
  <p>I get the appropriate output for the query.</p>
  
  <p>When I try to use the <code>where</code> statement to enter the query as a whole string I get an error.</p>
  
  <p>I receive the query as a json:</p>
  
  <pre><code>{"clause": " name = 'Jane' "}
  </code></pre>
  
  <p>then turn it into a string.</p>
  
  <p>When running</p>
  
  <pre><code>val query = (json \ "clause").get.as[String]
  //turns json value into a string
  val test = sc.cassandraTable[Person](keyspace,table)
                     .where(query).collect
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>java.io.IOException: Exception during preparation of SELECT "uuid", "person", "age" FROM "test"."users" WHERE token("uuid") &gt; ? AND token("uuid") &lt;= ? AND  name = Jane    ALLOW FILTERING: line 1:232 no viable alternative at input 'ALLOW' (...&lt;= ? AND  name = [Jane]    ALLOW...)
          at com.datastax.spark.connector.rdd.CassandraTableScanRDD.createStatement(CassandraTableScanRDD.scala:288)
          at com.datastax.spark.connector.rdd.CassandraTableScanRDD.com$datastax$spark$connector$rdd$CassandraTableScanRDD$$fetchTokenRange(CassandraTableScanRDD.scala:302)
          at com.datastax.spark.connector.rdd.CassandraTableScanRDD$$anonfun$18.apply(CassandraTableScanRDD.scala:328)
          at com.datastax.spark.connector.rdd.CassandraTableScanRDD$$anonfun$18.apply(CassandraTableScanRDD.scala:328)
          at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:434)
          at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440)
          at com.datastax.spark.connector.util.CountingIterator.hasNext(CountingIterator.scala:12)
          at scala.collection.Iterator$class.foreach(Iterator.scala:893)
          at com.datastax.spark.connector.util.CountingIterator.foreach(CountingIterator.scala:4)
          at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:59)
  </code></pre>
  
  <p>I suspect that when I turn the json value " name = 'Jane' " into a string, I lose the single quotes hence I get " name = Jane " which of course raises an error. I tried escaping the single quotes with \ and with a second pair of single quotes around the name Jane <code>{"clause": " name = ''Jane'' "}</code>. It doesn't solve the issue.</p>
  
  <p>Edit: After further testing it's definitely the json that loses the single quotes and CQL needs them to perform the query. Can anyone suggest a way to escape/save the presence of the single quotes? I tried escaping with <code>\</code> double single quotes <code>''</code> . Is there a way to use JSON to provide proper whole CQL statements?</p>