title: Connect spark to Cassandra3
body: <p>I have a cassandra3 cluster and I decided to use spark1.6 (prebuild with hadoop2.6) to analyze stored data.
  I want to implement some functionalities with python. In order to do this, first I ran following command:</p>
  
  <pre><code>./bin/spark-submit examples/src/main/python/cassandra_inputformat.py 192.168.100.251 test-keyspace test-table
  </code></pre>
  
  <p>With this command, I ran into 
  <code>java.lang.ClassNotFoundException: org.apache.cassandra.hadoop.cql3.CqlPagingInputFormat</code>.</p>
  
  <p>To solve this, I ran:</p>
  
  <pre><code>./bin/spark-submit --jars lib/spark-examples-1.6.0-hadoop2.6.0.jar examples/src/main/python/cassandra_inputformat.py 192.168.100.251 test-keyspace test-table
  </code></pre>
  
  <p>Then I got to the error <code>java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected</code>.</p>
  
  <p>After a little bit of searching, I got that the error is because hadoop1 jars are available with examples but hadoop2 is required to run them!</p>
  
  <p>So, I tried these solutions:</p>
  
  <ol>
  <li><p>I tried to use spark2.6 prebuild hadoop1 version, That get me to the problem that hadoop1 is not compatible with cassandra3.</p>
  
  <pre><code>py4j.protocol.Py4JJavaError: An error occurred while calling z:org.apache.spark.api.python.PythonRDD.newAPIHadoopRDD.
  : org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost): java.lang.RuntimeException: InvalidRequestException(why:unconfigured table schema_columnfamilies)
  </code></pre></li>
  <li><p>I tried to use <a href="https://github.com/datastax/spark-cassandra-connector" rel="nofollow">spark-cassandra-connector</a>, that still leads me to not being compatible with cassandra3 with error similiar to the above error saying table schema_columnfamilies is not configured.</p></li>
  </ol>