title: Read error with spark.read against SQL Server table (via JDBC Connection)
body: <p>I have a problem in Zeppelin when I try to create a dataframe reading directly from a SQL table. The problem is that I dont know how to read a SQL column with the geography type. </p>
  
  <p><a href="https://i.stack.imgur.com/pwqlS.png" rel="nofollow noreferrer">SQL table</a></p>
  
  <p>This is the code that I am using, and the error that I obtain.</p>
  
  <p><strong>Create JDBC connection</strong></p>
  
  <pre><code>import org.apache.spark.sql.SaveMode
  import java.util.Properties
  
  val jdbcHostname = "XX.XX.XX.XX"
  val jdbcDatabase = "databasename"
  val jdbcUsername = "user"
  val jdbcPassword = "XXXXXXXX"
  
  // Create the JDBC URL without passing in the user and password parameters.
  val jdbcUrl = s"jdbc:sqlserver://${jdbcHostname};database=${jdbcDatabase}"
  
  // Create a Properties() object to hold the parameters.
  val connectionProperties = new Properties()
  connectionProperties.put("user", s"${jdbcUsername}")
  connectionProperties.put("password", s"${jdbcPassword}")
  connectionProperties.setProperty("Driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
  </code></pre>
  
  <p><strong>Read from SQL</strong></p>
  
  <pre><code>import spark.implicits._
  
  val table = "tablename"
  
  val postcode_polygons = spark.
      read.
      jdbc(jdbcUrl, table, connectionProperties)
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>import spark.implicits._
  table: String = Lookup.Postcode50m_Lookup
  java.sql.SQLException: Unsupported type -158
    at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$getCatalystType(JdbcUtils.scala:233)
    at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$8.apply(JdbcUtils.scala:290)
    at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$8.apply(JdbcUtils.scala:290)
    at scala.Option.getOrElse(Option.scala:121)
    at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.getSchema(JdbcUtils.scala:289)
    at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:64)
    at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.&lt;init&gt;(JDBCRelation.scala:114)
    at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:52)
    at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:307)
    at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:178)
    at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:146)
    at org.apache.spark.sql.DataFrameReader.jdbc(DataFrameReader.scala:193)
  </code></pre>