title: Why Apache Spark is performing the filters on client
body: <p>Being newbie on apache spark, facing some issue on fetching Cassandra data on Spark. </p>
  
  <pre><code>List&lt;String&gt; dates = Arrays.asList("2015-01-21","2015-01-22");
  CassandraJavaRDD&lt;A&gt; aRDD = CassandraJavaUtil.javaFunctions(sc).
                      cassandraTable("testing", "cf_text",CassandraJavaUtil.mapRowTo(A.class, colMap)).
                      where("Id=? and date IN ?","Open",dates);
  </code></pre>
  
  <p>This query is not filtering data on the cassandra server. While this java statement is executing its shooting up the memory and finally throwing spark java.lang.OutOfMemoryError exception. Query should be filtering out data on the cassandra server instead of client side as mentioned on <a href="https://github.com/datastax/spark-cassandra-connector/blob/master/doc/3_selection.md" rel="nofollow">https://github.com/datastax/spark-cassandra-connector/blob/master/doc/3_selection.md</a>.</p>
  
  <p>While i am performing the query with filters on the cassandra cqlsh its performing fine but performing the query without the filter (where clause) is giving timeout which is expected. So its clear that spark is not applying the filters on the client side. </p>
  
  <pre><code>SparkConf conf = new SparkConf();
              conf.setAppName("Test");
              conf.setMaster("local[8]");
              conf.set("spark.cassandra.connection.host", "192.168.1.15")
  </code></pre>
  
  <p>Why filters are applied on the client side and how it can be improved to apply the filters on the server side.</p>
  
  <p>How we could configure the spark cluster on top of the cassandra cluster on windows platform??</p>