You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "humengyu (Jira)" <ji...@apache.org> on 2020/02/14 13:32:00 UTC

[jira] [Updated] (SPARK-30830) method setQueryTimeout not support

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

humengyu updated SPARK-30830:
-----------------------------
    Summary: method setQueryTimeout not support  (was: method getQueryTimeout not support)

> method setQueryTimeout not support
> ----------------------------------
>
>                 Key: SPARK-30830
>                 URL: https://issues.apache.org/jira/browse/SPARK-30830
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: humengyu
>            Priority: Minor
>
> I found 
> {code:java}
> statement.setQueryTimeout(options.queryTimeout)
> {code}
> in org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD.$resolveTable 
> but the default version for hive-jdbc in spark2.x is 1.2.1.spark2:
> {code:java}
> @Override
> public void setQueryTimeout(int seconds) throws SQLException {
>   throw new SQLException("Method not supported");
> }
> {code}
> thus when I use hive-jdbc in spark, it will not work:
> {code:java}
> diagnostics: User class threw exception: java.sql.SQLException: Method not supporteddiagnostics: User class threw exception: java.sql.SQLException: Method not supported at org.apache.hive.jdbc.HiveStatement.setQueryTimeout(HiveStatement.java:739) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:60) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation$.getSchema(JDBCRelation.scala:210) at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:35) at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:318) at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:167) 
> {code}
>  I fixed this problem by repackaging hive-jdbc-1.2.1.spark2 :
> {code:java}
>   @Override
>   public void setQueryTimeout(int seconds) throws SQLException {
> //    throw new SQLException("Method not supported");
>   }
> {code}
> Do we have a better way?



--
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