title: Connect to Vertica from Spark 2.3.1 Scala 2.11.8 with jdbc
body: <p>I am trying to connect to a Vertica dB with Spark v2.3.1 Scala 2.11.8 using jdbc.</p>
  
  <p>On the Vertica website: <a href="https://www.vertica.com/blog/whats-new-vertica-8-1-connector-apache-spark/" rel="nofollow noreferrer">https://www.vertica.com/blog/whats-new-vertica-8-1-connector-apache-spark/</a> </p>
  
  <p>It says that I can download the Spark Connector at the following location: <a href="https://my.vertica.com/download/vertica/8-1-x/" rel="nofollow noreferrer">https://my.vertica.com/download/vertica/8-1-x/</a> </p>
  
  <p>As I click to the link, it takes me to the log-in page, after I pass the log-in a yellow box pops at the top and says that I do not have permission to view that download.</p>
  
  <p>I tried another route, this time to download from Vertica's download page. Under the Linux package there are 3 jar files (vertica-javadoc, vertica-jdbc, vertica-jdbc-8.0.1-0), but I cannot find the Vertica-Spark Connector (i.e.: vertica-8.1.0_spark2.0_scala2.11.jar). I downloaded the 3 jars.</p>
  
  <p>In my Scala Eclipse IDE, I loaded the 3 jar files (vertica-javadoc, vertica-jdbc, vertica-jdbc-8.0.1-0), and used the following script to connect to Vertica:</p>
  
  <pre><code>val url = "jdbc:vertica//hostname/DBName?username=username&amp;password=pw"
  
  val query = "SELECT * FROM TABLE;"
  
  val df = spark.read.format("jdbc")
  .option("driver", "com.vertica.jdbc.Driver")
  .option("url", url)
  .option("dbtable", query)
  .load()
  </code></pre>
  
  <p>And get the following errors:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:70)
      at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.&lt;init&gt;(JDBCRelation.scala:115)
      at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:52)
      at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:340)
      at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:239)
      at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:227)
      at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:164)
      at att.com.vert2$.main(vert2.scala:37)
      at att.com.vert2.main(vert2.scala)
  </code></pre>
  
  <p>What am I doing wrong here? Am I missing the Vertica-Spark Connector? In case it is the Connector where can I download it from?</p>
  
  <p>Cheers.</p>