You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "dzcxzl (Jira)" <ji...@apache.org> on 2021/08/31 07:00:11 UTC

[jira] [Commented] (SPARK-36616) Unrecognized connection property 'url' when using Presto JDBC

    [ https://issues.apache.org/jira/browse/SPARK-36616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17407128#comment-17407128 ] 

dzcxzl commented on SPARK-36616:
--------------------------------

You can use the JdbcConnectionProvider interface provided by SPARK-32001 to create a jdbc connection.

> Unrecognized connection property 'url' when using Presto JDBC
> -------------------------------------------------------------
>
>                 Key: SPARK-36616
>                 URL: https://issues.apache.org/jira/browse/SPARK-36616
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.1.1
>            Reporter: Rajkumar Gunasekaran
>            Priority: Blocker
>
> Hi,  Here is my spark sql code, where I am trying to read a presto table based on this guide;  [https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html]
> {code:scala}
>  val df = spark.read
>  .format("jdbc")
>  .option("driver", "com.facebook.presto.jdbc.PrestoDriver")
>  .option("url", "jdbc:presto://localhost:8889/mycatalog")
>  .option("query", "select * from mydb.mytable limit 1")
>  .option("user", "myuserid")
>  .load()
> {code}
>  
>  I am getting the following exception: *_unrecognized connection property 'url'_* 
> {code:java}
> Exception in thread "main" java.sql.SQLException: Unrecognized connection property 'url'
>  at com.facebook.presto.jdbc.PrestoDriverUri.validateConnectionProperties(PrestoDriverUri.java:345)
>  at com.facebook.presto.jdbc.PrestoDriverUri.<init>(PrestoDriverUri.java:102)
>  at com.facebook.presto.jdbc.PrestoDriverUri.<init>(PrestoDriverUri.java:92)
>  at com.facebook.presto.jdbc.PrestoDriver.connect(PrestoDriver.java:87)
>  at org.apache.spark.sql.execution.datasources.jdbc.connection.BasicConnectionProvider.getConnection(BasicConnectionProvider.scala:49)
>  at org.apache.spark.sql.execution.datasources.jdbc.connection.ConnectionProvider$.create(ConnectionProvider.scala:68)
>  at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.$anonfun$createConnectionFactory$1(JdbcUtils.scala:62)
>  at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:56)
>  at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation$.getSchema(JDBCRelation.scala:226)
>  at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:35)
>  at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:354)
>  at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:326)
>  at org.apache.spark.sql.DataFrameReader.$anonfun$load$3(DataFrameReader.scala:308)
>  at scala.Option.getOrElse(Option.scala:189)
>  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:308)
>  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:226)
>  at org.apache.spark.sql.DataFrameReader.jdbc(DataFrameReader.scala:341)
>  
> {code}
> Seems like this issue is related to [https://github.com/prestodb/presto/issues/9254] where the property `url` is not a recognized property in Presto and looks like the fix needs to be done on the Spark side?
> Our development is blocked on this exception and would appreciate any guidance. Thanks!
> PS:
>  presto-jdbc version: 0.245 / 0.260



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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