title: Delete from cassandra Table in Spark
body: <p>I'm using Spark with cassandra. And i'm reading some rows from my table in order to delete theme using the PrimaryKey. This is my code : </p>
  
  <pre><code>val lines = sc.cassandraTable[(String, String, String, String)](CASSANDRA_SCHEMA, table).
    select("a","b","c","d").
    where("d=?", d).cache()
  
  lines.foreach(r =&gt; {
      val session: Session = connector.openSession
      val delete = s"DELETE FROM "+CASSANDRA_SCHEMA+"."+table+" where channel='"+r._1 +"' and ctid='"+r._2+"'and cvid='"+r._3+"';"
      session.execute(delete)
      session.close()
  })
  </code></pre>
  
  <p>But this method create an session for each row and it takes lot of time. So is it possible to delete my rows using sc.CassandraTable or another solution better then the mine.</p>
  
  <p>Thank you</p>