title: Unable to connect Spark to Cassandra DB in RStudio
body: <p>I've spent the last week trying to figure out how to use sparlyr to get spark to connect to cassandra on our local cluster, and I've hit a wall - any help would be greatly appreciated. I'm the only one trying to use R/Rstudio to make this connection (everyone else uses Java on NetBeans and Maven), and am not sure what I need to do to make this work.</p>
  
  <p>The stack I'm using is:
  Ubuntu 16.04 (in a VM)
  sparklyr: 0.5.3
  Spark: 2.0.0
  Scala: 2.11
  Cassandra: 3.7</p>
  
  <p>relevant config.yml file settings:</p>
  
  <pre><code># cassandra settings
  spark.cassandra.connection.host: &lt;cluster_address&gt;
  spark.cassandra.auth.username: &lt;user_name&gt;
  spark.cassandra.auth.password: &lt;password&gt;
  
  sparklyr.defaultPackages:
  - com.databricks:spark-csv_2.11:1.3.0
  - com.datastax.spark:spark-cassandra-connector_2.11:2.0.0-M1
  - com.datastax.cassandra:cassandra-driver-core:3.0.2
  </code></pre>
  
  <p>Sys.setnev setting set for local install of Java and spark, config set to use yml file. Spark connection initiated with:</p>
  
  <pre><code>sc &lt;- spark_connect(master = "spark://&lt;cluster_address&gt;", config = spark_config(file = "config.yml"))
  </code></pre>
  
  <p>Spark session initiated with:</p>
  
  <pre><code>sparkSession &lt;- sparklyr::invoke_static(sc, org.apache.spark.sql.SparkSession", "builder") %&gt;% 
      sparklyr::invoke("config", "spark.cassandra.connection.host", "&lt;cluster_address&gt;") %&gt;% 
      sparklyr::invoke("getOrCreate")
  </code></pre>
  
  <p>It all seems fine up to here, (sc connection and sparkSession), but now attempting to access a cassandra table (table_1 in in keyspace_1), which I know exists:</p>
  
  <pre><code>cass_df &lt;- invoke(sparkSession, "read") %&gt;% 
  invoke("format", "org.apache.spark.sql.cassandra") %&gt;% 
  invoke("option", "keyspace", "keyspace_1") %&gt;% 
  invoke("option", "table", "table_1") %&gt;% 
  invoke("load")
  </code></pre>
  
  <p>throws up the following error:</p>
  
  <pre><code>Error: java.lang.IllegalArgumentException: Cannot build a cluster without contact points
  at com.datastax.driver.core.Cluster.checkNotEmpty(Cluster.java:123)
  at com.datastax.driver.core.Cluster.(Cluster.java:116)
  at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:182)
  at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1274)
  at com.datastax.spark.connector.cql.DefaultConnectionFactory$.createCluster(CassandraConnectionFactory.scala:92) . . .
  </code></pre>