You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "mustafa elbehery (JIRA)" <ji...@apache.org> on 2015/11/05 11:14:27 UTC
[jira] [Issue Comment Deleted] (SPARK-11526) JDBC to PostGIS throws
UnSupported Type exception
[ https://issues.apache.org/jira/browse/SPARK-11526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
mustafa elbehery updated SPARK-11526:
-------------------------------------
Comment: was deleted
(was: updated )
> 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; bq. val jdbcDF = sqlContext.read.format("jdbc").options(
> Map("url" -> "jdbc:postgresql:postgres",
> "dbtable" -> "affiliations")).load()
> 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; bq. val jdbcDF = sqlContext.read.format("jdbc").options(
> Map("url" -> "jdbc:postgis:nycesri",
> "dbtable" -> "ny_counties_clip")).load()
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org