Spark is an in-memory architecture, so you're not going to see it go faster than CQL for a simple select from 1 table on a few keys. Where you'll see a benefit is loading lots of data into memory and doing some "report like" query where you join data from multiple tables.
On Thu, Dec 11, 2014 at 8:09 AM, Ajay <ajay.ga...@gmail.com> wrote: > Hi, > > To test Spark SQL Vs CQL performance on Cassandra, I did the following: > > 1) Cassandra standalone server (1 server in a cluster) > 2) Spark Master and 1 Worker > Both running in a Thinkpad laptop with 4 cores and 8GB RAM. > 3) Written Spark SQL code using Cassandra-Spark Driver from Cassandra > (JavaApiDemo.java. Run with spark://127.0.0.1:7077 127.0.0.1) > 4) Writen CQL code using Java driver from Cassandra > (CassandraJavaApiDemo.java) > In both the case, I create 1 millions rows and query for 1 > > Observation: > 1) It takes less than 10 milliseconds using CQL (SELECT * FROM users WHERE > name='Anna') > 2) It takes around .6 second using Spark (either SELECT * FROM users WHERE > name='Anna' or javaFunctions(sc).cassandraTable("test", "people", > mapRowTo(Person.class)).where("name=?", "Anna"); > > Please let me know if I am missing something in Spark configuration or > Cassandra-Spark Driver. > > Thanks > Ajay Garga > > > > >