[ 
https://issues.apache.org/jira/browse/SPARK-11526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

mustafa elbehery reopened SPARK-11526:
--------------------------------------

> JDBC to PostGIS throws UnSupported Type exception
> -------------------------------------------------
>
>                 Key: SPARK-11526
>                 URL: https://issues.apache.org/jira/browse/SPARK-11526
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.1
>         Environment: Linux Based
>            Reporter: mustafa elbehery
>            Priority: Critical
>              Labels: easyfix
>         Attachments: Selection_007.png
>
>
> I have tried to use SparkSQL 
> [JDBC|http://spark.apache.org/docs/latest/sql-programming-guide.html#jdbc-to-other-databases]
>  to connect to *PostGIS* Database. Although the connection works fine with a 
> normal *PostgresSql* Database, it throws UnSupported Type Exception when I 
> try to query a Database with _PostGIS_ extension.
> To Further Explain, I have two Databases in my Postgresql, as follows :-
> 1- *postgres* : a normal database which supports only primitive types.
> 2- *nycesri* : a database which supports _spatial_ queries, using _postgis_ 
> extension. 
> When I tried to use the JDBC from SparkShell as mentioned in SparkSql docs, I 
> had the following results :- 
> 1- with *postgres*, I have retrieved the tables in the DataFrame object, and 
> could query it using the following code; 
> {color:red} val jdbcDF = sqlContext.read.format("jdbc").options(
>   Map("url" -> "jdbc:postgresql:postgres",
>   "dbtable" -> "affiliations")).load() {color}
> 2- *However*, when I tried to use the same way for querying *nycesri*, I have 
> got *unsupported Type 1111* exception, probably because the _postGis_ 
> extension unsupported. Following is the used code;
>  {color:red}  val jdbcDF = sqlContext.read.format("jdbc").options(
>   Map("url" -> "jdbc:postgis:nycesri",
>   "dbtable" -> "ny_counties_clip")).load() {color}
> I have tried to use PostGIS_JDBC.jar, but it did not work.  I have attached a 
> screenshot of the exception.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to